Exemple #1
0
def purge(name):
    """Removes instance types from database."""
    try:
        assert name is not None
        db.instance_type_purge(context.get_admin_context(), name)
    except (AssertionError, exception.NotFound):
        LOG.exception(_('Instance type %s not found for purge') % name)
        raise exception.InstanceTypeNotFoundByName(instance_type_name=name)
Exemple #2
0
def purge(name):
    """Removes instance types from database."""
    try:
        assert name is not None
        db.instance_type_purge(context.get_admin_context(), name)
    except (AssertionError, exception.NotFound):
        LOG.exception(_('Instance type %s not found for purge') % name)
        raise exception.InstanceTypeNotFoundByName(instance_type_name=name)
Exemple #3
0
def purge(name):
    """Removes instance types from database."""
    if name is None:
        raise exception.InvalidInstanceType(instance_type=name)
    else:
        try:
            db.instance_type_purge(context.get_admin_context(), name)
        except exception.NotFound:
            LOG.exception(_('Instance type %s not found for purge') % name)
            raise exception.ApiError(_("Unknown instance type: %s") % name)
Exemple #4
0
def purge(name):
    """Removes instance types from database."""
    if name is None:
        raise exception.InvalidInstanceType(instance_type=name)
    else:
        try:
            db.instance_type_purge(context.get_admin_context(), name)
        except exception.NotFound:
            LOG.exception(_("Instance type %s not found for purge") % name)
            raise exception.ApiError(_("Unknown instance type: %s") % name)
Exemple #5
0
def purge(name):
    """Removes instance types / flavors from database
    arguments: name"""
    if name == None:
        raise exception.InvalidInputException(_("No instance type specified"))
    else:
        try:
            db.instance_type_purge(context.get_admin_context(), name)
        except exception.NotFound:
            LOG.exception(_('Instance type %s not found for purge' % name))
            raise exception.ApiError(_("Unknown instance type: %s" % name))
Exemple #6
0
def purge(name):
    """Removes instance types / flavors from database
    arguments: name"""
    if name == None:
        raise exception.InvalidInputException(_("No instance type specified"))
    else:
        try:
            db.instance_type_purge(context.get_admin_context(), name)
        except exception.NotFound:
            LOG.exception(_('Instance type %s not found for purge' % name))
            raise exception.ApiError(_("Unknown instance type: %s" % name))
 def tearDown(self):
     # Remove the instance type from the database
     db.instance_type_purge(self.context, "cg1.4xlarge")
     super(InstanceTypeExtraSpecsTestCase, self).tearDown()
 def tearDown(self):
     # Remove the instance type from the database
     db.instance_type_purge(self.context, "cg1.4xlarge")
     super(InstanceTypeExtraSpecsTestCase, self).tearDown()