[node-patches] Change in ovirt-node[master]: rhn: Fix sam_check

fabiand at fedoraproject.org fabiand at fedoraproject.org
Tue Jan 8 11:33:37 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: rhn: Fix sam_check
......................................................................

rhn: Fix sam_check

Previously the check was based on the return value, this wasn't reliable
as 0 was also returned when the node was registered to RHN or a
Satellite server.
Now the function is looking for a magic string to determin if SAM is
used or not.

Change-Id: Ifebca13acc78d143ff441076cd9dc0b72766503d
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/rhn.py
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/48/10748/1

diff --git a/scripts/rhn.py b/scripts/rhn.py
index 2524cc8..0f82079 100755
--- a/scripts/rhn.py
+++ b/scripts/rhn.py
@@ -324,8 +324,7 @@
     samcheck_cmd = subprocess_closefds("subscription-manager identity",
                                        shell=True, stdout=PIPE,
                                        stderr=open('/dev/null', 'w'))
-    samcheck = samcheck_cmd.communicate()[0]
-    if samcheck_cmd.returncode == 0:
+    if "identity is:" in samcheck_cmd.stdout.read():
         return True
     else:
         return False


--
To view, visit http://gerrit.ovirt.org/10748
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifebca13acc78d143ff441076cd9dc0b72766503d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list