Migrates master to use direct upstream
[apex.git] / apex / builders / common_builder.py
index 05a81ef..0cd683c 100644 (file)
@@ -25,7 +25,7 @@ from apex.virtual import utils as virt_utils
 
 def project_to_path(project):
     """
-    Translates project to absolute file path
+    Translates project to absolute file path to use in patching
     :param project: name of project
     :return: File path
     """
@@ -36,8 +36,12 @@ def project_to_path(project):
     elif 'tripleo-heat-templates' in project:
         return "/usr/share/openstack-tripleo-heat-templates"
     else:
-        # assume python
-        return "/usr/lib/python2.7/site-packages/{}".format(project)
+        # assume python.  python patches will apply to a project name subdir.
+        # For example, python-tripleoclient patch will apply to the
+        # tripleoclient directory, which is the directory extracted during
+        # python install into the PYTHONPATH.  Therefore we need to just be
+        # in the PYTHONPATH directory to apply a patch
+        return "/usr/lib/python2.7/site-packages/"
 
 
 def project_to_docker_image(project):
@@ -120,7 +124,7 @@ def add_upstream_patches(patches, image, tmp_dir,
                         "ADD {} {}".format(patch_file, project_path),
                         "RUN patch -p1 < {}".format(patch_file)
                     ]
-                    src_img_uri = "{}:8787/{}/centos-binary-{}:" \
+                    src_img_uri = "{}:8787/tripleo{}/centos-binary-{}:" \
                                   "{}".format(uc_ip, os_version, service,
                                               docker_tag)
                     oc_builder.build_dockerfile(service, tmp_dir, docker_cmds,