~ubuntu-branches/ubuntu/quantal/cinder/quantal-updates

« back to all changes in this revision

Viewing changes to cinder/volume/iscsi.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman
  • Date: 2013-04-25 17:29:58 UTC
  • mfrom: (13.1.4 quantal-proposed)
  • Revision ID: package-import@ubuntu.com-20130425172958-90kr8vvy7m5us6uh
Tags: 2012.2.4-0ubuntu1
* Dropped patches, applied upstream:
  - debian/patches/CVE-2013-1664.patch: [fcf249d]
* Resynchronize with stable/folsom (7916a2f4) (LP: #1179707):
  - [ec46ee0] NetApp: Folsom driver wrongly allows creation of volumes of
    different size from snapshots LP: 1164473
  - [00e8049] Cannot delete snapshot in "error" state LP: 1143661
  - [ce516f6] fanout_cast_to_server in kombu calls wrong method LP: 1074113
  - [cdb72ee] Enable direct testing with nosetests
  - [e63fa95] Netapp: delete_volume leaves qtree behind LP: 1099414
  - [8e702a1] NetApp: Can't delete a volume in error state LP: 1090167
  - [2e7f717] Don't have permission to delete a volume in error state
    LP: 1084273
  - [ad2dddd] Volume can't be deleted if tgt has had a reconnect. LP: 1159948
  - [db0595a] [SRU] There is now a dependency on paramiko v1.8.0
    (LP: #1150720)
  - [a616001] Only use iscsi_helper config option if using ISCSIDriver
  - [cbad3e3] Can not create volume snapshot when using NfsDriver LP: 1097266
  - [95c9f6f] Volume type extra specs update with empty body returns HTTP
    status 422 LP: 1090320
  - [aeece14] ISCSITargetRemoveFailed: Failed to remove iscsi target
    LP: 1101071
  - [fcf249d] DoS through XML entity expansion (CVE-2013-1664) LP: 1100282
* debian/patches/remove_paramiko_req_vers.patch: Remove version bump on
  paramiko requirement that was backported to stable/folsom.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
FLAGS = flags.FLAGS
42
42
FLAGS.register_opts(iscsi_helper_opt)
 
43
FLAGS.import_opt('volume_name_template', 'cinder.db')
43
44
 
44
45
 
45
46
class TargetAdmin(object):
159
160
 
160
161
    def remove_iscsi_target(self, tid, lun, vol_id, **kwargs):
161
162
        LOG.info(_('Removing volume: %s') % vol_id)
162
 
        vol_uuid_file = 'volume-%s' % vol_id
 
163
        vol_uuid_file = FLAGS.volume_name_template % vol_id
163
164
        volume_path = os.path.join(FLAGS.volumes_dir, vol_uuid_file)
164
165
        if os.path.isfile(volume_path):
165
166
            iqn = '%s%s' % (FLAGS.iscsi_target_prefix,
167
168
        else:
168
169
            raise exception.ISCSITargetRemoveFailed(volume_id=vol_id)
169
170
        try:
 
171
            # NOTE(vish): --force is a workaround for bug:
 
172
            #             https://bugs.launchpad.net/cinder/+bug/1159948
170
173
            self._execute('tgt-admin',
 
174
                          '--force',
171
175
                          '--delete',
172
176
                          iqn,
173
177
                          run_as_root=True)