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
This commit is contained in:
Eric Harney 2013-10-21 14:55:43 -04:00
parent 727175b339
commit e0f8555ea8
5 changed files with 12 additions and 10 deletions

View File

@ -441,7 +441,7 @@ class LioAdm(TargetAdmin):
def __init__(self, root_helper, lio_initiator_iqns='', def __init__(self, root_helper, lio_initiator_iqns='',
iscsi_target_prefix='iqn.2010-10.org.openstack:', iscsi_target_prefix='iqn.2010-10.org.openstack:',
execute=putils.execute): 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.iscsi_target_prefix = iscsi_target_prefix
self.lio_initiator_iqns = lio_initiator_iqns self.lio_initiator_iqns = lio_initiator_iqns
@ -449,13 +449,13 @@ class LioAdm(TargetAdmin):
def _verify_rtstool(self): def _verify_rtstool(self):
try: try:
self._execute('rtstool', 'verify') self._execute('cinder-rtstool', 'verify')
except (OSError, putils.ProcessExecutionError): except (OSError, putils.ProcessExecutionError):
LOG.error(_('rtstool is not installed correctly')) LOG.error(_('cinder-rtstool is not installed correctly'))
raise raise
def _get_target(self, iqn): def _get_target(self, iqn):
(out, err) = self._execute('rtstool', (out, err) = self._execute('cinder-rtstool',
'get-targets', 'get-targets',
run_as_root=True) run_as_root=True)
lines = out.split('\n') lines = out.split('\n')
@ -485,7 +485,7 @@ class LioAdm(TargetAdmin):
extra_args.append(self.lio_initiator_iqns) extra_args.append(self.lio_initiator_iqns)
try: try:
command_args = ['rtstool', command_args = ['cinder-rtstool',
'create', 'create',
path, path,
name, name,
@ -516,7 +516,7 @@ class LioAdm(TargetAdmin):
iqn = '%s%s' % (self.iscsi_target_prefix, vol_uuid_name) iqn = '%s%s' % (self.iscsi_target_prefix, vol_uuid_name)
try: try:
self._execute('rtstool', self._execute('cinder-rtstool',
'delete', 'delete',
iqn, iqn,
run_as_root=True) run_as_root=True)
@ -543,7 +543,7 @@ class LioAdm(TargetAdmin):
# Add initiator iqns to target ACL # Add initiator iqns to target ACL
try: try:
self._execute('rtstool', 'add-initiator', self._execute('cinder-rtstool', 'add-initiator',
volume_iqn, volume_iqn,
auth_user, auth_user,
auth_pass, auth_pass,

View File

@ -198,9 +198,9 @@ class LioAdmTestCase(test.TestCase, TargetAdminTestCase):
self.persist_tempdir = tempfile.mkdtemp() self.persist_tempdir = tempfile.mkdtemp()
self.flags(iscsi_helper='lioadm') self.flags(iscsi_helper='lioadm')
self.script_template = "\n".join([ self.script_template = "\n".join([
'rtstool create ' 'cinder-rtstool create '
'/foo iqn.2011-09.org.foo.bar:blaa test_id test_pass', '/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): class ISERTgtAdmTestCase(TgtAdmTestCase):

View File

@ -6,7 +6,7 @@
ietadm: CommandFilter, ietadm, root ietadm: CommandFilter, ietadm, root
tgtadm: CommandFilter, tgtadm, root tgtadm: CommandFilter, tgtadm, root
tgt-admin: CommandFilter, tgt-admin, 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' # cinder/volume/driver.py: 'vgs', '--noheadings', '-o', 'name'
vgs: CommandFilter, vgs, root vgs: CommandFilter, vgs, root

View File

@ -19,6 +19,7 @@ python-keystoneclient>=0.4.1
python-novaclient>=2.15.0 python-novaclient>=2.15.0
python-swiftclient>=1.5 python-swiftclient>=1.5
Routes>=1.12.3 Routes>=1.12.3
rtslib-fb>=2.1.39
six>=1.4.1 six>=1.4.1
SQLAlchemy>=0.7.8,<=0.7.99 SQLAlchemy>=0.7.8,<=0.7.99
sqlalchemy-migrate>=0.7.2 sqlalchemy-migrate>=0.7.2

View File

@ -33,6 +33,7 @@ scripts =
bin/cinder-manage bin/cinder-manage
bin/cinder-rootwrap bin/cinder-rootwrap
bin/cinder-rpc-zmq-receiver bin/cinder-rpc-zmq-receiver
bin/cinder-rtstool
bin/cinder-scheduler bin/cinder-scheduler
bin/cinder-volume bin/cinder-volume
bin/cinder-volume-usage-audit bin/cinder-volume-usage-audit