From 6be85774aec674eef7bfbf66f8885a4531c7c605 Mon Sep 17 00:00:00 2001 From: Michael Still Date: Tue, 7 May 2013 20:51:24 +1000 Subject: Convert to using newly imported processutils. This change moves nova over to using the newly imported trycmd() and ssh_execute() implementations from oslo's processutils. Change-Id: Ied2bb1eeb0cbdc6903a4028a60c89ca9e23656b4 --- nova/virt/baremetal/virtual_power_driver.py | 5 ++--- nova/virt/powervm/blockdev.py | 6 +++--- nova/virt/powervm/common.py | 5 ++--- nova/virt/powervm/operator.py | 5 ++--- 4 files changed, 9 insertions(+), 12 deletions(-) (limited to 'nova/virt') diff --git a/nova/virt/baremetal/virtual_power_driver.py b/nova/virt/baremetal/virtual_power_driver.py index 22dd815d0..e110bf436 100644 --- a/nova/virt/baremetal/virtual_power_driver.py +++ b/nova/virt/baremetal/virtual_power_driver.py @@ -24,7 +24,6 @@ from nova import exception from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.openstack.common import processutils -from nova import utils from nova.virt.baremetal import baremetal_states from nova.virt.baremetal import base from nova.virt.baremetal import db @@ -230,8 +229,8 @@ class VirtualPowerManager(base.PowerManager): cmd = '%s %s' % (self._vp_cmd.base_cmd, cmd) try: - stdout, stderr = utils.ssh_execute(self._connection, cmd, - check_exit_code=check_exit_code) + stdout, stderr = processutils.ssh_execute( + self._connection, cmd, check_exit_code=check_exit_code) result = stdout.strip().splitlines() LOG.debug('Result for run_command: %s' % result) except processutils.ProcessExecutionError: diff --git a/nova/virt/powervm/blockdev.py b/nova/virt/powervm/blockdev.py index 657e96f06..6291ae558 100644 --- a/nova/virt/powervm/blockdev.py +++ b/nova/virt/powervm/blockdev.py @@ -25,7 +25,7 @@ from nova.compute import task_states from nova.image import glance from nova.openstack.common import excutils from nova.openstack.common import log as logging -from nova import utils +from nova.openstack.common import processutils from nova.virt import images from nova.virt.powervm import command from nova.virt.powervm import common @@ -531,8 +531,8 @@ class PowerVMLocalVolumeAdapter(PowerVMDiskAdapter): :param command: String with the command to run. """ self._set_connection() - stdout, stderr = utils.ssh_execute(self._connection, cmd, - check_exit_code=check_exit_code) + stdout, stderr = processutils.ssh_execute( + self._connection, cmd, check_exit_code=check_exit_code) error_text = stderr.strip() if error_text: diff --git a/nova/virt/powervm/common.py b/nova/virt/powervm/common.py index dd6517dcd..1441a44e3 100644 --- a/nova/virt/powervm/common.py +++ b/nova/virt/powervm/common.py @@ -23,7 +23,6 @@ import paramiko from nova.openstack.common import log as logging from nova.openstack.common import processutils -from nova import utils from nova.virt.powervm import constants from nova.virt.powervm import exception @@ -85,7 +84,7 @@ def ssh_command_as_root(ssh_connection, cmd, check_exit_code=True): stdin.flush() exit_status = chan.recv_exit_status() - # Lets handle the error just like nova.utils.ssh_execute does. + # Lets handle the error just like processutils.ssh_execute does. if exit_status != -1: LOG.debug(_('Result was %s') % exit_status) if check_exit_code and exit_status != 0: @@ -190,7 +189,7 @@ def vios_to_vios_auth(source, dest, conn_info): dest_conn_obj = ssh_connect(dest_conn_info) def run_command(conn_obj, cmd): - stdout, stderr = utils.ssh_execute(conn_obj, cmd) + stdout, stderr = processutils.ssh_execute(conn_obj, cmd) return stdout.strip().splitlines() def build_keypair_on_source(): diff --git a/nova/virt/powervm/operator.py b/nova/virt/powervm/operator.py index b5ead9064..ef7814357 100644 --- a/nova/virt/powervm/operator.py +++ b/nova/virt/powervm/operator.py @@ -25,7 +25,6 @@ from nova.compute import power_state from nova.openstack.common import excutils from nova.openstack.common import log as logging from nova.openstack.common import processutils -from nova import utils from nova.virt.powervm import blockdev from nova.virt.powervm import command from nova.virt.powervm import common @@ -664,8 +663,8 @@ class BaseOperator(object): :param command: String with the command to run. """ self._set_connection() - stdout, stderr = utils.ssh_execute(self._connection, cmd, - check_exit_code=check_exit_code) + stdout, stderr = processutils.ssh_execute( + self._connection, cmd, check_exit_code=check_exit_code) error_text = stderr.strip() if error_text: -- cgit