Browse Source

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>
changes/07/640907/3
Mohamed El Gindi 2 years ago
committed by jiaopengju
parent
commit
71a7695175
2 changed files with 11 additions and 1 deletions
  1. +1
    -1
      karbor/api/schemas/scheduled_operations.py
  2. +10
    -0
      karbor/tests/unit/api/v1/test_scheduled_operation.py

+ 1
- 1
karbor/api/schemas/scheduled_operations.py View File

@ -36,7 +36,7 @@ create = {
'plan_id': parameter_types.uuid,
},
'required': ['provider_id', 'plan_id'],
'additionalProperties': False,
'additionalProperties': True,
},
},


+ 10
- 0
karbor/tests/unit/api/v1/test_scheduled_operation.py View File

@ -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…
Cancel
Save