1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-01-08 21:18:00 +03:00

Updating linux actor

This commit is contained in:
Adolfo Gómez 2014-05-24 02:02:20 +00:00
parent af2de4881f
commit 9bdfb4a7eb
5 changed files with 46 additions and 36 deletions

View File

@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?>
<pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">python2.6</pydev_property>
<?eclipse-pydev version="1.0"?><pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/linuxActor/src</path>

View File

@ -1,3 +1,9 @@
udsactor (1.1) stable; urgency=medium
* Fixing IP notification issues
-- Adolfo Gómez García <dkmaster@dkmon.com> Fri, 23 May 2014 13:00:32 +0200
udsactor (1.0) stable; urgency=low
* Initial version
-- Adolfo Gómez García <agomez@virtualcable.es> Fri, 18 Nov 2011 05:35:11 +0100

View File

@ -1 +1 @@
udsactor_1.0_all.deb contrib/net extra
udsactor_1.1_all.deb contrib/net extra

View File

@ -4,6 +4,10 @@
'''
import fcntl, socket, struct, array, platform
import logging
logger = logging.getLogger(__name__)
def getMacAddr(ifname):
if isinstance(ifname, list):
return dict([ (name, getMacAddr(name)) for name in ifname ])
@ -55,6 +59,7 @@ def getIpAndMac(ifname):
def getExternalIpAndMacs():
res = getIpAndMac(getInterfaces())
logger.debug('Res: {0}'.format(res))
for key in res.keys():
if res[key]['mac'] == '00:00:00:00:00:00':
del res[key]

View File

@ -46,7 +46,8 @@ class Rpc(object):
self._id = ','.join([ v['mac'] for v in net.getExternalIpAndMacs().values() ])
logger.debug('Sending message to broker: {0} -> {1}, {2}'.format(self._id, msg, data))
return self._server.message(self._id, msg, data)
except Exception:
except Exception as e:
logger.exception('Error notifyinh message')
return None
return ''
@ -78,7 +79,7 @@ class Rpc(object):
@staticmethod
def notifyIpChange():
if Rpc._manager is None: # Not managed
return
return None
interfaces = ','.join([ v['mac'] + '=' + v['ip'] for v in net.getExternalIpAndMacs().values() ])
return Rpc._manager.message(IP_MSG, interfaces)