Merge "Add 'driver' to podmanager DB"

This commit is contained in:
Jenkins 2017-08-09 00:37:52 +00:00 committed by Gerrit Code Review
commit dcc06f6cdc
4 changed files with 10 additions and 0 deletions

View File

@ -39,6 +39,11 @@ def _check_creation(values):
if values['name'] in names or values['url'] in urls:
raise exception.BadRequest('duplicated name or url !')
# If podmanager 'driver' is None, update as "redfishv1" which is default
# driver used to manage resources.
# 'driver' can take values like "redfishv1", "redfishv2" etc.
values['driver'] = values.get('driver', 'redfishv1')
# input status
values['status'] = get_podm_status(values['url'], values['authentication'])

View File

@ -135,6 +135,9 @@ class PodManager(ModelBaseWithTimeStamp):
'url': {
'validate': types.Text.validate
},
'driver': {
'validate': types.Text.validate
},
'authentication': {
'validate': types.List(types.Dict).validate
},

View File

@ -47,6 +47,7 @@ class TestPodManagers(unittest.TestCase):
result_values = copy.deepcopy(values)
result_values['status'] = constants.PODM_STATUS_ONLINE
result_values['driver'] = 'redfishv1'
self.assertEqual(podmanagers._check_creation(values), result_values)
mock_get_podm_status.assert_called_once_with(values['url'],

View File

@ -56,6 +56,7 @@ podmanager_schema = {
'type': 'string',
'format': 'uri',
},
'driver': {'type': 'string'},
'authentication': {
'type': 'array',
'minItems': 1,