diff options
author | Huang Haibin <haibin.huang@intel.com> | 2018-09-20 10:39:57 +0800 |
---|---|---|
committer | Huang Haibin <haibin.huang@intel.com> | 2018-09-20 10:39:57 +0800 |
commit | d6279df2157d37978895cb246b2e52cb992c3d1f (patch) | |
tree | 88545d14a70a70a330352b727efdb314414dc6cc /pike | |
parent | dab0c9f0edb0d2df7828009babb6686f625ad0c4 (diff) |
Add UT and Funtion for infra SRIOV
Change-Id: I6ce0f4e8a9a6b7984deeb28ae9ff50df3995e60c
Issue-ID: MULTICLOUD-250
Signed-off-by: Huang Haibin <haibin.huang@intel.com>
Diffstat (limited to 'pike')
-rw-r--r-- | pike/pike/resource/tests/tests_infra_workload.py | 10 | ||||
-rw-r--r-- | pike/pike/resource/views/infra_workload.py | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/pike/pike/resource/tests/tests_infra_workload.py b/pike/pike/resource/tests/tests_infra_workload.py index 48c29d15..e473c84f 100644 --- a/pike/pike/resource/tests/tests_infra_workload.py +++ b/pike/pike/resource/tests/tests_infra_workload.py @@ -51,6 +51,16 @@ MOCK_HEAT_CREATE_BODY1 = { "attribute_value":"m1.hpa.medium" } ] + }, + { + "type":"sriovNetNetwork_directives", + "attributes":[ + { + "attribute_name":"physnetwork_label", + "attribute_value":"physnet1" + } + ] + } ] } diff --git a/pike/pike/resource/views/infra_workload.py b/pike/pike/resource/views/infra_workload.py index 3e144e7f..4d0b6716 100644 --- a/pike/pike/resource/views/infra_workload.py +++ b/pike/pike/resource/views/infra_workload.py @@ -55,8 +55,7 @@ class InfraWorkload(APIView): for directive in oof_directive.get("directives", []): if directive["type"] == "vnfc": for directive2 in directive.get("directives", []): - #if directive2["type"] in ["flavor_directives", "sriovNICNetwork_directives"]: - if directive2["type"] == "flavor_directives": + if directive2["type"] in ["flavor_directives", "sriovNICNetwork_directives"]: for attr in directive2.get("attributes", []): label_name = attr["attribute_name"] label_value = attr["attribute_value"] |