self.flags(iscsi_helper='tgtadm')
self.flags(volumes_dir=self.persist_tempdir)
self.script_template = "\n".join([
- 'tgt-admin --conf %s/blaa --update iqn.2011-09.org.foo.bar:blaa'
- % self.persist_tempdir,
+ 'tgt-admin --update iqn.2011-09.org.foo.bar:blaa',
'tgt-admin --delete iqn.2010-10.org.openstack:volume-blaa'])
def tearDown(self):
""" % (name, path)
LOG.info(_('Creating volume: %s') % vol_id)
- volume_path = os.path.join(FLAGS.volumes_dir, vol_id)
+ volumes_dir = FLAGS.volumes_dir
+ volume_path = os.path.join(volumes_dir, vol_id)
f = open(volume_path, 'w+')
f.write(volume_conf)
try:
(out, err) = self._execute('tgt-admin',
- '--conf',
- volume_path,
'--update',
name,
run_as_root=True)
iqn = '%s%s' % (FLAGS.iscsi_target_prefix, vol_id)
tid = self._get_target(iqn)
if tid is None:
+ LOG.error(_("Failed to create iscsi target for volume "
+ "id:%(vol_id)s. Please ensure your tgtd config file "
+ "contains 'include %(volumes_dir)s/*'") % locals())
raise exception.NotFound()
return tid