def __init__(self):
self.tid = 1
+ self._execute = None
def set_execute(self, execute):
self._execute = execute
command_args.extend(extra_args)
self._execute(*command_args, run_as_root=True)
except putils.ProcessExecutionError as e:
- LOG.error(_("Failed to create iscsi target for volume "
- "id:%s.") % vol_id)
- LOG.error("%s" % str(e))
+ LOG.error(_("Failed to create iscsi target for volume "
+ "id:%s.") % vol_id)
+ LOG.error("%s" % str(e))
- raise exception.ISCSITargetCreateFailed(volume_id=vol_id)
+ raise exception.ISCSITargetCreateFailed(volume_id=vol_id)
iqn = '%s%s' % (self.iscsi_target_prefix, vol_id)
tid = self._get_target(iqn)
# NOTE(gfidente): version is formatted as follows:
# major.minor.patchlevel(library API version)[-customisation]
version = version_list[2]
- version_filter = "(\d+)\.(\d+)\.(\d+).*"
+ version_filter = r"(\d+)\.(\d+)\.(\d+).*"
r = re.search(version_filter, version)
version_tuple = tuple(map(int, r.group(1, 2, 3)))
return version_tuple