]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Fix the metadata rpc functions
authorAngus Salkeld <asalkeld@redhat.com>
Tue, 19 Jun 2012 06:04:52 +0000 (16:04 +1000)
committerAngus Salkeld <asalkeld@redhat.com>
Tue, 19 Jun 2012 06:04:52 +0000 (16:04 +1000)
Change-Id: Id3a071a45037d85920d273fa198d59602443026d
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
heat/engine/manager.py

index f5ea1bb7276764a68fa4739ceaf63e3ea1d4ba5b..e8e7a1f10c1f6316f8985df098cdb190fb55f8fa 100644 (file)
@@ -28,6 +28,7 @@ from heat import manager
 from heat.db import api as db_api
 from heat.common import config
 from heat.common import utils as heat_utils
+from heat.common import context as ctxtlib
 from heat.engine import parser
 from heat.engine import resources
 from heat.engine import watchrule
@@ -465,9 +466,9 @@ class EngineManager(manager.Manager):
         """
         Return the resource IDs of the given stack.
         """
-        stack = db_api.stack_get_by_name(context, stack_name)
+        stack = db_api.stack_get_by_name(None, stack_name)
         if stack:
-            return [res.name for res in stack]
+            return [res.name for res in stack.resources]
         else:
             return None
 
@@ -546,7 +547,8 @@ class EngineManager(manager.Manager):
             else:
                 s = db_api.stack_get_by_name(None, wr.stack_name)
                 if s:
-                    ctxt = context.RequestContext.from_dict(dict(s.user_creds))
+                    user_creds = db_api.user_creds_get(s.user_creds_id)
+                    ctxt = ctxtlib.RequestContext.from_dict(dict(user_creds))
                     ps = parser.Stack(ctxt, s.name,
                                       s.raw_template.parsed_template.template,
                                       s.id)