]> git.uio.no Git - uio-zabbix.git/blobdiff - zabbix_get_webapps_status_v2.py
Use env python header + Upgrade code to support python3 [GID-1248]
[uio-zabbix.git] / zabbix_get_webapps_status_v2.py
index d4f37114633a6496ab8c570ad4f712d5f5b9d418..adb27dc45d08920fc6240e4a6ea54d1dcc130ba2 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python
 #
 # Authors:
 # rafael@postgresql.org.es / http://www.postgresql.org.es/
@@ -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
 
         #
@@ -112,7 +112,7 @@ def generate_webapps_health_output(src_file):
 
         return result
 
-    except Exception,e:
+    except Exception as e:
         raise Exception(str(e)) 
 
 
@@ -171,12 +171,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")