~ubuntu-cloud-archive/ubuntu/precise/nova/trunk

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-05-24 13:12:53 UTC
  • mfrom: (1.1.55)
  • Revision ID: package-import@ubuntu.com-20120524131253-ommql08fg1en06ut
Tags: 2012.2~f1-0ubuntu1
* New upstream release.
* Prepare for quantal:
  - Dropped debian/patches/upstream/0006-Use-project_id-in-ec2.cloud._format_image.patch
  - Dropped debian/patches/upstream/0005-Populate-image-properties-with-project_id-again.patch
  - Dropped debian/patches/upstream/0004-Fixed-bug-962840-added-a-test-case.patch
  - Dropped debian/patches/upstream/0003-Allow-unprivileged-RADOS-users-to-access-rbd-volumes.patch
  - Dropped debian/patches/upstream/0002-Stop-libvirt-test-from-deleting-instances-dir.patch
  - Dropped debian/patches/upstream/0001-fix-bug-where-nova-ignores-glance-host-in-imageref.patch 
  - Dropped debian/patches/0001-fix-useexisting-deprecation-warnings.patch
* debian/control: Add python-keystone as a dependency. (LP: #907197)
* debian/patches/kombu_tests_timeout.patch: Refreshed.
* debian/nova.conf, debian/nova-common.postinst: Convert to new ini
  file configuration
* debian/patches/nova-manage_flagfile_location.patch: Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from xml.dom import minidom
20
20
from xml.parsers import expat
21
21
 
 
22
from nova.api.openstack import extensions
22
23
from nova.api.openstack import wsgi
23
24
from nova.api.openstack import xmlutil
24
 
from nova.api.openstack import extensions
25
25
from nova.compute import api as compute_api
26
26
from nova import db
27
27
from nova import exception
28
28
from nova import flags
29
29
from nova import log as logging
30
 
from nova.scheduler import api as scheduler_api
 
30
from nova.scheduler import rpcapi as scheduler_rpcapi
31
31
 
32
32
 
33
33
LOG = logging.getLogger(__name__)
98
98
    by service type.
99
99
    """
100
100
    context = req.environ['nova.context']
101
 
    hosts = scheduler_api.get_host_list(context)
 
101
    rpcapi = scheduler_rpcapi.SchedulerAPI()
 
102
    hosts = rpcapi.get_host_list(context)
102
103
    if service:
103
104
        hosts = [host for host in hosts
104
105
                if host["service"] == service]
224
225
        """
225
226
        host = id
226
227
        context = req.environ['nova.context']
227
 
        # Expected to use AuthMiddleware.
228
 
        # Otherwise, non-admin user can use describe-resource
229
228
        if not context.is_admin:
230
229
            msg = _("Describe-resource is admin only functionality")
231
230
            raise webob.exc.HTTPForbidden(explanation=msg)