Whitespace fixes.

This commit is contained in:
Olle Lundberg 2012-10-16 17:02:04 +02:00
parent 32424ba109
commit c79e6a3f92
2 changed files with 3 additions and 17 deletions

View File

@ -82,7 +82,6 @@ class SSHConfig (object):
""" """
Create a new OpenSSH config object. Create a new OpenSSH config object.
""" """
self._proxyregex = re.compile(r"^(proxycommand)\s*=*\s*(.*)", re.I)
self._config = [] self._config = []
def parse(self, file_obj): def parse(self, file_obj):
@ -98,7 +97,6 @@ class SSHConfig (object):
if (line == '') or (line[0] == '#'): if (line == '') or (line[0] == '#'):
continue continue
if '=' in line: if '=' in line:
<<<<<<< HEAD
# Ensure ProxyCommand gets properly split # Ensure ProxyCommand gets properly split
if line.lower().strip().startswith('proxycommand'): if line.lower().strip().startswith('proxycommand'):
match = proxy_re.match(line) match = proxy_re.match(line)
@ -106,20 +104,6 @@ class SSHConfig (object):
else: else:
key, value = line.split('=', 1) key, value = line.split('=', 1)
key = key.strip().lower() key = key.strip().lower()
||||||| merged common ancestors
key, value = line.split('=', 1)
key = key.strip().lower()
=======
if not line.lower().startswith('proxycommand'):
key, value = line.split('=', 1)
key = key.strip().lower()
else:
#ProxyCommand have been specified with an equal
# sign. Eat that and split in two groups.
match = self._proxyregex.match(line)
key = match.group(1).lower()
value = match.group(2)
>>>>>>> Implement support for parsing proxycommand.
else: else:
# find first whitespace, and split there # find first whitespace, and split there
i = 0 i = 0

View File

@ -205,6 +205,7 @@ Host *
self.assertRaises(AssertionError, self.assertRaises(AssertionError,
lambda: paramiko.util.retry_on_signal(raises_other_exception)) lambda: paramiko.util.retry_on_signal(raises_other_exception))
<<<<<<< HEAD
def test_9_proxycommand_config_equals_parsing(self): def test_9_proxycommand_config_equals_parsing(self):
""" """
ProxyCommand should not split on equals signs within the value. ProxyCommand should not split on equals signs within the value.
@ -271,7 +272,8 @@ Host *
paramiko.util.lookup_ssh_host_config(host, config), paramiko.util.lookup_ssh_host_config(host, config),
{'hostname': host, 'port': '8080'} {'hostname': host, 'port': '8080'}
) )
def test_10_host_config_test_proxycommand(self):
def test_12_host_config_test_proxycommand(self):
test_config_file = """ test_config_file = """
Host proxy-with-equal-divisor-and-space Host proxy-with-equal-divisor-and-space
ProxyCommand = foo=bar ProxyCommand = foo=bar