From b73c759ceb608d50a67564bf5695060722505b6b Mon Sep 17 00:00:00 2001 From: liboNet Date: Thu, 19 Apr 2018 07:04:02 +0800 Subject: Fix ocata registration test and implementation fix the typo of cpupinning feature and rename its function name remove the unit of ram size, the MB is the agreement unit in openstack Change-Id: Ia798cfa85edc5821a536db7f5ba5335dc7948b4b Issue-ID: MULTICLOUD-200 Signed-off-by: liboNet --- ocata/ocata/registration/tests/test_registration.py | 4 ++-- ocata/ocata/registration/views/registration.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ocata/ocata/registration/tests/test_registration.py b/ocata/ocata/registration/tests/test_registration.py index c35eddfa..50b7fda2 100644 --- a/ocata/ocata/registration/tests/test_registration.py +++ b/ocata/ocata/registration/tests/test_registration.py @@ -63,7 +63,7 @@ MOCK_GET_FLAVOR_RESPONSE = { "OS-FLV-DISABLED:disabled": True, "link": [{"href":1}] }, { - "id": "2", "name": "mini", "vcpus": 2, "ram": "2MB", + "id": "2", "name": "mini", "vcpus": 2, "ram": "2", "disk": "2G", "OS-FLV-EXT-DATA:ephemeral": True, "swap": False, "os-flavor-access:is_public": True, "OS-FLV-DISABLED:disabled": True @@ -154,7 +154,7 @@ MOCK_GET_HPA_FLAVOR_LIST1_RESPONSE= { "OS-FLV-DISABLED:disabled": True, "link": [{"href": 1}] }, { - "id": "2", "name": "onap.mini", "vcpus": 2, "ram": "2MB", + "id": "2", "name": "onap.mini", "vcpus": 2, "ram": "2", "disk": "2G", "OS-FLV-EXT-DATA:ephemeral": True, "swap": False, "os-flavor-access:is_public": True, "OS-FLV-DISABLED:disabled": True diff --git a/ocata/ocata/registration/views/registration.py b/ocata/ocata/registration/views/registration.py index 636e3ecc..25ec0dbf 100644 --- a/ocata/ocata/registration/views/registration.py +++ b/ocata/ocata/registration/views/registration.py @@ -91,7 +91,7 @@ class Registry(newton_registration.Registry): hpa_caps.append(caps_dict) # cpupining capabilities - caps_dict = self._get_cpupining_capabilities(extra_specs) + caps_dict = self._get_cpupinning_capabilities(extra_specs) if len(caps_dict) > 0: self._logger.debug("cpupining_capabilities_info: %s" % caps_dict) hpa_caps.append(caps_dict) @@ -157,13 +157,13 @@ class Registry(newton_registration.Registry): return basic_capability - def _get_cpupining_capabilities(self, extra_specs): + def _get_cpupinning_capabilities(self, extra_specs): cpupining_capability = {} feature_uuid = uuid.uuid4() if extra_specs.has_key('hw:cpu_policy') or extra_specs.has_key('hw:cpu_thread_policy'): cpupining_capability['hpaCapabilityID'] = str(feature_uuid) - cpupining_capability['hpaFeature'] = 'cpuPining' + cpupining_capability['hpaFeature'] = 'cpuPinning' cpupining_capability['hardwareArchitecture'] = 'generic' cpupining_capability['version'] = 'v1' -- cgit 1.2.3-korg