No need to check profile existence, due already check in profile_get

This commit is contained in:
huangtianhua
2015-02-02 17:38:55 +08:00
parent 01e11d0448
commit 1399b5ab8b
2 changed files with 1 additions and 7 deletions

View File

@@ -602,12 +602,6 @@ def profile_update(context, profile_id, values):
def profile_delete(context, profile_id, force=False):
profile = profile_get(context, profile_id)
if not profile:
msg = _('Attempt to delete a profile with id "%s" that does not '
'exist failed') % profile_id
raise exception.NotFound(msg)
session = orm_session.Session.object_session(profile)
# TODO(Qiming): Check if a profile is still in use, raise an exception

View File

@@ -106,7 +106,7 @@ class Cluster(periodic_task.PeriodicTasks):
def _load_runtime_data(self, context):
self.rt = {
'profile': profiles.Profile.load(context, self.profile_id),
'profile': profiles_base.Profile.load(context, self.profile_id),
'nodes': nodes.Node.load_all(context, cluster_id=self.id),
'policies': [],
}