file name information if option is not found

This commit is contained in:
Emmanuel Garette 2021-02-28 20:41:57 +01:00
parent cbd1081371
commit b049cb9324
3 changed files with 4 additions and 3 deletions

View File

@ -50,7 +50,7 @@ class GroupAnnotator:
if group.leader in cache_paths:
leader_fam_path = cache_paths[group.leader]
else:
leader_fam_path = self.objectspace.paths.get_variable_family_path(group.leader)
leader_fam_path = self.objectspace.paths.get_variable_family_path(group.leader, group.xmlfiles)
cache_paths[group.leader] = leader_fam_path
follower_names = list(group.follower.keys())
leader = self.objectspace.paths.get_variable(group.leader)

View File

@ -297,7 +297,7 @@ class ServiceAnnotator:
msg = _(f'ip with ip_type "{variable.type}" must have netmask')
raise DictConsistencyError(msg, 64, ip.xmlfiles)
if hasattr(ip, 'netmask'):
netmask = self.objectspace.paths.get_variable(ip.netmask)
netmask = self.objectspace.paths.get_variable(ip.netmask, ip.xmlfiles)
if netmask.type != 'netmask':
msg = _(f'netmask in ip must have type "netmask", not "{netmask.type}"')
raise DictConsistencyError(msg, 65, ip.xmlfiles)

View File

@ -187,10 +187,11 @@ class Path:
def get_variable_family_path(self,
name: str,
xmlfiles: List[str]=False,
) -> str: # pylint: disable=C0111
"""Get the full path of a family
"""
return self._get_variable(name)['family']
return self._get_variable(name, xmlfiles=xmlfiles)['family']
def get_variable_path(self,
name: str,