Merge "Fix test_ssh after Include directive is being ignored."

This commit is contained in:
Zuul 2019-06-06 16:49:04 +00:00 committed by Gerrit Code Review
commit 3ade57be61
2 changed files with 5 additions and 1 deletions

View File

@ -82,7 +82,10 @@ class SSHConfigFixture(tobiko.SharedFixture):
def lookup(self, host=None):
host_config = host and self.config.lookup(host) or {}
# remove unsupported directive
host_config.pop('include', None)
include_files = host_config.pop('include', None)
if include_files:
LOG.warning('Ignoring unsupported directive: Include %s',
include_files)
return SSHHostConfig(host=host,
ssh_config=self,
host_config=host_config,

View File

@ -62,6 +62,7 @@ class SSHClientFixtureTest(unit.TobikoUnitTest):
with open(ssh_config_file) as f:
ssh_config.parse(f)
expected_host_config = ssh_config.lookup(fixture.host)
expected_host_config.pop('include', None)
self.assertEqual(fixture.host, fixture.host_config.host)
self.assertEqual(expected_host_config,
fixture.host_config.host_config)