Commit 7194fe10 by Michael Peters

need to handle the case where include_pattern and exclude_pattern exist in the…

need to handle the case where include_pattern and exclude_pattern exist in the config file but contain empty strings
parent ab6e1a43
......@@ -257,6 +257,8 @@ class Ec2Inventory(object):
pattern_include = config.get('ec2', 'pattern_include')
if pattern_include and len(pattern_include) > 0:
self.pattern_include = re.compile(pattern_include)
else
self.pattern_include = None
except ConfigParser.NoOptionError, e:
self.pattern_include = None
......@@ -265,8 +267,10 @@ class Ec2Inventory(object):
pattern_exclude = config.get('ec2', 'pattern_exclude');
if pattern_exclude and len(pattern_exclude) > 0:
self.pattern_exclude = re.compile(pattern_exclude)
else
self.pattern_exclude = None
except ConfigParser.NoOptionError, e:
self.pattern_exclude = ''
self.pattern_exclude = None
def parse_cli_args(self):
''' Command line argument processing '''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment