]> git.uio.no Git - uio-zabbix.git/blobdiff - zabbix_get_webapps_status.py
Use env python header + Upgrade code to support python3 [GID-1248]
[uio-zabbix.git] / zabbix_get_webapps_status.py
index fd483bfbd9e6c56df7fd75d43613f30097f8e6b1..39de0d03095684e012108eaa3b213356f8968689 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python
 #
 # Authors:
 # rafael@e-mc2.net / https://e-mc2.net/
@@ -52,7 +52,7 @@ def generate_webapps_health_output(src_file):
             with open(src_file,'r') as info_file:    
                 data = json.load(info_file)
 
-        except Exception,e:
+        except Exception as e:
             return result
 
         #
@@ -166,7 +166,7 @@ def generate_webapps_health_output(src_file):
 
         return result
 
-    except Exception,e:
+    except Exception as e:
         raise Exception(str(e)) 
 
 
@@ -226,12 +226,12 @@ if __name__ == '__main__':
                 os.remove(tmp_stat_file.name)
 
         else:
-            print "1"
+            print ("1")
             sys.exit(1)
 
-    except Exception, e:
-        print "1"
+    except Exception as e:
+        print ("1")
         sys.exit(1)
 
     # Return value 0 = execution OK
-    print "0"
+    print ("0")