1051
1051
:param config_file : Service's config file to query sections
1052
1052
:param interface : Subordinate interface to inspect
1054
self.service = service
1055
1054
self.config_file = config_file
1055
if isinstance(service, list):
1056
self.services = service
1058
self.services = [service]
1056
1059
if isinstance(interface, list):
1057
1060
self.interfaces = interface
1075
1078
'setting from %s' % rid, level=ERROR)
1078
if self.service not in sub_config:
1079
log('Found subordinate_config on %s but it contained'
1080
'nothing for %s service' % (rid, self.service),
1084
sub_config = sub_config[self.service]
1085
if self.config_file not in sub_config:
1086
log('Found subordinate_config on %s but it contained'
1087
'nothing for %s' % (rid, self.config_file),
1091
sub_config = sub_config[self.config_file]
1092
for k, v in six.iteritems(sub_config):
1094
for section, config_list in six.iteritems(v):
1095
log("adding section '%s'" % (section),
1097
if ctxt[k].get(section):
1098
ctxt[k][section].extend(config_list)
1100
ctxt[k][section] = config_list
1081
for service in self.services:
1082
if service not in sub_config:
1083
log('Found subordinate_config on %s but it contained'
1084
'nothing for %s service' % (rid, service),
1088
sub_config = sub_config[service]
1089
if self.config_file not in sub_config:
1090
log('Found subordinate_config on %s but it contained'
1091
'nothing for %s' % (rid, self.config_file),
1095
sub_config = sub_config[self.config_file]
1096
for k, v in six.iteritems(sub_config):
1098
for section, config_list in six.iteritems(v):
1099
log("adding section '%s'" % (section),
1101
if ctxt[k].get(section):
1102
ctxt[k][section].extend(config_list)
1104
ctxt[k][section] = config_list
1103
1107
log("%d section(s) found" % (len(ctxt['sections'])), level=DEBUG)