Rename package: tobiko.shell.paramiko -> tobiko.shell.ssh
This should avoid confusion when it is required to import paramiko and tobiko.shell.paramiko packages on the same module a the same time. Example: import paramiko from tobiko.shell import ssh Change-Id: I191c4ea69331b923e383b0f3d25ab979efa15273
This commit is contained in:
parent
d762d0729d
commit
75781a0663
@ -27,7 +27,7 @@ LOG = log.getLogger(__name__)
|
||||
CONFIG_MODULES = ['tobiko.openstack.keystone.config',
|
||||
'tobiko.openstack.neutron.config',
|
||||
'tobiko.openstack.nova.config',
|
||||
'tobiko.shell.paramiko.config',
|
||||
'tobiko.shell.ssh.config',
|
||||
'tobiko.shell.ping.config',
|
||||
'tobiko.shell.sh.config']
|
||||
|
||||
|
@ -25,7 +25,7 @@ from oslo_log import log
|
||||
import six
|
||||
|
||||
import tobiko
|
||||
from tobiko.shell import paramiko
|
||||
from tobiko.shell import ssh
|
||||
from tobiko.shell.sh import _exception
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ def execute(command, stdin=None, environment=None, timeout=None, shell=None,
|
||||
else:
|
||||
command = [str(a) for a in command]
|
||||
|
||||
ssh_client = ssh_client or paramiko.ssh_proxy_client()
|
||||
ssh_client = ssh_client or ssh.ssh_proxy_client()
|
||||
if ssh_client:
|
||||
result = execute_remote_command(command=command, stdin=stdin,
|
||||
environment=environment,
|
||||
@ -104,7 +104,7 @@ def execute_remote_command(command, ssh_client, stdin=None, timeout=None,
|
||||
if shell:
|
||||
command = shell.split() + [str(subprocess.list2cmdline(command))]
|
||||
|
||||
if isinstance(ssh_client, paramiko.SSHClientFixture):
|
||||
if isinstance(ssh_client, ssh.SSHClientFixture):
|
||||
# Connect to fixture
|
||||
ssh_client = tobiko.setup_fixture(ssh_client).client
|
||||
|
||||
|
@ -15,12 +15,8 @@
|
||||
# under the License.
|
||||
from __future__ import absolute_import
|
||||
|
||||
import paramiko
|
||||
|
||||
from tobiko.shell.paramiko import _config
|
||||
from tobiko.shell.paramiko import _client
|
||||
|
||||
SSHException = paramiko.SSHException
|
||||
from tobiko.shell.ssh import _config
|
||||
from tobiko.shell.ssh import _client
|
||||
|
||||
SSHHostConfig = _config.SSHHostConfig
|
||||
|
@ -23,7 +23,7 @@ import paramiko
|
||||
from oslo_log import log
|
||||
|
||||
import tobiko
|
||||
from tobiko.shell.paramiko import _config
|
||||
from tobiko.shell.ssh import _config
|
||||
|
||||
|
||||
LOG = log.getLogger(__name__)
|
@ -34,7 +34,7 @@ class SSHParamikoConfFixture(tobiko.SharedFixture):
|
||||
def setup_fixture(self):
|
||||
from tobiko import config
|
||||
CONF = config.CONF
|
||||
self.conf = CONF.tobiko.paramiko
|
||||
self.conf = CONF.tobiko.ssh
|
||||
|
||||
def __getattr__(self, name):
|
||||
return getattr(self.conf, name)
|
@ -19,7 +19,7 @@ from oslo_log import log
|
||||
|
||||
def register_tobiko_options(conf):
|
||||
conf.register_opts(
|
||||
group=cfg.OptGroup('paramiko'),
|
||||
group=cfg.OptGroup('ssh'),
|
||||
opts=[cfg.BoolOpt('debug',
|
||||
default=False,
|
||||
help=('Logout debugging messages of paramiko '
|
||||
@ -59,7 +59,7 @@ def register_tobiko_options(conf):
|
||||
|
||||
def setup_tobiko_config(conf):
|
||||
paramiko_logger = log.getLogger('paramiko')
|
||||
if conf.paramiko.debug:
|
||||
if conf.ssh.debug:
|
||||
if not paramiko_logger.isEnabledFor(log.DEBUG):
|
||||
# Print paramiko debugging messages
|
||||
paramiko_logger.logger.setLevel(log.DEBUG)
|
@ -22,7 +22,7 @@ import paramiko
|
||||
|
||||
import tobiko
|
||||
from tobiko import config
|
||||
from tobiko.shell import paramiko as ssh
|
||||
from tobiko.shell import ssh
|
||||
from tobiko.tests import unit
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ class SSHClientFixtureTest(unit.TobikoUnitTest):
|
||||
fixture.setUp()
|
||||
|
||||
ssh_config = paramiko.SSHConfig()
|
||||
for ssh_config_file in CONF.tobiko.paramiko.config_files:
|
||||
for ssh_config_file in CONF.tobiko.ssh.config_files:
|
||||
if os.path.exists(ssh_config_file):
|
||||
with open(ssh_config_file) as f:
|
||||
ssh_config.parse(f)
|
Loading…
x
Reference in New Issue
Block a user