From 707ea14579a969fa6266aab2f8fafb2f095b0806 Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Thu, 24 Aug 2017 18:18:27 +0800 Subject: bugfix: fail to generate APIs document Change-Id: I13c91fb34e190cd62400eccec6b755419aad89d1 Signed-off-by: SerenaFeng --- utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py | 4 ++-- utils/test/testapi/opnfv_testapi/resources/scenario_models.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'utils/test/testapi/opnfv_testapi/resources') diff --git a/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py b/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py index bd06400b4..7ab57c3ff 100644 --- a/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py +++ b/utils/test/testapi/opnfv_testapi/resources/scenario_handlers.py @@ -255,7 +255,7 @@ class ScenarioUpdater(object): @iter_installers @iter_versions def _update_requests_change_owner(self, version): - version.owner = self.body + version.owner = self.body.get('owner') def _filter_installers(self, installers): return self._filter('installer', installers) @@ -587,7 +587,7 @@ class ScenarioOwnerHandler(GenericScenarioUpdateHandler): @type body: L{string} @in body: body @param installer: installer type - @type installer: L{string} + @type installer: L{ScenarioChangeOwnerRequest} @in installer: query @required installer: True @param version: version diff --git a/utils/test/testapi/opnfv_testapi/resources/scenario_models.py b/utils/test/testapi/opnfv_testapi/resources/scenario_models.py index ec262aa2f..c6da76b81 100644 --- a/utils/test/testapi/opnfv_testapi/resources/scenario_models.py +++ b/utils/test/testapi/opnfv_testapi/resources/scenario_models.py @@ -160,6 +160,12 @@ class ScenarioCreateRequest(models.ModelBase): return {'installers': ScenarioInstaller} +@swagger.model() +class ScenarioChangeOwnerRequest(models.ModelBase): + def __init__(self, owner=None): + self.owner = owner + + @swagger.model() class Scenario(models.ModelBase): """ -- cgit 1.2.3-korg