]> 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)
committerJohn Griffith <john.griffith@solidfire.com>
Fri, 21 Sep 2012 03:35:10 +0000 (21:35 -0600)
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
(cherry picked from commit d051ca9cdf828b1e47ef5158c4b83beb9484109e)

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 2c6852b5a177dba7a5c6197caff2a20d707e0c29..f38c669f16ae2bab6082103575620d317a326f9b 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 ade6f8db0f2d30c06414d7b2124e1d46e75304e5..4ed11d2843bb58280c6e31ff9beea7a8a52c3c65 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 0b82bde99306b7b8326956285f829443da8c6d1b..6ec01621c0f384a5544e0203f7a9d2e07a23fc0d 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(),