]> Frank Brehm's Git Trees - pixelpark/puppetmaster-webhooks.git/commitdiff
Bugfixing
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 6 Sep 2018 10:31:05 +0000 (12:31 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 6 Sep 2018 10:31:05 +0000 (12:31 +0200)
lib/webhooks/puppetfile.py

index 297166c44abc4f4f73d426701209f164eae8a649..797da366ccca282f1d2f074b2a6bd5d60019f0e8 100644 (file)
@@ -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))