Allow to get host_config and connect parameters before connecting to SSH server
Change-Id: I6423e6fbfac2bd8fe08c0995960e89624440d01e
This commit is contained in:
parent
9afc448f94
commit
75f6673aad
@ -96,6 +96,10 @@ class OpenStackTopologyNode(object):
|
||||
def add_group(self, group):
|
||||
self.groups.add(group)
|
||||
|
||||
@property
|
||||
def ssh_parameters(self):
|
||||
return self.ssh_client.setup_connect_parameters()
|
||||
|
||||
def __repr__(self):
|
||||
return "{cls!s}<name={name!r}>".format(cls=type(self).__name__,
|
||||
name=self.name)
|
||||
|
@ -230,7 +230,6 @@ class SSHClientFixture(tobiko.SharedFixture):
|
||||
schema=schema, **kwargs)
|
||||
|
||||
def setup_fixture(self):
|
||||
self.setup_host_config()
|
||||
self.setup_connect_parameters()
|
||||
self.setup_ssh_client()
|
||||
|
||||
@ -238,6 +237,7 @@ class SSHClientFixture(tobiko.SharedFixture):
|
||||
if not self.host_config:
|
||||
self.host_config = _config.ssh_host_config(
|
||||
host=self.host, config_files=self.config_files)
|
||||
return self.host_config
|
||||
|
||||
def setup_connect_parameters(self):
|
||||
"""Fill connect parameters dict
|
||||
@ -247,7 +247,10 @@ class SSHClientFixture(tobiko.SharedFixture):
|
||||
- parameters got from ~/.ssh/config and tobiko.conf
|
||||
- parameters got from fixture object attributes
|
||||
"""
|
||||
self.connect_parameters = self.get_connect_parameters()
|
||||
self.setup_host_config()
|
||||
if not self.connect_parameters:
|
||||
self.connect_parameters = self.get_connect_parameters()
|
||||
return self.connect_parameters
|
||||
|
||||
def get_connect_parameters(self, schema=None):
|
||||
schema = dict(schema or self.schema)
|
||||
|
Loading…
Reference in New Issue
Block a user