From 344ed91166cffe0fa998a4ccb39c41f001ded71a Mon Sep 17 00:00:00 2001
From: Marta Vila Fernandes <ana.marta.lisboa.vila.fernandes@cern.ch>
Date: Tue, 19 Nov 2024 11:07:48 +0100
Subject: [PATCH] try to get the new uuid

---
 reposync/rhncheck.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/reposync/rhncheck.py b/reposync/rhncheck.py
index d757d81..d007701 100755
--- a/reposync/rhncheck.py
+++ b/reposync/rhncheck.py
@@ -62,7 +62,11 @@ def get_uuids(input_data, uuid_names):
                     cmd = f"subscription-manager register --activationkey {activation_key} --force --name {name} --org {org}"
                     process = subprocess.Popen(cmd, stderr=subprocess.PIPE, shell=True, stdout=subprocess.PIPE)
                     out, err = process.communicate()
-                    uuids.append(out['body']['uuid'])
+                    print(f"Output: {out}")
+                    if err:
+                        print(f"Error creating a new uuid: {err}")
+                        sys.exit(1)
+                    uuids.append(str(out).split('ID: ')[1].split('\n')[0])
                     break
                 else:
                     uuids.append(entry.get('uuid'))
-- 
GitLab