]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fixes remove_export for IetAdm
authorMotoKen <motokentsai@gmail.com>
Tue, 25 Sep 2012 05:08:34 +0000 (13:08 +0800)
committerJohn Griffith <john.griffith@solidfire.com>
Tue, 25 Sep 2012 21:57:27 +0000 (15:57 -0600)
* Corrects indentation.
* Uses specific iqn as keyword argument.

Fixes bug 1055401

Change-Id: Ie99dd8a34924f0d7f447cf41a305353659a51d11
(cherry picked from commit 5b61536fdf17332f48af4b422fe23c2e153934a1)

cinder/volume/driver.py
cinder/volume/iscsi.py

index a0bc3941b81cdc55a4bcb2daf5fc05b3648ccd23..76077c6f870056b228a18dd1514bb14621b2508c 100644 (file)
@@ -394,7 +394,7 @@ class ISCSIDriver(VolumeDriver):
             except exception.NotFound:
                 LOG.info(_("Skipping remove_export. No iscsi_target "
                            "provisioned for volume: %s"), volume['id'])
-            return
+                return
         else:
             iscsi_target = 0
 
index ec6e408946e09ea336feacaf32857f30e070d7b0..54bc93e13ee7cd06c0c107fe547e256111b05eb6 100644 (file)
@@ -75,7 +75,7 @@ class TargetAdmin(object):
         """Delete a target."""
         raise NotImplementedError()
 
-    def _show_target(self, tid, **kwargs):
+    def show_target(self, tid, iqn=None, **kwargs):
         """Query the given target ID."""
         raise NotImplementedError()
 
@@ -168,9 +168,7 @@ class TgtAdm(TargetAdmin):
 
         os.unlink(volume_path)
 
-    def show_target(self, tid, **kwargs):
-        iqn = kwargs.get('iqn', None)
-
+    def show_target(self, tid, iqn=None, **kwargs):
         if iqn is None:
             raise exception.InvalidParameterValue(
                 err=_('valid iqn needed for show_target'))
@@ -198,16 +196,16 @@ class IetAdm(TargetAdmin):
 
     def _new_target(self, name, tid, **kwargs):
         self._run('--op', 'new',
-                 '--tid=%s' % tid,
-                 '--params', 'Name=%s' % name,
-                 **kwargs)
+                  '--tid=%s' % tid,
+                  '--params', 'Name=%s' % name,
+                  **kwargs)
 
     def _delete_target(self, tid, **kwargs):
         self._run('--op', 'delete',
                   '--tid=%s' % tid,
                   **kwargs)
 
-    def show_target(self, tid, **kwargs):
+    def show_target(self, tid, iqn=None, **kwargs):
         self._run('--op', 'show',
                   '--tid=%s' % tid,
                   **kwargs)