fix _has_systemctl referenced before assignment in python2.7
authorScott Baker <smbaker@gmail.com>
Mon, 7 Apr 2014 22:33:37 +0000 (15:33 -0700)
committerScott Baker <smbaker@gmail.com>
Mon, 7 Apr 2014 22:33:37 +0000 (15:33 -0700)
tools.py

index 334f33f..02e2ab9 100644 (file)
--- a/tools.py
+++ b/tools.py
@@ -314,6 +314,7 @@ def get_node_virt ():
 # cache result in memory as _has_systemctl
 _has_systemctl=None
 def has_systemctl ():
+    global _has_systemctl
     if _has_systemctl is None:
         _has_systemctl = (subprocess.call([ 'systemctl', '--help' ]) == 0)
     return _has_systemctl