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)
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)
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)
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()