From ecc3607337dcaeac858e62508458f5653acdad4a Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Wed, 27 Jan 2016 10:04:47 -0600 Subject: [PATCH] Forward port missing patches The change forward ports the changes in master that didn't make it into the plugins repo prior to its creation. Change-Id: If303a4cd6fab9129b54879df9aed3fc8e88295ed Signed-off-by: Kevin Carter --- lookups/py_pkgs.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lookups/py_pkgs.py b/lookups/py_pkgs.py index a7af487..30b86d3 100644 --- a/lookups/py_pkgs.py +++ b/lookups/py_pkgs.py @@ -362,7 +362,7 @@ class DependencyFileProcessor(object): if check_item: git_data[item] = check_item - def _process_git(self, loaded_yaml, git_item): + def _process_git(self, loaded_yaml, git_item, yaml_file_name): """Process git repos. :type loaded_yaml: ``dict`` @@ -392,6 +392,13 @@ class DependencyFileProcessor(object): ) git_data['egg_name'] = name.replace('-', '_') + # This conditional is set to ensure we're only processing git + # repos from the defaults file when those same repos are not + # being set in the repo_packages files. + if '/defaults/main' in yaml_file_name: + if name in GIT_PACKAGE_DEFAULT_PARTS: + return + # get the repo branch definition git_data['branch'] = loaded_yaml.get(branch_var) self._check_defaults(git_data, name, 'branch') @@ -449,15 +456,12 @@ class DependencyFileProcessor(object): role_name = _role_name.split(os.sep)[0] for key, values in loaded_config.items(): - # This conditional is set to ensure we're not processes git - # repos from the defaults file which may conflict with what is - # being set in the repo_packages files. - if '/defaults/main' not in file_name: - if key.endswith('git_repo'): - self._process_git( - loaded_yaml=loaded_config, - git_item=key - ) + if key.endswith('git_repo'): + self._process_git( + loaded_yaml=loaded_config, + git_item=key, + yaml_file_name=file_name + ) if [i for i in BUILT_IN_PIP_PACKAGE_VARS if i in key]: self._py_pkg_extend(values)