if 'obj' not in kwargs:
return self._print_info_cmd(rows=rows, **kwargs)
else:
- if kwargs['obj'] == self._flags['storwize_svc_volpool_name']:
+ pool_name = kwargs['obj'].strip('\'\"')
+ if pool_name == kwargs['obj']:
+ raise exception.InvalidInput(
+ reason=_('obj missing quotes %s') % kwargs['obj'])
+ elif pool_name == self._flags['storwize_svc_volpool_name']:
row = rows[1]
- elif kwargs['obj'] == 'openstack2':
+ elif pool_name == 'openstack2':
row = rows[2]
- elif kwargs['obj'] == 'openstack3':
+ elif pool_name == 'openstack3':
row = rows[3]
else:
return self._errors['CMMVC5754E']
'compressed_copy': volume_info['compressed_copy']}
volume_info['copies'] = {'0': vol_cp}
+ mdiskgrp = kwargs['mdiskgrp'].strip('\'\"')
+ if mdiskgrp == kwargs['mdiskgrp']:
+ raise exception.InvalidInput(
+ reason=_('mdiskgrp missing quotes %s') % kwargs['mdiskgrp'])
+
if volume_info['name'] in self._volumes_list:
return self._errors['CMMVC6035E']
else:
if 'mdiskgrp' not in kwargs:
return self._errors['CMMVC5707E']
mdiskgrp = kwargs['mdiskgrp'].strip('\'\"')
+ if mdiskgrp == kwargs['mdiskgrp']:
+ raise exception.InvalidInput(
+ reason=_('mdiskgrp missing quotes %s') % kwargs['mdiskgrp'])
copy_info = {}
copy_info['id'] = self._find_unused_id(vol['copies'])
return self.run_ssh_info(ssh_cmd)[0]
def lsmdiskgrp(self, pool):
- ssh_cmd = ['svcinfo', 'lsmdiskgrp', '-bytes', '-delim', '!', pool]
+ ssh_cmd = ['svcinfo', 'lsmdiskgrp', '-bytes', '-delim', '!',
+ '"%s"' % pool]
return self.run_ssh_info(ssh_cmd)[0]
def lsiogrp(self):
self.run_ssh_assert_no_output(ssh_cmd)
def mkvdisk(self, name, size, units, pool, opts, params):
- ssh_cmd = ['svctask', 'mkvdisk', '-name', name, '-mdiskgrp', pool,
- '-iogrp', str(opts['iogrp']), '-size', size, '-unit',
- units] + params
+ ssh_cmd = ['svctask', 'mkvdisk', '-name', name, '-mdiskgrp',
+ '"%s"' % pool, '-iogrp', str(opts['iogrp']), '-size',
+ size, '-unit', units] + params
return self.run_ssh_check_created(ssh_cmd)
def rmvdisk(self, vdisk, force=True):
def addvdiskcopy(self, vdisk, dest_pool, params):
ssh_cmd = (['svctask', 'addvdiskcopy'] + params + ['-mdiskgrp',
- dest_pool, vdisk])
+ '"%s"' % dest_pool, vdisk])
return self.run_ssh_check_created(ssh_cmd)
def lsvdiskcopy(self, vdisk, copy_id=None):