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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman, Adam Gandelman, Chuck Short
  • Date: 2012-08-27 15:37:18 UTC
  • mfrom: (1.1.60)
  • Revision ID: package-import@ubuntu.com-20120827153718-lj8er44eqqz1gsrj
Tags: 2012.2~rc1~20120827.15815-0ubuntu1
[ Adam Gandelman ]
* New upstream release.

[ Chuck Short ]
* debian/patches/0001-Update-tools-hacking-for-pep8-1.2-and-
  beyond.patch: Dropped we dont run pep8 tests anymore.
* debian/control: Drop pep8 build depends
* debian/*.upstart.in: Make sure we transition correctly from runlevel
  1 to 2. (LP: #820694)

Show diffs side-by-side

added added

removed removed

Lines of Context:
158
158
        server_node = self.find_first_child_named(node, 'server')
159
159
 
160
160
        attributes = ["name", "imageRef", "flavorRef", "adminPass",
161
 
                      "accessIPv4", "accessIPv6"]
 
161
                      "accessIPv4", "accessIPv6", "key_name"]
162
162
        for attr in attributes:
163
163
            if server_node.getAttribute(attr):
164
164
                server[attr] = server_node.getAttribute(attr)
428
428
                # No 'changes-since', so we only want non-deleted servers
429
429
                search_opts['deleted'] = False
430
430
 
 
431
        if search_opts.get("vm_state") == "deleted":
 
432
            if context.is_admin:
 
433
                search_opts['deleted'] = True
 
434
            else:
 
435
                msg = _("Only administrators may list deleted instances")
 
436
                raise exc.HTTPBadRequest(explanation=msg)
 
437
 
431
438
        # NOTE(dprince) This prevents computes' get_all() from returning
432
439
        # instances from multiple tenants when an admin accounts is used.
433
440
        # By default non-admin accounts are always limited to project/user
813
820
        if not body:
814
821
            raise exc.HTTPUnprocessableEntity()
815
822
 
 
823
        if not 'server' in body:
 
824
            raise exc.HTTPUnprocessableEntity()
 
825
 
816
826
        ctxt = req.environ['nova.context']
817
827
        update_dict = {}
818
828