Browse Source

Remove CellMappingPayload database_connection and transport_url fields

Change I019e88fabd1d386c0d6395a7b1969315873485fd in Stein, which
is not yet officially released, exposes the unencrypted
database_connection URL and MQ transport_url to a CellMapping in
the select_destinations versioned notification CellMappingPayload.

While notifications are not meant to be consumed by end users of
the cloud but only internal services of the deployment, it still
seems like a bad idea to give the keys to the nova cell DB and MQ
to an external-to-nova service like ceilometer.

This change removes the fields from the CellMappingPayload and
bumps the major version to 2.0 to signal the change to consumers,
although I don't expect anything is consuming this yet but we should
follow standard versioning procedure anyway.

Note that notification consumers do not request a specific payload
version nor do they get a schema to perform their own backporting,
they just get what they get, so after this there should be no worry
about needing to support the 1.0 format for this payload.

Change-Id: Ib5edea32d15db01000e6730aebceaf119daf8c5c
Closes-Bug: #1823104
(cherry picked from commit  3301449e73)
tags/19.0.0.0rc2
Matt Riedemann 6 months ago
parent
commit
afe5f0d4de

+ 2
- 5
nova/notifications/objects/request_spec.py View File

@@ -325,21 +325,18 @@ class SchedulerRetriesPayload(base.NotificationPayloadBase):
325 325
 @nova_base.NovaObjectRegistry.register_notification
326 326
 class CellMappingPayload(base.NotificationPayloadBase):
327 327
     # Version 1.0: Initial version
328
-    VERSION = '1.0'
328
+    # Version 2.0: Remove transport_url and database_connection fields.
329
+    VERSION = '2.0'
329 330
 
330 331
     SCHEMA = {
331 332
         'uuid': ('cell', 'uuid'),
332 333
         'name': ('cell', 'name'),
333
-        'transport_url': ('cell', 'transport_url'),
334
-        'database_connection': ('cell', 'database_connection'),
335 334
         'disabled': ('cell', 'disabled'),
336 335
     }
337 336
 
338 337
     fields = {
339 338
         'uuid': fields.UUIDField(),
340 339
         'name': fields.StringField(nullable=True),
341
-        'transport_url': fields.StringField(),
342
-        'database_connection': fields.StringField(),
343 340
         'disabled': fields.BooleanField(default=False),
344 341
     }
345 342
 

+ 1
- 3
nova/tests/functional/notification_sample_tests/test_instance.py View File

@@ -957,14 +957,12 @@ class TestInstanceNotificationSample(
957 957
             'nova_object.data': {
958 958
                 'aggregates': None,
959 959
                 'cell': {
960
-                    'nova_object.version': '1.0',
960
+                    'nova_object.version': '2.0',
961 961
                     'nova_object.namespace': 'nova',
962 962
                     'nova_object.name': 'CellMappingPayload',
963 963
                     'nova_object.data': {
964
-                        'database_connection': cell1.database_connection,
965 964
                         'disabled': False,
966 965
                         'name': u'cell1',
967
-                        'transport_url': u'fake://nowhere/',
968 966
                         'uuid': cell1.uuid
969 967
                     }
970 968
                 }

+ 1
- 1
nova/tests/unit/notifications/objects/test_notification.py View File

@@ -370,7 +370,7 @@ notification_object_data = {
370 370
     'AuditPeriodPayload': '1.0-2b429dd307b8374636703b843fa3f9cb',
371 371
     'BandwidthPayload': '1.0-ee2616a7690ab78406842a2b68e34130',
372 372
     'BlockDevicePayload': '1.0-29751e1b6d41b1454e36768a1e764df8',
373
-    'CellMappingPayload': '1.0-cf7faeb3cdd6b0c742ff74c80b88fb11',
373
+    'CellMappingPayload': '2.0-8acd412eb4edff1cd2ecb9867feeb243',
374 374
     'ComputeTaskNotification': '1.0-a73147b93b520ff0061865849d3dfa56',
375 375
     'ComputeTaskPayload': '1.0-e3d34762c14d131c98337b72e8c600e1',
376 376
     'DestinationPayload': '1.0-4ccf26318dd18c4377dada2b1e74ec2e',

Loading…
Cancel
Save