]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Set the default availability zone back to nova
authorVishvananda Ishaya <vishvananda@gmail.com>
Thu, 20 Sep 2012 16:34:59 +0000 (16:34 +0000)
committerVishvananda Ishaya <vishvananda@gmail.com>
Fri, 21 Sep 2012 03:03:04 +0000 (03:03 +0000)
Currently nova and cinder have to have the same set of az's for
the ec2 api to work properly. Therefore, set the default az for
cinder to nova so they will match.

Includes a hack to az to set cinder to nova to work around gate
issues. The hack can be removed once the gate sets the zone to
nova properly.

Fixes bug 1053508

Change-Id: I9c30ccc5c79b9c4e6c1ebeb3e80d0098e1ffbb11

cinder/api/openstack/volume/volumes.py
cinder/flags.py
cinder/tests/api/openstack/volume/test_volumes.py
cinder/tests/integrated/test_volumes.py
cinder/tests/test_service.py

index 69d55c6bd8e3f0cab1a25c54e91b6c3872196155..b697a6256dec49a1c368c8677832000bd2c9102d 100644 (file)
@@ -319,6 +319,9 @@ class VolumeController(wsgi.Controller):
                 kwargs['image_id'] = image_uuid
 
         kwargs['availability_zone'] = volume.get('availability_zone', None)
+        # NOTE(vish): Temporary hack to work around gating issues
+        if kwargs['availability_zone'] == 'cinder':
+            kwargs['availability_zone'] = 'nova'
 
         new_volume = self.volume_api.create(context,
                                             size,
index 86ce6492c25a687748368f99d2ddb53e174756cc..87103c83a3dbee65b07eda06b442014b5fef8a47 100644 (file)
@@ -177,8 +177,9 @@ global_opts = [
                default=socket.gethostname(),
                help='Name of this node.  This can be an opaque identifier.  '
                     'It is not necessarily a hostname, FQDN, or IP address.'),
+    # NOTE(vish): default to nova for compatibility with nova installs
     cfg.StrOpt('storage_availability_zone',
-               default='cinder',
+               default='nova',
                help='availability zone of this node'),
     cfg.ListOpt('memcached_servers',
                 default=None,
index a146b1f8abd58f42098404d36adc4d0089533b62..f5141f631f7d0d0fba1664910a420fc3b6089535 100644 (file)
@@ -109,11 +109,11 @@ class VolumeApiTest(test.TestCase):
         vol = {"size": '1',
                "display_name": "Volume Test Name",
                "display_description": "Volume Test Desc",
-               "availability_zone": "cinder",
+               "availability_zone": "nova",
                "imageRef": 'c905cedb-7281-47e4-8a62-f26bc5fc4c77'}
         expected = {'volume': {'status': 'fakestatus',
                            'display_description': 'Volume Test Desc',
-                           'availability_zone': 'cinder',
+                           'availability_zone': 'nova',
                            'display_name': 'Volume Test Name',
                            'attachments': [{'device': '/',
                                             'server_id': 'fakeuuid',
index 6c4476114b1cc124dd5891b45486caa7626c75a7..0ec851113d15b555d1a9e13b95fbf0ec2994a1dd 100644 (file)
@@ -124,7 +124,7 @@ class VolumesTest(integrated_helpers._IntegratedTestBase):
         self.assertEquals(1, len(create_actions))
         create_action = create_actions[0]
         self.assertEquals(create_action['id'], created_volume_id)
-        self.assertEquals(create_action['availability_zone'], 'cinder')
+        self.assertEquals(create_action['availability_zone'], 'nova')
         self.assertEquals(create_action['size'], 1)
 
         export_actions = driver.LoggingVolumeDriver.logs_like(
@@ -133,7 +133,7 @@ class VolumesTest(integrated_helpers._IntegratedTestBase):
         self.assertEquals(1, len(export_actions))
         export_action = export_actions[0]
         self.assertEquals(export_action['id'], created_volume_id)
-        self.assertEquals(export_action['availability_zone'], 'cinder')
+        self.assertEquals(export_action['availability_zone'], 'nova')
 
         delete_actions = driver.LoggingVolumeDriver.logs_like(
                             'delete_volume',
index c0c2561e43a7f793c02ce7c38454e35d1b5e4224..38b0c3922bd24038ff95f6b240fcfa87472f037a 100644 (file)
@@ -129,12 +129,12 @@ class ServiceTestCase(test.TestCase):
                           'binary': binary,
                           'topic': topic,
                           'report_count': 0,
-                          'availability_zone': 'cinder'}
+                          'availability_zone': 'nova'}
         service_ref = {'host': host,
                           'binary': binary,
                           'topic': topic,
                           'report_count': 0,
-                          'availability_zone': 'cinder',
+                          'availability_zone': 'nova',
                           'id': 1}
 
         service.db.service_get_by_args(mox.IgnoreArg(),
@@ -162,12 +162,12 @@ class ServiceTestCase(test.TestCase):
                           'binary': binary,
                           'topic': topic,
                           'report_count': 0,
-                          'availability_zone': 'cinder'}
+                          'availability_zone': 'nova'}
         service_ref = {'host': host,
                           'binary': binary,
                           'topic': topic,
                           'report_count': 0,
-                          'availability_zone': 'cinder',
+                          'availability_zone': 'nova',
                           'id': 1}
 
         service.db.service_get_by_args(mox.IgnoreArg(),