Add 'driver' to podmanager DB

With multi-podmanager support, new attribute 'driver' is added to specify
driver while creating pod manager. It is not a required attribute,
if not specified default podmanager driver redfishv1 will be used. Currently,
it loads PodManagerBase using redfish v1.

Partially-Implements blueprint add-vendor-extensible-framework

Change-Id: I26d60562efa776ef96597b095d45b1506714e96e
This commit is contained in:
Anusha Ramineni 2017-07-25 15:16:00 +05:30
parent a31acd11b0
commit 08ae9742d3
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,