From 0903603971033536751ba40df98a3c39175d3189 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Thu, 6 Sep 2012 14:50:50 -0400 Subject: [PATCH] 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 --- cinder/tests/test_iscsi.py | 2 +- cinder/volume/iscsi.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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) -- 2.45.2