summaryrefslogtreecommitdiffstats
path: root/nova/volume
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-08-31 16:20:33 +0000
committerGerrit Code Review <review@openstack.org>2012-08-31 16:20:33 +0000
commit0ea7a446fa861e22799f6a42d9ed6b89c8be2543 (patch)
tree6e6360a8e9c20e4c52f9b25d2a8786bb13ead463 /nova/volume
parent479a77ce56c935d10ae38dc30748ca9a546266ad (diff)
parent8cf635b08a57a9e3be2bef980ef38cf857b6525a (diff)
Merge "Stop using scheduler RPC API magic"
Diffstat (limited to 'nova/volume')
-rw-r--r--nova/volume/api.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/nova/volume/api.py b/nova/volume/api.py
index bbb3149b0..3b8c62e11 100644
--- a/nova/volume/api.py
+++ b/nova/volume/api.py
@@ -31,6 +31,7 @@ from nova.openstack.common import rpc
from nova.openstack.common import timeutils
import nova.policy
from nova import quota
+from nova.scheduler import rpcapi as scheduler_rpcapi
volume_host_opt = cfg.BoolOpt('snapshot_same_host',
default=True,
@@ -72,6 +73,10 @@ def check_policy(context, action, target_obj=None):
class API(base.Base):
"""API for interacting with the volume manager."""
+ def __init__(self, **kwargs):
+ self.scheduler_rpcapi = scheduler_rpcapi.SchedulerAPI()
+ super(API, self).__init__(**kwargs)
+
def create(self, context, size, name, description, snapshot=None,
volume_type=None, metadata=None, availability_zone=None):
check_policy(context, 'create')
@@ -172,13 +177,8 @@ class API(base.Base):
"args": {"volume_id": volume_id,
"snapshot_id": snapshot_id}})
else:
- rpc.cast(context,
- FLAGS.scheduler_topic,
- {"method": "create_volume",
- "args": {"topic": FLAGS.volume_topic,
- "volume_id": volume_id,
- "snapshot_id": snapshot_id,
- "reservations": reservations}})
+ self.scheduler_rpcapi.create_volume(
+ context, volume_id, snapshot_id, reservations)
@wrap_check_policy
def delete(self, context, volume):