From: Barış Metin Date: Thu, 16 Apr 2009 13:46:12 +0000 (+0000) Subject: in 4.3 InterfaceTag (and NodeNetworkSetting) has "tagname" key instead of "name" X-Git-Tag: pyplnet-4.3-1~2 X-Git-Url: http://git.onelab.eu/?p=pyplnet.git;a=commitdiff_plain;h=0603f3a71d3d109372b116ab2e443d283203f719 in 4.3 InterfaceTag (and NodeNetworkSetting) has "tagname" key instead of "name" --- diff --git a/plnet.py b/plnet.py index 2c06d06..5b0c667 100755 --- a/plnet.py +++ b/plnet.py @@ -109,11 +109,15 @@ def InitInterfaces(logger, plc, data, root="", files_only=False, program="NodeMa for setting in settings: # to explicitly set interface name - settingname = setting['name'].upper() + name_key = "name" + if version == 4.3: + name_key = "tagname" + + settingname = setting[name_key].upper() if settingname in ('IFNAME','ALIAS','CFGOPTIONS','DRIVER'): inter[settingname]=setting['value'] else: - logger.log("net:InitInterfaces WARNING: ignored setting named %s"%setting['name']) + logger.log("net:InitInterfaces WARNING: ignored setting named %s"%setting[name_key]) # support aliases to interfaces either by name or HWADDR if 'ALIAS' in inter: