~ubuntu-branches/ubuntu/raring/cinder/raring-updates

« back to all changes in this revision

Viewing changes to cinder/scheduler/rpcapi.py

Tags: upstream-2013.1~g2
ImportĀ upstreamĀ versionĀ 2013.1~g2

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
"""
20
20
 
21
21
from cinder import flags
 
22
from cinder.openstack.common import jsonutils
22
23
import cinder.openstack.common.rpc.proxy
23
24
 
24
25
 
39
40
    RPC_API_VERSION = '1.0'
40
41
 
41
42
    def __init__(self):
42
 
        super(SchedulerAPI, self).__init__(topic=FLAGS.scheduler_topic,
43
 
                default_version=self.RPC_API_VERSION)
 
43
        super(SchedulerAPI, self).__init__(
 
44
            topic=FLAGS.scheduler_topic,
 
45
            default_version=self.RPC_API_VERSION)
44
46
 
45
47
    def create_volume(self, ctxt, topic, volume_id, snapshot_id=None,
46
48
                      image_id=None, request_spec=None,
47
49
                      filter_properties=None):
48
 
        return self.cast(ctxt, self.make_msg('create_volume',
49
 
                                         topic=topic,
50
 
                                         volume_id=volume_id,
51
 
                                         snapshot_id=snapshot_id,
52
 
                                         image_id=image_id,
53
 
                                         request_spec=request_spec,
54
 
                                         filter_properties=filter_properties),
55
 
                         version='1.2')
 
50
        request_spec_p = jsonutils.to_primitive(request_spec)
 
51
        return self.cast(ctxt, self.make_msg(
 
52
            'create_volume',
 
53
            topic=topic,
 
54
            volume_id=volume_id,
 
55
            snapshot_id=snapshot_id,
 
56
            image_id=image_id,
 
57
            request_spec=request_spec_p,
 
58
            filter_properties=filter_properties),
 
59
            version='1.2')
56
60
 
57
 
    def update_service_capabilities(self, ctxt, service_name, host,
58
 
            capabilities):
 
61
    def update_service_capabilities(self, ctxt,
 
62
                                    service_name, host,
 
63
                                    capabilities):
59
64
        self.fanout_cast(ctxt, self.make_msg('update_service_capabilities',
60
 
                service_name=service_name, host=host,
61
 
                capabilities=capabilities))
 
65
                         service_name=service_name, host=host,
 
66
                         capabilities=capabilities))