~markmc/nova/flat-dhcp-without-bridge-iface

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Alex Meade
  • Date: 2011-08-22 03:17:04 UTC
  • mfrom: (1450.6.17 servers-accessip)
  • Revision ID: tarmac-20110822031704-3m2u6o62ut0gqyzo
Adds accessIPv4 and accessIPv6 to servers requests and responses as per the current spec.

Show diffs side-by-side

added added

removed removed

Lines of Context:
163
163
 
164
164
    @scheduler_api.redirect_handler
165
165
    def update(self, req, id, body):
166
 
        """Update server name then pass on to version-specific controller"""
 
166
        """Update server then pass on to version-specific controller"""
167
167
        if len(req.body) == 0:
168
168
            raise exc.HTTPUnprocessableEntity()
169
169
 
178
178
            self.helper._validate_server_name(name)
179
179
            update_dict['display_name'] = name.strip()
180
180
 
 
181
        if 'accessIPv4' in body['server']:
 
182
            access_ipv4 = body['server']['accessIPv4']
 
183
            update_dict['access_ip_v4'] = access_ipv4.strip()
 
184
 
 
185
        if 'accessIPv6' in body['server']:
 
186
            access_ipv6 = body['server']['accessIPv6']
 
187
            update_dict['access_ip_v6'] = access_ipv6.strip()
 
188
 
181
189
        try:
182
190
            self.compute_api.update(ctxt, id, **update_dict)
183
191
        except exception.NotFound:
837
845
        node.setAttribute('created', str(server['created']))
838
846
        node.setAttribute('updated', str(server['updated']))
839
847
        node.setAttribute('status', server['status'])
 
848
        if 'accessIPv4' in server:
 
849
            node.setAttribute('accessIPv4', str(server['accessIPv4']))
 
850
        if 'accessIPv6' in server:
 
851
            node.setAttribute('accessIPv6', str(server['accessIPv6']))
840
852
        if 'progress' in server:
841
853
            node.setAttribute('progress', str(server['progress']))
842
854