launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #25669
[Merge] ~pappacena/turnip:py3-ssh-command-str into turnip:master
Thiago F. Pappacena has proposed merging ~pappacena/turnip:py3-ssh-command-str into turnip:master.
Commit message:
Dealing with ssh commands as str (shlex.split doesn't like bytes)
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~pappacena/turnip/+git/turnip/+merge/393778
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/turnip:py3-ssh-command-str into turnip:master.
diff --git a/turnip/pack/ssh.py b/turnip/pack/ssh.py
index 610766e..146fc13 100644
--- a/turnip/pack/ssh.py
+++ b/turnip/pack/ssh.py
@@ -125,7 +125,7 @@ class SmartSSHSession(DoNothingSession):
"""SSH session allowing only Git smart SSH requests."""
allowed_services = frozenset((
- b'git-upload-pack', b'git-receive-pack', b'turnip-set-symbolic-ref'))
+ 'git-upload-pack', 'git-receive-pack', 'turnip-set-symbolic-ref'))
def __init__(self, *args, **kwargs):
super(SmartSSHSession, self).__init__(*args, **kwargs)
@@ -170,6 +170,7 @@ class SmartSSHSession(DoNothingSession):
def execCommand(self, protocol, command):
"""See `ISession`."""
+ command = six.ensure_text(command)
words = shlex.split(command)
if len(words) > 1 and words[0] == "git":
# Accept "git foo" as if the caller said "git-foo". (This