Fix podmanager create and update functions

update podmanager functionality is not working, as request value
is not passed properly to the controller, this patch
fixes the same. And also, podmanager DB model , auth property is not
get stored because of incorrect name and validate type , which is also
fixed in this patch.

Change-Id: I0f735b79f444563d522c3443eeeec46152fcc875
Closes-Bug: #1695820
This commit is contained in:
Anusha Ramineni 2017-06-20 11:39:46 +05:30
parent 577474c9c0
commit c407fc64e3
3 changed files with 10 additions and 4 deletions

View File

@ -46,7 +46,7 @@ class PodManager(flask_restful.Resource):
podmanagers.get_podm_by_uuid(podm_uuid)) podmanagers.get_podm_by_uuid(podm_uuid))
def patch(self, podm_uuid): def patch(self, podm_uuid):
values = flask.request.form.to_dict() values = flask.request.get_json()
return utils.make_response(http_client.OK, return utils.make_response(http_client.OK,
podmanagers.update_podm(podm_uuid, values)) podmanagers.update_podm(podm_uuid, values))

View File

@ -135,8 +135,8 @@ class PodManager(ModelBaseWithTimeStamp):
'url': { 'url': {
'validate': types.Text.validate 'validate': types.Text.validate
}, },
'auth': { 'authentication': {
'validate': types.Text.validate 'validate': types.List(types.Dict).validate
}, },
'status': { 'status': {
'validate': types.Text.validate 'validate': types.Text.validate

View File

@ -47,7 +47,13 @@ def get_test_podmanager(**kwargs):
'uuid': kwargs.get('uuid', 'ea8e2a25-2901-438d-8157-de7ffd68d051'), 'uuid': kwargs.get('uuid', 'ea8e2a25-2901-438d-8157-de7ffd68d051'),
'name': kwargs.get('name', 'fake_name'), 'name': kwargs.get('name', 'fake_name'),
'url': kwargs.get('url', 'fake_url'), 'url': kwargs.get('url', 'fake_url'),
'auth': kwargs.get('auth', 'fake_auth'), 'authentication': [{
'auth_items': {
'password': 'fake-pass',
'username': 'fake-admin',
},
'type': 'basic',
}],
'status': kwargs.get('size', 'fake_status'), 'status': kwargs.get('size', 'fake_status'),
'description': kwargs.get('description', 'fake_description'), 'description': kwargs.get('description', 'fake_description'),
'location': kwargs.get('location', 'fake_location'), 'location': kwargs.get('location', 'fake_location'),