~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to nova/api/openstack/compute/contrib/disk_config.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-08-16 14:04:11 UTC
  • mto: This revision was merged to the branch mainline in revision 84.
  • Revision ID: package-import@ubuntu.com-20120816140411-0mr4n241wmk30t9l
Tags: upstream-2012.2~f3
ImportĀ upstreamĀ versionĀ 2012.2~f3

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
            db_server = req.get_db_instance(server['id'])
107
107
            # server['id'] is guaranteed to be in the cache due to
108
108
            # the core API adding it in its 'show'/'detail' methods.
109
 
            value = db_server[INTERNAL_DISK_CONFIG]
 
109
            value = db_server.get(INTERNAL_DISK_CONFIG)
110
110
            server[API_DISK_CONFIG] = disk_config_to_api(value)
111
111
 
112
112
    def _show(self, req, resp_obj):
139
139
    def create(self, req, body):
140
140
        context = req.environ['nova.context']
141
141
        if authorize(context):
142
 
            self._set_disk_config(body['server'])
 
142
            if 'server' in body:
 
143
                self._set_disk_config(body['server'])
143
144
            resp_obj = (yield)
144
145
            self._show(req, resp_obj)
145
146