~ubuntu-branches/ubuntu/saucy/nova/saucy-proposed

« back to all changes in this revision

Viewing changes to nova/volume/driver.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-05-24 13:12:53 UTC
  • mfrom: (1.1.55)
  • Revision ID: package-import@ubuntu.com-20120524131253-ommql08fg1en06ut
Tags: 2012.2~f1-0ubuntu1
* New upstream release.
* Prepare for quantal:
  - Dropped debian/patches/upstream/0006-Use-project_id-in-ec2.cloud._format_image.patch
  - Dropped debian/patches/upstream/0005-Populate-image-properties-with-project_id-again.patch
  - Dropped debian/patches/upstream/0004-Fixed-bug-962840-added-a-test-case.patch
  - Dropped debian/patches/upstream/0003-Allow-unprivileged-RADOS-users-to-access-rbd-volumes.patch
  - Dropped debian/patches/upstream/0002-Stop-libvirt-test-from-deleting-instances-dir.patch
  - Dropped debian/patches/upstream/0001-fix-bug-where-nova-ignores-glance-host-in-imageref.patch 
  - Dropped debian/patches/0001-fix-useexisting-deprecation-warnings.patch
* debian/control: Add python-keystone as a dependency. (LP: #907197)
* debian/patches/kombu_tests_timeout.patch: Refreshed.
* debian/nova.conf, debian/nova-common.postinst: Convert to new ini
  file configuration
* debian/patches/nova-manage_flagfile_location.patch: Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    cfg.StrOpt('volume_group',
37
37
               default='nova-volumes',
38
38
               help='Name for the VG that will contain exported volumes'),
39
 
    cfg.StrOpt('num_shell_tries',
 
39
    cfg.IntOpt('num_shell_tries',
40
40
               default=3,
41
41
               help='number of times to attempt to run flakey shell commands'),
42
 
    cfg.StrOpt('num_iscsi_scan_tries',
 
42
    cfg.IntOpt('num_iscsi_scan_tries',
43
43
               default=3,
44
44
               help='number of times to rescan iSCSI target to find volume'),
45
45
    cfg.IntOpt('iscsi_num_targets',
103
103
                                run_as_root=True)
104
104
        volume_groups = out.split()
105
105
        if not FLAGS.volume_group in volume_groups:
106
 
            raise exception.Error(_("volume group %s doesn't exist")
 
106
            raise exception.NovaException(_("volume group %s doesn't exist")
107
107
                                  % FLAGS.volume_group)
108
108
 
109
109
    def _create_volume(self, volume_name, sizestr):
267
267
            iscsi_target = self.db.volume_get_iscsi_target_num(context,
268
268
                                                           volume['id'])
269
269
        except exception.NotFound:
270
 
            LOG.info(_("Skipping ensure_export. No iscsi_target " +
 
270
            LOG.info(_("Skipping ensure_export. No iscsi_target "
271
271
                       "provisioned for volume: %d"), volume['id'])
272
272
            return
273
273
 
315
315
            iscsi_target = self.db.volume_get_iscsi_target_num(context,
316
316
                                                           volume['id'])
317
317
        except exception.NotFound:
318
 
            LOG.info(_("Skipping remove_export. No iscsi_target " +
 
318
            LOG.info(_("Skipping remove_export. No iscsi_target "
319
319
                       "provisioned for volume: %d"), volume['id'])
320
320
            return
321
321
 
324
324
            # this export has already been removed
325
325
            self.tgtadm.show_target(iscsi_target)
326
326
        except Exception as e:
327
 
            LOG.info(_("Skipping remove_export. No iscsi_target " +
 
327
            LOG.info(_("Skipping remove_export. No iscsi_target "
328
328
                       "is presently exported for volume: %d"), volume['id'])
329
329
            return
330
330
 
381
381
            location = self._do_iscsi_discovery(volume)
382
382
 
383
383
            if not location:
384
 
                raise exception.Error(_("Could not find iSCSI export "
 
384
                raise exception.NovaException(_("Could not find iSCSI export "
385
385
                                        " for volume %s") %
386
386
                                      (volume['name']))
387
387
 
502
502
        (stdout, stderr) = self._execute('rados', 'lspools')
503
503
        pools = stdout.split("\n")
504
504
        if not FLAGS.rbd_pool in pools:
505
 
            raise exception.Error(_("rbd has no pool %s") %
 
505
            raise exception.NovaException(_("rbd has no pool %s") %
506
506
                                  FLAGS.rbd_pool)
507
507
 
508
508
    def create_volume(self, volume):
576
576
            #  use it and just check if 'running' is in the output.
577
577
            (out, err) = self._execute('collie', 'cluster', 'info')
578
578
            if not 'running' in out.split():
579
 
                raise exception.Error(_("Sheepdog is not working: %s") % out)
 
579
                msg = _("Sheepdog is not working: %s") % out
 
580
                raise exception.NovaException(msg)
580
581
        except exception.ProcessExecutionError:
581
 
            raise exception.Error(_("Sheepdog is not working"))
 
582
            raise exception.NovaException(_("Sheepdog is not working"))
582
583
 
583
584
    def create_volume(self, volume):
584
585
        """Creates a sheepdog volume"""