~citrix-openstack/nova/d4-addons

« back to all changes in this revision

Viewing changes to nova/api/openstack/views/servers.py

  • Committer: Tarmac
  • Author(s): Christopher MacGown
  • Date: 2011-08-23 06:00:12 UTC
  • mfrom: (1476.1.2 trunk_merge)
  • Revision ID: tarmac-20110823060012-od44a3emqh6he9ud
Implements first-pass of config-drive that adds a vfat format drive to a vm when config_drive is True (or an image id).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
2
 
3
3
# Copyright 2010-2011 OpenStack LLC.
 
4
# Copyright 2011 Piston Cloud Computing, Inc.
4
5
# All Rights Reserved.
5
6
#
6
7
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
187
188
    def _build_extra(self, response, inst):
188
189
        self._build_links(response, inst)
189
190
        response['uuid'] = inst['uuid']
 
191
        self._build_config_drive(response, inst)
190
192
 
191
193
    def _build_links(self, response, inst):
192
194
        href = self.generate_href(inst["id"])
205
207
 
206
208
        response["links"] = links
207
209
 
 
210
    def _build_config_drive(self, response, inst):
 
211
        response['config_drive'] = inst.get('config_drive')
 
212
 
208
213
    def generate_href(self, server_id):
209
214
        """Create an url that refers to a specific server id."""
210
215
        return os.path.join(self.base_url, self.project_id,