From de28f5a6f8d2b581de28744d47dc582680dfc15c Mon Sep 17 00:00:00 2001
From: Kevin Carter <kevin.carter@rackspace.com>
Date: Fri, 17 Apr 2015 13:30:49 -0500
Subject: [PATCH] Resolves lookup plugin name duplication issue

The `playbooks/plugins/lookups/py_pkgs.py` had an issue where it's
assumed that the name of a package is always split on an "_" however
a repo name could be anything before the `_git_repo` portion. This
commit corrects that issue.

Change-Id: I49f8a7726ed99e47ff514cdf6e61472fac5b9ed4
Partially-Implements: blueprint master-kilofication
---
 playbooks/plugins/lookups/py_pkgs.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/playbooks/plugins/lookups/py_pkgs.py b/playbooks/plugins/lookups/py_pkgs.py
index e3fcac97b1..86a43ab6ab 100644
--- a/playbooks/plugins/lookups/py_pkgs.py
+++ b/playbooks/plugins/lookups/py_pkgs.py
@@ -134,7 +134,7 @@ class DependencyFileProcessor(object):
         if git_item.split('_')[0] == 'git':
             var_name = 'git'
         else:
-            var_name = git_item.split('_')[0]
+            var_name = git_item.split('_git_repo')[0]
 
         git_data['repo'] = loaded_yaml.get(git_item)
         git_data['branch'] = loaded_yaml.get(
@@ -164,7 +164,6 @@ class DependencyFileProcessor(object):
         """Process files.
 
         :type ext: ``tuple``
-        :type lower_priority: ``bol``
         """
         file_names = self._filter_files(
             file_names=self.file_names,
@@ -185,6 +184,7 @@ class DependencyFileProcessor(object):
                 if [i for i in BUILT_IN_PIP_PACKAGE_VARS if i in key]:
                     self.pip['py_package'].extend(values)
 
+
 def _abs_path(path):
     return os.path.abspath(
         os.path.expanduser(
@@ -192,6 +192,7 @@ def _abs_path(path):
         )
     )
 
+
 class LookupModule(object):
 
     def __init__(self, basedir=None, **kwargs):