From 42c09c086f6da966bd08e108c0ee171d43016a93 Mon Sep 17 00:00:00 2001
From: Jonas <jonas@holm.tech>
Date: Thu, 7 Mar 2019 17:53:40 +0100
Subject: [PATCH] Revert "Added: Try, Except and comments in krb_updatetoken()"

This reverts commit a6a3002f97bf4e1f80866c775b10ac185faa2d82.
---
 Script/CastorScript.py | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/Script/CastorScript.py b/Script/CastorScript.py
index 2b1bd3d..9293403 100644
--- a/Script/CastorScript.py
+++ b/Script/CastorScript.py
@@ -337,19 +337,13 @@ def krb_setcache(krbcachefile, logger):
 
 
 def krb_updatetoken(keytab, user, logger):
-    
-    try:
-        kinit = subprocess.Popen(['kinit', '-kt', keytab, user], #'-l','3900s'],
+    kinit = subprocess.Popen(['kinit', '-kt', keytab, user], #'-l','3900s'],
                   stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-        returnCode = kinit.wait()
-    except Exception as ex:
-        logger.warning('kinit failed. Ret code: %d Output: %s, with exception= %s' % returnCode, kinit.stdout.read(), str(ex))
+    ret = kinit.wait()
 
-
-    # if the returncode from the kinit process is not 0, something went wrong
-    if returnCode != 0 or returnCode is None:
+    if ret:
         logger.warning('kinit failed. Ret code: %d Output: %s' %
-                       (returnCode, kinit.stdout.read()))
+                       (ret, kinit.stdout.read()))
         return None
     else:
         logger.debug('kinit succeeded. Output: %s' % kinit.stdout.read())
-- 
GitLab