From eaeefbc456448bb235cfaa9797f0fa16277f97a9 Mon Sep 17 00:00:00 2001
From: Simone Spinelli <simone.spinelli@geant.org>
Date: Thu, 6 Apr 2023 18:38:23 +0000
Subject: [PATCH] Add dry run and real base config deployment - not for real
 real we still miss dry_run=false

---
 .../workflows/device/create_device.py                      | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/geant_service_orchestrator/workflows/device/create_device.py b/geant_service_orchestrator/workflows/device/create_device.py
index 1a745762..b95f27bb 100644
--- a/geant_service_orchestrator/workflows/device/create_device.py
+++ b/geant_service_orchestrator/workflows/device/create_device.py
@@ -114,8 +114,9 @@ def provision_device_dry(
     )
     out = r.stdout.read()
     out_splitted = out.splitlines()
-
-    return {"output": out_splitted}
+    #if r.rc != 0: 
+    #    raise ValueError("Ansible has failed")
+    return {"dry_run_output": out_splitted, "return_code": r.rc}
 
 
 @inputstep("Confirm step", assignee ="CHANGES")
@@ -156,7 +157,7 @@ def provision_device_real(
     out = r.stdout.read()
     out_splitted = out.splitlines()
 
-    return {"output": out_splitted}
+    return {"real_run_output": out_splitted, "return_code": r.rc}
 
 @workflow(
     "Create Device",
-- 
GitLab