From f5ef46758319ab77c4ef53fded5b0ec32ecd0236 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 6 Sep 2018 12:31:05 +0200 Subject: [PATCH] Bugfixing --- lib/webhooks/puppetfile.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/webhooks/puppetfile.py b/lib/webhooks/puppetfile.py index 297166c..797da36 100644 --- a/lib/webhooks/puppetfile.py +++ b/lib/webhooks/puppetfile.py @@ -33,7 +33,7 @@ from .module_info import ModuleInfo from .module_list import ModuleInfoDict -__version__ = '0.3.1' +__version__ = '0.3.2' LOG = logging.getLogger(__name__) @@ -76,6 +76,12 @@ class Puppetfile(BaseObject): base_dir=base_dir, initialized=False, ) + if env_root_dir is not None: + self.env_root_dir = env_root_dir + + if environment is not None: + self.environment = environment + if initialized is not None: self.initialized = initialized @@ -271,11 +277,7 @@ class Puppetfile(BaseObject): appname=self.appname, verbose=self.verbose, base_dir=self.base_dir, line=prev_line, env=self.environment) if module_info: - full_name = module_info.full_name - if full_name in modules: - modules[full_name].merge_in(module_info) - else: - modules[full_name] = module_info + modules.merge(module_info) prev_line = '' @@ -286,11 +288,7 @@ class Puppetfile(BaseObject): appname=self.appname, verbose=self.verbose, base_dir=self.base_dir, line=prev_line, env=self.environment) if module_info: - full_name = module_info.full_name - if full_name in self.modules: - modules[full_name].merge_in(module_info) - else: - modules[full_name] = module_info + modules.merge(module_info) if self.verbose > 1: LOG.debug("Closing {!r} ...".format(self.filename)) -- 2.39.5