From e7da101fcf40319a3011048832c70fbedf5c1c81 Mon Sep 17 00:00:00 2001 From: Muneyuki Noguchi Date: Thu, 24 Mar 2011 11:09:15 +0900 Subject: Split arguments of _execute in the iSCSI driver. --- nova/volume/driver.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/nova/volume/driver.py b/nova/volume/driver.py index 779b46755..9d9257bb7 100644 --- a/nova/volume/driver.py +++ b/nova/volume/driver.py @@ -422,18 +422,18 @@ class ISCSIDriver(VolumeDriver): return properties def _run_iscsiadm(self, iscsi_properties, iscsi_command): - command = ("sudo iscsiadm -m node -T %s -p %s %s" % - (iscsi_properties['target_iqn'], - iscsi_properties['target_portal'], - iscsi_command)) - (out, err) = self._execute(command) + (out, err) = self._execute('sudo', 'iscsiadm', '-m', 'node', '-T', + iscsi_properties['target_iqn'], + '-p', iscsi_properties['target_portal'], + iscsi_command) + LOG.debug("iscsiadm %s: stdout=%s stderr=%s" % (iscsi_command, out, err)) return (out, err) def _iscsiadm_update(self, iscsi_properties, property_key, property_value): - iscsi_command = ("--op update -n %s -v %s" % - (property_key, property_value)) + iscsi_command = ('--op', 'update', '-n', property_key, + '-v', property_value) return self._run_iscsiadm(iscsi_properties, iscsi_command) def discover_volume(self, context, volume): @@ -441,7 +441,7 @@ class ISCSIDriver(VolumeDriver): iscsi_properties = self._get_iscsi_properties(volume) if not iscsi_properties['target_discovered']: - self._run_iscsiadm(iscsi_properties, "--op new") + self._run_iscsiadm(iscsi_properties, ('--op', 'new')) if iscsi_properties.get('auth_method'): self._iscsiadm_update(iscsi_properties, @@ -493,7 +493,7 @@ class ISCSIDriver(VolumeDriver): iscsi_properties = self._get_iscsi_properties(volume) self._iscsiadm_update(iscsi_properties, "node.startup", "manual") self._run_iscsiadm(iscsi_properties, "--logout") - self._run_iscsiadm(iscsi_properties, "--op delete") + self._run_iscsiadm(iscsi_properties, ('--op', 'delete')) def check_for_export(self, context, volume_id): """Make sure volume is exported.""" -- cgit From 678fd691f9809184b10db42e263a69e63b027ee7 Mon Sep 17 00:00:00 2001 From: Muneyuki Noguchi Date: Thu, 24 Mar 2011 11:54:08 +0900 Subject: Remove a blank line. --- nova/volume/driver.py | 1 - 1 file changed, 1 deletion(-) diff --git a/nova/volume/driver.py b/nova/volume/driver.py index 9d9257bb7..28d08201b 100644 --- a/nova/volume/driver.py +++ b/nova/volume/driver.py @@ -426,7 +426,6 @@ class ISCSIDriver(VolumeDriver): iscsi_properties['target_iqn'], '-p', iscsi_properties['target_portal'], iscsi_command) - LOG.debug("iscsiadm %s: stdout=%s stderr=%s" % (iscsi_command, out, err)) return (out, err) -- cgit