summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Haibin <haibin.huang@intel.com>2018-09-20 10:39:57 +0800
committerHuang Haibin <haibin.huang@intel.com>2018-09-20 10:39:57 +0800
commitd6279df2157d37978895cb246b2e52cb992c3d1f (patch)
tree88545d14a70a70a330352b727efdb314414dc6cc
parentdab0c9f0edb0d2df7828009babb6686f625ad0c4 (diff)
Add UT and Funtion for infra SRIOV
Change-Id: I6ce0f4e8a9a6b7984deeb28ae9ff50df3995e60c Issue-ID: MULTICLOUD-250 Signed-off-by: Huang Haibin <haibin.huang@intel.com>
-rw-r--r--pike/pike/resource/tests/tests_infra_workload.py10
-rw-r--r--pike/pike/resource/views/infra_workload.py3
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"]