aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/steps/onboard/cds.py
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2021-04-02 06:54:42 +0000
committerGerrit Code Review <gerrit@onap.org>2021-04-02 06:54:42 +0000
commitb8037f19c416b3c66e735863cbb1143b75571236 (patch)
treeff33accbbe99f15c82c196d525d91ef55c18ca7e /src/onaptests/steps/onboard/cds.py
parentb8607c246f1765275f3a13c772eb27566db1269d (diff)
parent0a315a1b542a96d62fea12f49b353bca54464ee7 (diff)
Merge "Basic VM macro"
Diffstat (limited to 'src/onaptests/steps/onboard/cds.py')
-rw-r--r--src/onaptests/steps/onboard/cds.py30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/onaptests/steps/onboard/cds.py b/src/onaptests/steps/onboard/cds.py
index 185753b..f137adb 100644
--- a/src/onaptests/steps/onboard/cds.py
+++ b/src/onaptests/steps/onboard/cds.py
@@ -151,8 +151,8 @@ class CbaEnrichStep(CDSBaseStep):
"""
super().execute()
blueprint: Blueprint = Blueprint.load_from_file(settings.CDS_CBA_UNENRICHED)
- blueprint.enrich()
- blueprint.save(settings.CDS_CBA_ENRICHED)
+ enriched: Blueprint = blueprint.enrich()
+ enriched.save(settings.CDS_CBA_ENRICHED)
@BaseStep.store_state(cleanup=True)
def cleanup(self) -> None:
@@ -163,3 +163,29 @@ class CbaEnrichStep(CDSBaseStep):
"""
super().cleanup()
Path(settings.CDS_CBA_ENRICHED).unlink()
+
+
+class CbaPublishStep(CDSBaseStep):
+ """Publish CBA file step."""
+
+ def __init__(self, cleanup=False) -> None:
+ """Initialize CBA publish step."""
+ super().__init__(cleanup=cleanup)
+ self.add_step(CbaEnrichStep(cleanup=cleanup))
+
+ @property
+ def description(self) -> str:
+ """Step description."""
+ return "Publish CBA file."
+
+ @BaseStep.store_state
+ def execute(self) -> None:
+ """Enrich CBA file.
+
+ Use settings values:
+ - CDS_DD_FILE.
+
+ """
+ super().execute()
+ blueprint: Blueprint = Blueprint.load_from_file(settings.CDS_CBA_ENRICHED)
+ blueprint.publish()