From 84304a81aea600d35fb64520234f395db42a549d Mon Sep 17 00:00:00 2001 From: tengqm Date: Tue, 20 Jan 2015 23:37:00 +0800 Subject: [PATCH] Added support to profile-show --- etc/policy.json | 3 ++- senlin/engine/service.py | 5 +++++ senlin/rpc/client.py | 3 +-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/etc/policy.json b/etc/policy.json index dde8f9deb..061013e74 100644 --- a/etc/policy.json +++ b/etc/policy.json @@ -13,5 +13,6 @@ "policy_types:index": "", "profiles:index": "rule:admin_or_owner", "profiles:create": "", - "profiles:delete": "rule:admin_or_owner" + "profiles:delete": "rule:admin_or_owner", + "profiles:get": "rule:admin_or_owner" } diff --git a/senlin/engine/service.py b/senlin/engine/service.py index 0d32b7bf8..7d9cb98ba 100644 --- a/senlin/engine/service.py +++ b/senlin/engine/service.py @@ -150,6 +150,11 @@ class EngineService(service.Service): profile.store(context) return profile.to_dict() + @request_context + def profile_get(self, context, profile_id): + profile = profile_base.Profile.load(context, profile_id) + return profile + @request_context def profile_update(self, context, profile_id, name, spec, perm, tags): return {} diff --git a/senlin/rpc/client.py b/senlin/rpc/client.py index 1219e0bcd..b81b8e9f0 100644 --- a/senlin/rpc/client.py +++ b/senlin/rpc/client.py @@ -104,8 +104,7 @@ class EngineClient(object): def profile_get(self, ctxt, profile_id): return self.call(ctxt, - self.make_msg('profile_get', - profile_id=profile_id)) + self.make_msg('profile_get', profile_id=profile_id)) def profile_update(self, ctxt, profile_id, name, spec, perm, tags): return self.call(ctxt,