1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

update info-center (#57269)

This commit is contained in:
xuxiaowei0512 2019-06-08 01:02:07 +08:00 committed by Nathaniel Case
parent 767e02f9fe
commit 4dc6faea59
4 changed files with 13 additions and 13 deletions

View file

@ -292,7 +292,7 @@ class InfoCenterDebug(object):
replace('xmlns="http://www.huawei.com/netconf/vrp"', "") replace('xmlns="http://www.huawei.com/netconf/vrp"', "")
root = ElementTree.fromstring(xml_str) root = ElementTree.fromstring(xml_str)
global_cfg = root.findall("data/syslog/globalParam") global_cfg = root.findall("syslog/globalParam")
if global_cfg: if global_cfg:
for tmp in global_cfg: for tmp in global_cfg:
tmp_dict = dict() tmp_dict = dict()
@ -370,7 +370,7 @@ class InfoCenterDebug(object):
replace('xmlns="http://www.huawei.com/netconf/vrp"', "") replace('xmlns="http://www.huawei.com/netconf/vrp"', "")
root = ElementTree.fromstring(xml_str) root = ElementTree.fromstring(xml_str)
source_cfg = root.findall("data/syslog/icSources/icSource") source_cfg = root.findall("syslog/icSources/icSource")
if source_cfg: if source_cfg:
for tmp in source_cfg: for tmp in source_cfg:
tmp_dict = dict() tmp_dict = dict()

View file

@ -625,7 +625,7 @@ class InfoCenterGlobal(object):
replace('xmlns="http://www.huawei.com/netconf/vrp"', "") replace('xmlns="http://www.huawei.com/netconf/vrp"', "")
root = ElementTree.fromstring(xml_str) root = ElementTree.fromstring(xml_str)
channel_info["channelInfos"] = list() channel_info["channelInfos"] = list()
channels = root.findall("data/syslog/icChannels/icChannel") channels = root.findall("syslog/icChannels/icChannel")
if channels: if channels:
for channel in channels: for channel in channels:
channel_dict = dict() channel_dict = dict()
@ -716,7 +716,7 @@ class InfoCenterGlobal(object):
replace('xmlns="http://www.huawei.com/netconf/vrp"', "") replace('xmlns="http://www.huawei.com/netconf/vrp"', "")
root = ElementTree.fromstring(xml_str) root = ElementTree.fromstring(xml_str)
channel_direct_info["channelDirectInfos"] = list() channel_direct_info["channelDirectInfos"] = list()
dir_channels = root.findall("data/syslog/icDirChannels/icDirChannel") dir_channels = root.findall("syslog/icDirChannels/icDirChannel")
if dir_channels: if dir_channels:
for ic_dir_channel in dir_channels: for ic_dir_channel in dir_channels:
channel_direct_dict = dict() channel_direct_dict = dict()
@ -806,7 +806,7 @@ class InfoCenterGlobal(object):
replace('xmlns="http://www.huawei.com/netconf/vrp"', "") replace('xmlns="http://www.huawei.com/netconf/vrp"', "")
root = ElementTree.fromstring(xml_str) root = ElementTree.fromstring(xml_str)
filter_info["filterInfos"] = list() filter_info["filterInfos"] = list()
ic_filters = root.findall("data/syslog/icFilters/icFilter") ic_filters = root.findall("syslog/icFilters/icFilter")
if ic_filters: if ic_filters:
for ic_filter in ic_filters: for ic_filter in ic_filters:
filter_dict = dict() filter_dict = dict()
@ -894,7 +894,7 @@ class InfoCenterGlobal(object):
replace('xmlns="http://www.huawei.com/netconf/vrp"', "") replace('xmlns="http://www.huawei.com/netconf/vrp"', "")
root = ElementTree.fromstring(xml_str) root = ElementTree.fromstring(xml_str)
server_ip_info["serverIpInfos"] = list() server_ip_info["serverIpInfos"] = list()
syslog_servers = root.findall("data/syslog/syslogServers/syslogServer") syslog_servers = root.findall("syslog/syslogServers/syslogServer")
if syslog_servers: if syslog_servers:
for syslog_server in syslog_servers: for syslog_server in syslog_servers:
server_dict = dict() server_dict = dict()
@ -1065,7 +1065,7 @@ class InfoCenterGlobal(object):
replace('xmlns="http://www.huawei.com/netconf/vrp"', "") replace('xmlns="http://www.huawei.com/netconf/vrp"', "")
root = ElementTree.fromstring(xml_str) root = ElementTree.fromstring(xml_str)
server_domain_info["serverAddressInfos"] = list() server_domain_info["serverAddressInfos"] = list()
syslog_dnss = root.findall("data/syslog/syslogDNSs/syslogDNS") syslog_dnss = root.findall("syslog/syslogDNSs/syslogDNS")
if syslog_dnss: if syslog_dnss:
for syslog_dns in syslog_dnss: for syslog_dns in syslog_dnss:
dns_dict = dict() dns_dict = dict()
@ -1172,7 +1172,7 @@ class InfoCenterGlobal(object):
root = ElementTree.fromstring(xml_str) root = ElementTree.fromstring(xml_str)
global_info = root.findall( global_info = root.findall(
"data/syslog/globalParam") "syslog/globalParam")
if global_info: if global_info:
for tmp in global_info: for tmp in global_info:
@ -1253,7 +1253,7 @@ class InfoCenterGlobal(object):
root = ElementTree.fromstring(xml_str) root = ElementTree.fromstring(xml_str)
logfile_info = root.findall( logfile_info = root.findall(
"data/syslog/icLogFileInfos/icLogFileInfo") "syslog/icLogFileInfos/icLogFileInfo")
if logfile_info: if logfile_info:
for tmp in logfile_info: for tmp in logfile_info:
for site in tmp: for site in tmp:

View file

@ -274,7 +274,7 @@ class InfoCenterLog(object):
root = ElementTree.fromstring(xml_str) root = ElementTree.fromstring(xml_str)
# get global param info # get global param info
glb = root.find("data/syslog/globalParam") glb = root.find("syslog/globalParam")
if glb: if glb:
for attr in glb: for attr in glb:
if attr.tag in ["bufferSize", "logTimeStamp", "icLogBuffEn"]: if attr.tag in ["bufferSize", "logTimeStamp", "icLogBuffEn"]:
@ -282,7 +282,7 @@ class InfoCenterLog(object):
# get info-center source info # get info-center source info
log_dict["source"] = dict() log_dict["source"] = dict()
src = root.find("data/syslog/icSources/icSource") src = root.find("syslog/icSources/icSource")
if src: if src:
for attr in src: for attr in src:
if attr.tag in ["moduleName", "icChannelId", "icChannelName", "logEnFlg", "logEnLevel"]: if attr.tag in ["moduleName", "icChannelId", "icChannelName", "logEnFlg", "logEnLevel"]:

View file

@ -334,7 +334,7 @@ class InfoCenterTrap(object):
replace('xmlns="http://www.huawei.com/netconf/vrp"', "") replace('xmlns="http://www.huawei.com/netconf/vrp"', "")
root = ElementTree.fromstring(xml_str) root = ElementTree.fromstring(xml_str)
global_cfg = root.findall("data/syslog/globalParam") global_cfg = root.findall("syslog/globalParam")
if global_cfg: if global_cfg:
for tmp in global_cfg: for tmp in global_cfg:
tmp_dict = dict() tmp_dict = dict()
@ -417,7 +417,7 @@ class InfoCenterTrap(object):
replace('xmlns="http://www.huawei.com/netconf/vrp"', "") replace('xmlns="http://www.huawei.com/netconf/vrp"', "")
root = ElementTree.fromstring(xml_str) root = ElementTree.fromstring(xml_str)
source_cfg = root.findall("data/syslog/icSources/icSource") source_cfg = root.findall("syslog/icSources/icSource")
if source_cfg: if source_cfg:
for tmp in source_cfg: for tmp in source_cfg:
tmp_dict = dict() tmp_dict = dict()