From: Dan Prince Date: Thu, 6 Sep 2012 18:50:50 +0000 (-0400) Subject: Specify the conf file when creating a volume. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=0903603971033536751ba40df98a3c39175d3189;p=openstack-build%2Fcinder-build.git Specify the conf file when creating a volume. Updates the tgt-admin command to actually use the config file we create for the volume being created. This fixes an issue introduced in 9785963c841aff5ea1c159da81f93c2bf62c70c6 which breaks iscsi volume creation. Fixes LP Bug #1046985. Change-Id: I06e83c9ba351c2b4846b557a3abb170a51d506c0 --- diff --git a/cinder/tests/test_iscsi.py b/cinder/tests/test_iscsi.py index 1b358d928..8fac43059 100644 --- a/cinder/tests/test_iscsi.py +++ b/cinder/tests/test_iscsi.py @@ -92,7 +92,7 @@ class TgtAdmTestCase(test.TestCase, TargetAdminTestCase): self.flags(iscsi_helper='tgtadm') self.flags(volumes_dir="./") self.script_template = "\n".join([ - 'tgt-admin --update iqn.2011-09.org.foo.bar:blaa', + 'tgt-admin --conf ./blaa --update iqn.2011-09.org.foo.bar:blaa', 'tgt-admin --delete iqn.2010-10.org.openstack:volume-blaa']) diff --git a/cinder/volume/iscsi.py b/cinder/volume/iscsi.py index 691314393..625e31091 100644 --- a/cinder/volume/iscsi.py +++ b/cinder/volume/iscsi.py @@ -128,6 +128,8 @@ class TgtAdm(TargetAdmin): try: (out, err) = self._execute('tgt-admin', + '--conf', + volume_path, '--update', name, run_as_root=True)