]> git.llucax.com Git - software/pymin.git/blobdiff - pymin/services/util.py
Merge branch 'master' of baryon.com.ar:/home/luca/pymin
[software/pymin.git] / pymin / services / util.py
index 739b10908dcb6b4abebec05cd32eb81500b0445c..f3bb01301778268ceccdb4ea96a068040da29659 100644 (file)
@@ -13,8 +13,8 @@ from pymin.dispatcher import Handler, handler, HandlerError, \
                                 CommandNotFoundError
 from pymin.seqtools import Sequence
 
-DEBUG = False
-#DEBUG = True
+#DEBUG = False
+DEBUG = True
 
 __ALL__ = ('Error', 'ReturnNot0Error', 'ExecutionError', 'ItemError',
             'ItemAlreadyExistsError', 'ItemNotFoundError', 'ContainerError',
@@ -171,10 +171,11 @@ class Device(Sequence):
         self.name = name
         self.mac = mac
         self.ppp = ppp
+        self.active = True
         self.addrs = dict()
         self.routes = list()
     def as_tuple(self):
-        return (self.name, self.mac, self.addrs)
+        return (self.name, self.mac, self.active, self.addrs)
 
 
 
@@ -216,9 +217,8 @@ def get_network_devices():
                 d[name].addrs[from_addr] = Address(from_addr,24, peer=to_addr)
             except IndexError:
                 pass
-            
     return d
-       
+
 def get_peers():
     p = subprocess.Popen(('ip', '-o', 'addr'), stdout=subprocess.PIPE,
                                                     close_fds=True)