← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/turnip:py3-remove-trivial-ensure-str into turnip:master

 

Colin Watson has proposed merging ~cjwatson/turnip:py3-remove-trivial-ensure-str into turnip:master.

Commit message:
Remove trivial uses of six.ensure_str

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/turnip/+git/turnip/+merge/405255

These are no longer needed now that we're on Python 3 everywhere.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/turnip:py3-remove-trivial-ensure-str into turnip:master.
diff --git a/sshserver.tac b/sshserver.tac
index 29afa38..fdc22c2 100644
--- a/sshserver.tac
+++ b/sshserver.tac
@@ -12,7 +12,6 @@ from __future__ import (
 
 import os
 
-import six
 from twisted.application import service
 from twisted.scripts.twistd import ServerOptions
 
@@ -34,8 +33,7 @@ def getSmartSSHService():
         # information to the main log?  Requires lazr.sshserver changes.
         main_log='turnip', access_log=os.path.join(log_path, 'turnip.access'),
         access_log_path=os.path.join(log_path, 'turnip-access.log'),
-        strport=six.ensure_str(
-            'tcp:{}'.format(int(config.get('smart_ssh_port')))),
+        strport='tcp:{}'.format(int(config.get('smart_ssh_port'))),
         moduli_path=config.get('moduli_path'))
 
 
diff --git a/turnip/api/tests/test_api.py b/turnip/api/tests/test_api.py
index a24c442..0863e5e 100644
--- a/turnip/api/tests/test_api.py
+++ b/turnip/api/tests/test_api.py
@@ -68,7 +68,7 @@ class ApiTestCase(TestCase, ApiRepoStoreMixin):
     def get_ref(self, ref):
         repo_path = six.ensure_text(self.repo_path)
         ref = six.ensure_text(ref)
-        url = six.ensure_str('/repo/{}/{}'.format(repo_path, ref))
+        url = '/repo/{}/{}'.format(repo_path, ref)
         resp = self.app.get(quote(url))
         return resp.json
 
diff --git a/turnip/pack/tests/test_functional.py b/turnip/pack/tests/test_functional.py
index dbeb2dc..6fcb7ec 100644
--- a/turnip/pack/tests/test_functional.py
+++ b/turnip/pack/tests/test_functional.py
@@ -986,7 +986,7 @@ class TestSmartSSHServiceFunctional(FrontendFunctionalTestMixin, TestCase):
             private_key_path=private_host_key, public_key_path=public_host_key,
             main_log="turnip", access_log="turnip.access",
             access_log_path=os.path.join(root, "access.log"),
-            strport=six.ensure_str('tcp:0'), moduli_path="/etc/ssh/moduli")
+            strport='tcp:0', moduli_path="/etc/ssh/moduli")
         self.service.startService()
         self.addCleanup(self.service.stopService)
         socket = self.service.service._waitingForPort.result.socket
diff --git a/turnipserver.py b/turnipserver.py
index f76467b..d61edec 100644
--- a/turnipserver.py
+++ b/turnipserver.py
@@ -9,7 +9,6 @@ from __future__ import (
 
 import os
 
-import six
 import statsd
 from twisted.internet import reactor
 from twisted.web import server
@@ -84,7 +83,7 @@ smartssh_service = SmartSSHService(
     public_key_path=config.get('public_ssh_key_path'),
     main_log='turnip', access_log=os.path.join(LOG_PATH, 'turnip.access'),
     access_log_path=os.path.join(LOG_PATH, 'turnip-access.log'),
-    strport=six.ensure_str('tcp:{}'.format(int(config.get('smart_ssh_port')))),
+    strport='tcp:{}'.format(int(config.get('smart_ssh_port'))),
     moduli_path=config.get('moduli_path'))
 smartssh_service.startService()