]> git.llucax.com Git - software/pymin.git/blobdiff - pymin/services/util.py
Merge branch 'procman' of baryon.com.ar:/home/luca/pymin into procman
[software/pymin.git] / pymin / services / util.py
index 91d28c3213830bd5064d5c4705bd2a449088e831..b8a2ace83a66f1f05c1da64ee5168c3730b5b5fd 100644 (file)
@@ -13,8 +13,8 @@ from pymin.dispatcher import Handler, handler, HandlerError, \
                                 CommandNotFoundError
 from pymin.seqtools import Sequence
 
                                 CommandNotFoundError
 from pymin.seqtools import Sequence
 
-DEBUG = False
-#DEBUG = True
+#DEBUG = False
+DEBUG = True
 
 __ALL__ = ('Error', 'ReturnNot0Error', 'ExecutionError', 'ItemError',
             'ItemAlreadyExistsError', 'ItemNotFoundError', 'ContainerError',
 
 __ALL__ = ('Error', 'ReturnNot0Error', 'ExecutionError', 'ItemError',
             'ItemAlreadyExistsError', 'ItemNotFoundError', 'ContainerError',
@@ -216,9 +216,8 @@ def get_network_devices():
                 d[name].addrs[from_addr] = Address(from_addr,24, peer=to_addr)
             except IndexError:
                 pass
                 d[name].addrs[from_addr] = Address(from_addr,24, peer=to_addr)
             except IndexError:
                 pass
-            
     return d
     return d
-       
+
 def get_peers():
     p = subprocess.Popen(('ip', '-o', 'addr'), stdout=subprocess.PIPE,
                                                     close_fds=True)
 def get_peers():
     p = subprocess.Popen(('ip', '-o', 'addr'), stdout=subprocess.PIPE,
                                                     close_fds=True)
@@ -643,10 +642,10 @@ class InitdHandler(ServiceHandler):
         p = subprocess.Popen(('pgrep', '-f', self._initd_name),
                                 stdout=subprocess.PIPE)
         pid = p.communicate()[0]
         p = subprocess.Popen(('pgrep', '-f', self._initd_name),
                                 stdout=subprocess.PIPE)
         pid = p.communicate()[0]
-        if p.wait() == 0 and len(pid) > 0:
-            c._service_running = True
+        if p.returncode == 0 and len(pid) > 0:
+            self._service_running = True
         else:
         else:
-            c._service_running = False
+            self._service_running = False
 
 class TransactionalHandler(Handler):
     r"""Handle command transactions providing a commit and rollback commands.
 
 class TransactionalHandler(Handler):
     r"""Handle command transactions providing a commit and rollback commands.