AC-1295 Allow host names to contain brackets when importing from JSON sources.

This commit is contained in:
Chris Church
2014-06-06 14:17:05 -04:00
parent 28c8a3822d
commit 24df1a88ee
2 changed files with 8 additions and 4 deletions

View File

@@ -169,10 +169,9 @@ class BaseLoader(object):
def get_host(self, name):
'''
Return a MemHost instance from host name, creating if needed.
Return a MemHost instance from host name, creating if needed. If name
contains brackets, they will not be interpreted as a host pattern.
'''
if '[' in name or ']' in name:
raise ValueError('host ranges like %s are not supported by this importer' % name)
host_name = name.split(':')[0]
if self.host_filter_re and not self.host_filter_re.match(host_name):
logger.debug('Filtering host %s', host_name)