Fix to allow more parameters for retention_protect
Scheduled operations might take additional parameters/properties due to addition of new feature 'retention_protect' This is to allow more parameters like max_backups and retention_duration in scheduledoperation command without api validation giving an error Closes-Bug #1818582 Change-Id: Idf520ed0e5b1625448910278da9dbbf711e5f381 Co-Authored-By: Jiao Pengju <jiaopengju@cmss.chinamobile.com>
This commit is contained in:
parent
b9420dbdf5
commit
71a7695175
|
@ -36,7 +36,7 @@ create = {
|
|||
'plan_id': parameter_types.uuid,
|
||||
},
|
||||
'required': ['provider_id', 'plan_id'],
|
||||
'additionalProperties': False,
|
||||
'additionalProperties': True,
|
||||
},
|
||||
|
||||
},
|
||||
|
|
|
@ -115,6 +115,16 @@ class ScheduledOperationApiTest(base.TestCase):
|
|||
operation = self.controller.create(self.req, body=body)
|
||||
self.assertEqual(name, operation['scheduled_operation']['name'])
|
||||
|
||||
def test_create_retention_scheduled_operation(self):
|
||||
name = 'my retention protect'
|
||||
param = self.default_create_operation_param.copy()
|
||||
param['name'] = name
|
||||
param['operation_definition']['retention_duration'] = 100
|
||||
param['operation_definition']['max_backups'] = 3
|
||||
body = self._get_create_operation_request_body(param)
|
||||
operation = self.controller.create(self.req, body=body)
|
||||
self.assertEqual(name, operation['scheduled_operation']['name'])
|
||||
|
||||
def test_delete_operation_receive_NotFound_except(self):
|
||||
self.remote_operation_api._delete_operation_exception =\
|
||||
exception.ScheduledOperationStateNotFound(op_id=None)
|
||||
|
|
Loading…
Reference in New Issue