]> git.uio.no Git - uio-zabbix.git/blobdiff - zabbix_rabbitmq_autodiscovery.py
Use env python header + Upgrade code to support python3 [GID-1248]
[uio-zabbix.git] / zabbix_rabbitmq_autodiscovery.py
index 8876eb53650cfa52842cf6a1d57d459601497a39..b451404654385d26083ce5bdf979313772e5b539 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python
 #
 # Authors:
 # rafael@E-MC2.NET / https://e-mc2.net/
@@ -99,7 +99,7 @@ def generate_queues_zabbix_autodiscovery(data):
                 queues_list.append(queue)
 
         result = {"data":queues_list}
-        print json.dumps(result,sort_keys=True,indent=2)
+        print (json.dumps(result,sort_keys=True,indent=2))
     
     except Exception as e:
       raise Exception("[ERROR]: %s\n" % e)
@@ -119,6 +119,6 @@ if __name__ == '__main__':
         else:
             raise Exception("[ERROR]: Wrong parameter. Valid parameters [queues]\n")
             
-    except Exception, e:
-        print e
+    except Exception as e:
+        print (str(e))
         sys.exit(1)