From e0f8555ea8661cb34d4d762f63c499add888ef6e Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Mon, 21 Oct 2013 14:55:43 -0400 Subject: [PATCH] Rename "rtstool" to "cinder-rtstool", add dep With rtstool merged into Cinder, it should use the "cinder-" prefix. Add to setup.cfg scripts section for installation. Additionally, add the rtslib-fb>=2.1.39 dependency to Cinder's runtime requirements. Implements blueprint: lio-rtslib Change-Id: I715db09cb86145c6769c345f59ecda4d18b5e659 --- cinder/brick/iscsi/iscsi.py | 14 +++++++------- cinder/tests/test_iscsi.py | 4 ++-- etc/cinder/rootwrap.d/volume.filters | 2 +- requirements.txt | 1 + setup.cfg | 1 + 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/cinder/brick/iscsi/iscsi.py b/cinder/brick/iscsi/iscsi.py index 098ce5624..5438283a7 100644 --- a/cinder/brick/iscsi/iscsi.py +++ b/cinder/brick/iscsi/iscsi.py @@ -441,7 +441,7 @@ class LioAdm(TargetAdmin): def __init__(self, root_helper, lio_initiator_iqns='', iscsi_target_prefix='iqn.2010-10.org.openstack:', execute=putils.execute): - super(LioAdm, self).__init__('rtstool', root_helper, execute) + super(LioAdm, self).__init__('cinder-rtstool', root_helper, execute) self.iscsi_target_prefix = iscsi_target_prefix self.lio_initiator_iqns = lio_initiator_iqns @@ -449,13 +449,13 @@ class LioAdm(TargetAdmin): def _verify_rtstool(self): try: - self._execute('rtstool', 'verify') + self._execute('cinder-rtstool', 'verify') except (OSError, putils.ProcessExecutionError): - LOG.error(_('rtstool is not installed correctly')) + LOG.error(_('cinder-rtstool is not installed correctly')) raise def _get_target(self, iqn): - (out, err) = self._execute('rtstool', + (out, err) = self._execute('cinder-rtstool', 'get-targets', run_as_root=True) lines = out.split('\n') @@ -485,7 +485,7 @@ class LioAdm(TargetAdmin): extra_args.append(self.lio_initiator_iqns) try: - command_args = ['rtstool', + command_args = ['cinder-rtstool', 'create', path, name, @@ -516,7 +516,7 @@ class LioAdm(TargetAdmin): iqn = '%s%s' % (self.iscsi_target_prefix, vol_uuid_name) try: - self._execute('rtstool', + self._execute('cinder-rtstool', 'delete', iqn, run_as_root=True) @@ -543,7 +543,7 @@ class LioAdm(TargetAdmin): # Add initiator iqns to target ACL try: - self._execute('rtstool', 'add-initiator', + self._execute('cinder-rtstool', 'add-initiator', volume_iqn, auth_user, auth_pass, diff --git a/cinder/tests/test_iscsi.py b/cinder/tests/test_iscsi.py index bf2b6056e..f190bd525 100644 --- a/cinder/tests/test_iscsi.py +++ b/cinder/tests/test_iscsi.py @@ -198,9 +198,9 @@ class LioAdmTestCase(test.TestCase, TargetAdminTestCase): self.persist_tempdir = tempfile.mkdtemp() self.flags(iscsi_helper='lioadm') self.script_template = "\n".join([ - 'rtstool create ' + 'cinder-rtstool create ' '/foo iqn.2011-09.org.foo.bar:blaa test_id test_pass', - 'rtstool delete iqn.2010-10.org.openstack:volume-blaa']) + 'cinder-rtstool delete iqn.2010-10.org.openstack:volume-blaa']) class ISERTgtAdmTestCase(TgtAdmTestCase): diff --git a/etc/cinder/rootwrap.d/volume.filters b/etc/cinder/rootwrap.d/volume.filters index ba7ea698a..f9e46d32e 100644 --- a/etc/cinder/rootwrap.d/volume.filters +++ b/etc/cinder/rootwrap.d/volume.filters @@ -6,7 +6,7 @@ ietadm: CommandFilter, ietadm, root tgtadm: CommandFilter, tgtadm, root tgt-admin: CommandFilter, tgt-admin, root -rtstool: CommandFilter, rtstool, root +cinder-rtstool: CommandFilter, cinder-rtstool, root # cinder/volume/driver.py: 'vgs', '--noheadings', '-o', 'name' vgs: CommandFilter, vgs, root diff --git a/requirements.txt b/requirements.txt index d297a22b1..94946b3dc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,6 +19,7 @@ python-keystoneclient>=0.4.1 python-novaclient>=2.15.0 python-swiftclient>=1.5 Routes>=1.12.3 +rtslib-fb>=2.1.39 six>=1.4.1 SQLAlchemy>=0.7.8,<=0.7.99 sqlalchemy-migrate>=0.7.2 diff --git a/setup.cfg b/setup.cfg index 7a6fcaf7b..8377c21c7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,6 +33,7 @@ scripts = bin/cinder-manage bin/cinder-rootwrap bin/cinder-rpc-zmq-receiver + bin/cinder-rtstool bin/cinder-scheduler bin/cinder-volume bin/cinder-volume-usage-audit -- 2.45.2