X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plnet.py;h=8ce9428572bb7ab0f2881b454ae08c2a7300d6fd;hb=7a94db1a3942cc7232bf782bcab86ca83f60d0c3;hp=540a6990c7f36d6e8ae306b66c16596391b24f4f;hpb=ebf067a4dbd929f923c971a54b20f3afcb522ed7;p=pyplnet.git diff --git a/plnet.py b/plnet.py index 540a699..8ce9428 100755 --- a/plnet.py +++ b/plnet.py @@ -155,14 +155,10 @@ def InitInterfaces(logger, plc, data, root="", files_only=False, program="NodeMa else: logger.log("net:InitInterfaces WARNING: interface alias (%s) not matched to an interface"% details['ALIAS']) device_id -= 1 - elif 'BRIDGE' in details: - #The bridge inherits the mac of the first attached interface. - if 'IFNAME' in details: - ifname = details['IFNAME'] - device_id -= 1 - else: - ifname = 'eth0' - device_id -= 1 + elif 'BRIDGE' in details and 'IFNAME' in details: + # The bridge inherits the mac of the first attached interface. + ifname = details['IFNAME'] + device_id -= 1 logger.log('net:InitInterfaces: Bridge detected. Adding %s to devices_map' % ifname) devices_map[ifname] = removeBridgedIfaceDetails(details) bridgeName = details['BRIDGE'] @@ -459,8 +455,6 @@ if __name__ == "__main__": parser.add_option("-p", "--program", action="store", type="string", dest="program", default="plnet") (options, args) = parser.parse_args() - options.root = '' - options.verbose = True if len(args) != 1 or options.root is None: print sys.argv print >>sys.stderr, "Missing root or node_id"