~ubuntu-branches/ubuntu/saucy/heat/saucy-updates

« back to all changes in this revision

Viewing changes to heat/api/openstack/v1/resources.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-08 15:23:59 UTC
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20130808152359-187gmaw0nx1oduxy
Tags: upstream-2013.2~b2.a186.g2b4b248
ImportĀ upstreamĀ versionĀ 2013.2~b2.a186.g2b4b248

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from heat.rpc import api as engine_api
21
21
from heat.common import identifier
22
22
from heat.rpc import client as rpc_client
23
 
import heat.openstack.common.rpc.common as rpc_common
24
23
 
25
24
 
26
25
def format_resource(req, res, keys=[]):
68
67
        Lists summary information for all resources
69
68
        """
70
69
 
71
 
        try:
72
 
            res_list = self.engine.list_stack_resources(req.context,
73
 
                                                        identity)
74
 
        except rpc_common.RemoteError as ex:
75
 
            return util.remote_error(ex)
 
70
        res_list = self.engine.list_stack_resources(req.context,
 
71
                                                    identity)
76
72
 
77
73
        return {'resources': [format_resource(req, res) for res in res_list]}
78
74
 
82
78
        Gets detailed information for a stack
83
79
        """
84
80
 
85
 
        try:
86
 
            res = self.engine.describe_stack_resource(req.context,
87
 
                                                      identity,
88
 
                                                      resource_name)
89
 
        except rpc_common.RemoteError as ex:
90
 
            return util.remote_error(ex)
 
81
        res = self.engine.describe_stack_resource(req.context,
 
82
                                                  identity,
 
83
                                                  resource_name)
91
84
 
92
85
        return {'resource': format_resource(req, res)}
93
86
 
97
90
        Gets detailed information for a stack
98
91
        """
99
92
 
100
 
        try:
101
 
            res = self.engine.describe_stack_resource(req.context,
102
 
                                                      identity,
103
 
                                                      resource_name)
104
 
        except rpc_common.RemoteError as ex:
105
 
            return util.remote_error(ex)
 
93
        res = self.engine.describe_stack_resource(req.context,
 
94
                                                  identity,
 
95
                                                  resource_name)
106
96
 
107
97
        return {engine_api.RES_METADATA: res[engine_api.RES_METADATA]}
108
98