summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2010-07-26 17:14:28 -0700
committerVishvananda Ishaya <vishvananda@gmail.com>2010-07-26 17:14:28 -0700
commit754db8ef1ceb84fa9a1f44bfc6c5c6bbd99cd7e1 (patch)
tree160984a03f0d27a8ff4dff9b5e12a8243fd9fe91
parentcacca7df569e396d76112693aab62c95d51ff035 (diff)
downloadnova-754db8ef1ceb84fa9a1f44bfc6c5c6bbd99cd7e1.tar.gz
nova-754db8ef1ceb84fa9a1f44bfc6c5c6bbd99cd7e1.tar.xz
nova-754db8ef1ceb84fa9a1f44bfc6c5c6bbd99cd7e1.zip
renamed xxxservice to service
-rwxr-xr-xbin/nova-compute4
-rwxr-xr-xbin/nova-network4
-rwxr-xr-xbin/nova-volume4
-rw-r--r--nova/compute/service.py (renamed from nova/compute/computeservice.py)6
-rw-r--r--nova/endpoint/cloud.py12
-rw-r--r--nova/network/service.py (renamed from nova/network/networkservice.py)0
-rw-r--r--nova/tests/cloud_unittest.py4
-rw-r--r--nova/tests/compute_unittest.py4
-rw-r--r--nova/tests/volume_unittest.py20
-rw-r--r--nova/volume/service.py (renamed from nova/volume/volumeservice.py)0
10 files changed, 29 insertions, 29 deletions
diff --git a/bin/nova-compute b/bin/nova-compute
index 7ef5d074a..e0c12354f 100755
--- a/bin/nova-compute
+++ b/bin/nova-compute
@@ -22,11 +22,11 @@
"""
from nova import twistd
-from nova.compute import computeservice
+from nova.compute import service
if __name__ == '__main__':
twistd.serve(__file__)
if __name__ == '__builtin__':
- application = computeservice.ComputeService.create()
+ application = service.ComputeService.create()
diff --git a/bin/nova-network b/bin/nova-network
index 0d3aa0002..52d6cb70a 100755
--- a/bin/nova-network
+++ b/bin/nova-network
@@ -22,11 +22,11 @@
"""
from nova import twistd
-from nova.network import networkservice
+from nova.network import service
if __name__ == '__main__':
twistd.serve(__file__)
if __name__ == '__builtin__':
- application = networkservice.NetworkService.create()
+ application = service.NetworkService.create()
diff --git a/bin/nova-volume b/bin/nova-volume
index c1c0163cf..f7a8fad37 100755
--- a/bin/nova-volume
+++ b/bin/nova-volume
@@ -22,11 +22,11 @@
"""
from nova import twistd
-from nova.volume import volumeservice
+from nova.volume import service
if __name__ == '__main__':
twistd.serve(__file__)
if __name__ == '__builtin__':
- application = volumeservice.VolumeService.create()
+ application = service.VolumeService.create()
diff --git a/nova/compute/computeservice.py b/nova/compute/service.py
index 5568e3888..02e35baa2 100644
--- a/nova/compute/computeservice.py
+++ b/nova/compute/service.py
@@ -49,7 +49,7 @@ from nova.compute import disk
from nova.compute import model
from nova.compute import network
from nova.objectstore import image # for image_path flag
-from nova.volume import volumeservice
+from nova.volume import service as volume_service
FLAGS = flags.FLAGS
@@ -221,7 +221,7 @@ class ComputeService(service.Service):
@exception.wrap_exception
def attach_volume(self, instance_id = None,
volume_id = None, mountpoint = None):
- volume = volumeservice.get_volume(volume_id)
+ volume = volume_service.get_volume(volume_id)
yield self._init_aoe()
yield process.simple_execute(
"sudo virsh attach-disk %s /dev/etherd/%s %s" %
@@ -242,7 +242,7 @@ class ComputeService(service.Service):
""" detach a volume from an instance """
# despite the documentation, virsh detach-disk just wants the device
# name without the leading /dev/
- volume = volumeservice.get_volume(volume_id)
+ volume = volume_service.get_volume(volume_id)
target = volume['mountpoint'].rpartition('/dev/')[2]
yield process.simple_execute(
"sudo virsh detach-disk %s %s " % (instance_id, target))
diff --git a/nova/endpoint/cloud.py b/nova/endpoint/cloud.py
index 56d474fd9..97a7b5a38 100644
--- a/nova/endpoint/cloud.py
+++ b/nova/endpoint/cloud.py
@@ -37,9 +37,9 @@ from nova.auth import rbac
from nova.auth import users
from nova.compute import model
from nova.compute import network
-from nova.compute import computeservice
+from nova.compute import service as compute_service
from nova.endpoint import images
-from nova.volume import volumeservice
+from nova.volume import service as volume_service
FLAGS = flags.FLAGS
@@ -75,7 +75,7 @@ class CloudController(object):
def volumes(self):
""" returns a list of all volumes """
for volume_id in datastore.Redis.instance().smembers("volumes"):
- volume = volumeservice.get_volume(volume_id)
+ volume = volume_service.get_volume(volume_id)
yield volume
def __str__(self):
@@ -102,7 +102,7 @@ class CloudController(object):
result = {}
for instance in self.instdir.all:
if instance['project_id'] == project_id:
- line = '%s slots=%d' % (instance['private_dns_name'], computeservice.INSTANCE_TYPES[instance['instance_type']]['vcpus'])
+ line = '%s slots=%d' % (instance['private_dns_name'], compute_service.INSTANCE_TYPES[instance['instance_type']]['vcpus'])
if instance['key_name'] in result:
result[instance['key_name']].append(line)
else:
@@ -295,7 +295,7 @@ class CloudController(object):
@rbac.allow('projectmanager', 'sysadmin')
def create_volume(self, context, size, **kwargs):
- # TODO(vish): refactor this to create the volume object here and tell volumeservice to create it
+ # TODO(vish): refactor this to create the volume object here and tell service to create it
res = rpc.call(FLAGS.volume_topic, {"method": "create_volume",
"args" : {"size": size,
"user_id": context.user.id,
@@ -330,7 +330,7 @@ class CloudController(object):
raise exception.NotFound('Instance %s could not be found' % instance_id)
def _get_volume(self, context, volume_id):
- volume = volumeservice.get_volume(volume_id)
+ volume = volume_service.get_volume(volume_id)
if context.user.is_admin() or volume['project_id'] == context.project.id:
return volume
raise exception.NotFound('Volume %s could not be found' % volume_id)
diff --git a/nova/network/networkservice.py b/nova/network/service.py
index 9d87e05e6..9d87e05e6 100644
--- a/nova/network/networkservice.py
+++ b/nova/network/service.py
diff --git a/nova/tests/cloud_unittest.py b/nova/tests/cloud_unittest.py
index 38f4de8d9..128188b0d 100644
--- a/nova/tests/cloud_unittest.py
+++ b/nova/tests/cloud_unittest.py
@@ -28,7 +28,7 @@ from nova import flags
from nova import rpc
from nova import test
from nova.auth import users
-from nova.compute import computeservice
+from nova.compute import service
from nova.endpoint import api
from nova.endpoint import cloud
@@ -54,7 +54,7 @@ class CloudTestCase(test.BaseTestCase):
self.injected.append(self.cloud_consumer.attach_to_tornado(self.ioloop))
# set up a service
- self.compute = computeservice.ComputeService()
+ self.compute = service.ComputeService()
self.compute_consumer = rpc.AdapterConsumer(connection=self.conn,
topic=FLAGS.compute_topic,
proxy=self.compute)
diff --git a/nova/tests/compute_unittest.py b/nova/tests/compute_unittest.py
index db08308bb..b70260c25 100644
--- a/nova/tests/compute_unittest.py
+++ b/nova/tests/compute_unittest.py
@@ -26,7 +26,7 @@ from nova import flags
from nova import test
from nova import utils
from nova.compute import model
-from nova.compute import computeservice
+from nova.compute import service
FLAGS = flags.FLAGS
@@ -60,7 +60,7 @@ class ComputeConnectionTestCase(test.TrialTestCase):
self.flags(fake_libvirt=True,
fake_storage=True,
fake_users=True)
- self.compute = computeservice.ComputeService()
+ self.compute = service.ComputeService()
def create_instance(self):
instdir = model.InstanceDirectory()
diff --git a/nova/tests/volume_unittest.py b/nova/tests/volume_unittest.py
index 568b199a0..62144269c 100644
--- a/nova/tests/volume_unittest.py
+++ b/nova/tests/volume_unittest.py
@@ -18,11 +18,11 @@
import logging
+from nova import compute
from nova import exception
from nova import flags
from nova import test
-from nova.compute import computeservice
-from nova.volume import volumeservice
+from nova.volume import service as volume_service
FLAGS = flags.FLAGS
@@ -32,11 +32,11 @@ class VolumeTestCase(test.TrialTestCase):
def setUp(self):
logging.getLogger().setLevel(logging.DEBUG)
super(VolumeTestCase, self).setUp()
- self.compute = computeservice.ComputeService()
+ self.compute = compute.service.ComputeService()
self.volume = None
self.flags(fake_libvirt=True,
fake_storage=True)
- self.volume = volumeservice.VolumeService()
+ self.volume = volume_service.VolumeService()
def test_run_create_volume(self):
vol_size = '0'
@@ -45,11 +45,11 @@ class VolumeTestCase(test.TrialTestCase):
volume_id = self.volume.create_volume(vol_size, user_id, project_id)
# TODO(termie): get_volume returns differently than create_volume
self.assertEqual(volume_id,
- volumeservice.get_volume(volume_id)['volume_id'])
+ volume_service.get_volume(volume_id)['volume_id'])
rv = self.volume.delete_volume(volume_id)
self.assertRaises(exception.Error,
- volumeservice.get_volume,
+ volume_service.get_volume,
volume_id)
def test_too_big_volume(self):
@@ -70,7 +70,7 @@ class VolumeTestCase(test.TrialTestCase):
for i in xrange(total_slots):
vid = self.volume.create_volume(vol_size, user_id, project_id)
vols.append(vid)
- self.assertRaises(volumeservice.NoMoreVolumes,
+ self.assertRaises(volume_service.NoMoreVolumes,
self.volume.create_volume,
vol_size, user_id, project_id)
for id in vols:
@@ -85,7 +85,7 @@ class VolumeTestCase(test.TrialTestCase):
mountpoint = "/dev/sdf"
volume_id = self.volume.create_volume(vol_size, user_id, project_id)
- volume_obj = volumeservice.get_volume(volume_id)
+ volume_obj = volume_service.get_volume(volume_id)
volume_obj.start_attach(instance_id, mountpoint)
rv = yield self.compute.attach_volume(volume_id,
instance_id,
@@ -100,12 +100,12 @@ class VolumeTestCase(test.TrialTestCase):
volume_id)
rv = yield self.volume.detach_volume(volume_id)
- volume_obj = volumeservice.get_volume(volume_id)
+ volume_obj = volume_service.get_volume(volume_id)
self.assertEqual(volume_obj['status'], "available")
rv = self.volume.delete_volume(volume_id)
self.assertRaises(exception.Error,
- volumeservice.get_volume,
+ volume_service.get_volume,
volume_id)
def test_multi_node(self):
diff --git a/nova/volume/volumeservice.py b/nova/volume/service.py
index 87a47f40a..87a47f40a 100644
--- a/nova/volume/volumeservice.py
+++ b/nova/volume/service.py