Browse Source

AMBARI-3909. Upgrade local repo definitions when upgrading Ambari [part 2] (ncole)

Nate Cole 11 years ago
parent
commit
d0f91d5d4c
2 changed files with 13 additions and 1 deletions
  1. 6 0
      ambari-server/pom.xml
  2. 7 1
      ambari-server/src/main/python/ambari-server.py

+ 6 - 0
ambari-server/pom.xml

@@ -373,6 +373,12 @@
                 <source>
                   <location>src/main/resources/upgrade/dml/Ambari-DML-Oracle-UPGRADE_STACK.sql</location>
                 </source>
+                <source>
+                  <location>src/main/resources/upgrade/dml/Ambari-DML-Postgres-INSERT_METAINFO.sql</location>
+                </source>
+                <source>
+                  <location>src/main/resources/upgrade/dml/Ambari-DML-Oracle-INSERT_METAINFO.sql</location>
+                </source>
               </sources>
             </mapping>
             <mapping>

+ 7 - 1
ambari-server/src/main/python/ambari-server.py

@@ -2496,9 +2496,15 @@ def upgrade_local_repo(args):
     return
 
   for stack_version_local in os.listdir(stack_root_local):
-    repo_file_local = os.path.join(stack_root_local, stack_version_local, "repos", "repoinfo.xml")
+    repo_file_local = os.path.join(stack_root_local, stack_version_local, "repos", "repoinfo.xml.rpmsave")
+    if not os.path.exists(repo_file_local):
+      repo_file_local = os.path.join(stack_root_local, stack_version_local, "repos", "repoinfo.xml")
+
     repo_file = os.path.join(stack_root, stack_version_local, "repos", "repoinfo.xml")
 
+    print_info_msg("Local repo file: " + repo_file_local)
+    print_info_msg("Repo file: " + repo_file_local)
+
     if os.path.exists(repo_file_local) and os.path.exists(repo_file):
       local_values = load_stack_values(stack_version_local, repo_file_local)
       repo_values = load_stack_values(stack_version_local, repo_file)