xci: Add flavor information for scenarios 37/48937/4
authorMarkos Chandras <mchandras@suse.de>
Thu, 14 Dec 2017 09:42:47 +0000 (09:42 +0000)
committerMarkos Chandras <mchandras@suse.de>
Thu, 14 Dec 2017 13:30:25 +0000 (13:30 +0000)
Scenarios may not support all XCI flavors so record that information
per scenario basis. This will resolve failures when we try to deploy
a scenario that doesn't support the selected flavor.

JIRA: RELENG-338

Change-Id: I5f73b139ee6c1831896aa32147c4dc1368673d92
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/opnfv-scenario-requirements.yml
xci/playbooks/get-opnfv-scenario-requirements.yml

index 8192fe2..036a8a7 100644 (file)
   src: https://gerrit.opnfv.org/gerrit/sfc
   version: master
   role: scenarios/os-odl-sfc/role/os-odl-sfc
+  flavors:
+    - ha
+    - mini
+    - noha
 - scenario: os-nosdn-nofeature
   scm: git
   src: https://git.opnfv.org/releng-xci
   version: master
   role: xci/scenarios/os-nosdn-nofeature/role/os-nosdn-nofeature
+  flavors:
+    - ha
+    - mini
+    - noha
 - scenario: os-odl-nofeature
   scm: git
   src: https://git.opnfv.org/releng-xci
   version: master
   role: xci/scenarios/os-odl-nofeature/role/os-odl-nofeature
-
+  flavors:
+    - ha
+    - mini
+    - noha
index 11aee8e..173b825 100644 (file)
       loop_control:
         label: "{{ item.item.scenario }}"
 
+    - name: Determine if selected {{ OPNFV_SCENARIO }} scenario can be deployed
+      set_fact:
+        deploy_scenario_on_flavor: XCI_FLAVOR in item.flavors
+      when: OPNFV_SCENARIO == item.scenario
+      with_items: "{{ scenarios }}"
+      loop_control:
+        label: "{{ item.scenario }}"
+
+    - name: Fail if {{ XCI_FLAVOR }} is not supported in {{ OPNFV_SCENARIO }}
+      fail:
+        msg:
+          - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+          - ERROR! The {{ OPNFV_SCENARIO }} scenario does not support the {{ XCI_FLAVOR }}
+          - ''
+          - This is a great chance for you to contribute to XCI ;-)
+          - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+          - ''
+      when:
+        - not deploy_scenario_on_flavor
+
   vars:
     ansible_python_interpreter: "/usr/bin/python"
     scenarios: "{{ lookup('file', scenario_file) | from_yaml }}"