ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmitriu...@apache.org
Subject ambari git commit: AMBARI-11695. Ambari RU should not perform 'yum install krb5-server' on ALL nodes during installing packages (dlysnichenko)
Date Fri, 05 Jun 2015 09:05:21 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 13225f9de -> 46c15e852


AMBARI-11695. Ambari RU should not perform 'yum install krb5-server' on ALL nodes during installing packages (dlysnichenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/46c15e85
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/46c15e85
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/46c15e85

Branch: refs/heads/trunk
Commit: 46c15e852f5ca1b002423b8f6c3fcdf4d454c83a
Parents: 13225f9
Author: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Authored: Fri Jun 5 12:04:47 2015 +0300
Committer: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Committed: Fri Jun 5 12:04:47 2015 +0300

----------------------------------------------------------------------
 .../ClusterStackVersionResourceProvider.java    |   6 +-
 .../HostStackVersionResourceProvider.java       |   6 +-
 .../ambari/server/state/ServiceOsSpecific.java  |  30 ++++-
 .../AMBARI_METRICS/0.1.0/metainfo.xml           |   7 +
 .../common-services/HDFS/2.1.0.2.0/metainfo.xml |   4 +
 .../HIVE/0.12.0.2.0/metainfo.xml                |   4 +
 .../KERBEROS/1.10.3-10/metainfo.xml             |  10 ++
 .../OOZIE/5.0.0.2.3/metainfo.xml                |   1 +
 .../SQOOP/1.4.4.2.0/metainfo.xml                |   1 +
 .../custom_actions/scripts/install_packages.py  |  40 +-----
 .../BIGTOP/0.8/services/HDFS/metainfo.xml       |   4 +
 .../BIGTOP/0.8/services/HIVE/metainfo.xml       |   4 +
 .../BIGTOP/0.8/services/OOZIE/metainfo.xml      |   1 +
 .../2.0.6.GlusterFS/services/HIVE/metainfo.xml  |   4 +
 .../2.0.6.GlusterFS/services/OOZIE/metainfo.xml |   1 +
 .../2.1.GlusterFS/services/HIVE/metainfo.xml    |   4 +
 .../2.1.GlusterFS/services/OOZIE/metainfo.xml   |   1 +
 .../stacks/HDP/2.1/services/HIVE/metainfo.xml   |   4 +
 .../stacks/HDP/2.2/services/HDFS/metainfo.xml   |   4 +
 .../stacks/HDP/2.2/services/HIVE/metainfo.xml   |   4 +
 .../stacks/HDP/2.2/services/SQOOP/metainfo.xml  |   1 +
 .../2.3.GlusterFS/services/HDFS/metainfo.xml    |   3 +
 .../2.3.GlusterFS/services/HIVE/metainfo.xml    |   4 +
 .../2.3.GlusterFS/services/SQOOP/metainfo.xml   |   1 +
 .../stacks/HDP/2.3/services/HDFS/metainfo.xml   |   3 +
 .../stacks/HDP/2.3/services/HIVE/metainfo.xml   |   4 +
 .../stacks/HDP/2.3/services/SQOOP/metainfo.xml  |   1 +
 .../PHD/3.0.0.0/services/HDFS/metainfo.xml      |   4 +
 .../PHD/3.0.0.0/services/HIVE/metainfo.xml      |   4 +
 .../PHD/3.0.0.0/services/OOZIE/metainfo.xml     |   1 +
 ...ClusterStackVersionResourceProviderTest.java |  10 +-
 .../HostStackVersionResourceProviderTest.java   |  12 +-
 .../stack/StackManagerCommonServicesTest.java   |  10 +-
 .../custom_actions/TestInstallPackages.py       | 135 +------------------
 .../common-services/PIG/1.0/metainfo.xml        |   5 +
 35 files changed, 157 insertions(+), 181 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
index 6c8b733..03b98af 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
@@ -440,7 +440,11 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
       List<ServiceOsSpecific.Package> packagesForService = managementController.getPackagesForServiceHost(info,
               new HashMap<String, String>(), // Contents are ignored
               host.getOsFamily());
-      packages.addAll(packagesForService);
+      for (ServiceOsSpecific.Package aPackage : packagesForService) {
+        if (! aPackage.getSkipUpgrade()) {
+          packages.add(aPackage);
+        }
+      }
     }
     final String packageList = gson.toJson(packages);
     final String repoList = gson.toJson(repoInfo);

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
index 9e1c73a..a44be9a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
@@ -381,7 +381,11 @@ public class HostStackVersionResourceProvider extends AbstractControllerResource
       List<ServiceOsSpecific.Package> packagesForService = managementController.getPackagesForServiceHost(info,
               new HashMap<String, String>(), // Contents are ignored
               host.getOsFamily());
-      packages.addAll(packagesForService);
+      for (ServiceOsSpecific.Package aPackage : packagesForService) {
+        if (! aPackage.getSkipUpgrade()) {
+          packages.add(aPackage);
+        }
+      }
     }
     final String packageList = gson.toJson(packages);
     final String repoList = gson.toJson(repoInfo);

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceOsSpecific.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceOsSpecific.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceOsSpecific.java
index d81c182..47e244f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceOsSpecific.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceOsSpecific.java
@@ -166,6 +166,13 @@ public class ServiceOsSpecific {
   public static class Package {
     private String name;
 
+    /**
+     * If true, package will not be attempted to be upgraded during RU.
+     * Typically, packages that are located outside of HDP* repositories,
+     * should be marked as true
+     */
+    private Boolean skipUpgrade = Boolean.FALSE;
+
     public String getName() {
       return name;
     }
@@ -174,24 +181,35 @@ public class ServiceOsSpecific {
       this.name = name;
     }
 
-    public Package() { }
+    public Boolean getSkipUpgrade() {
+      return skipUpgrade;
+    }
+
+    public void setSkipUpgrade(Boolean skipUpgrade) {
+      this.skipUpgrade = skipUpgrade;
+    }
+
+    public Package() {
+    }
 
     @Override
     public boolean equals(Object o) {
       if (this == o) return true;
       if (o == null || getClass() != o.getClass()) return false;
 
-      Package that = (Package) o;
+      Package aPackage = (Package) o;
+
+      if (!name.equals(aPackage.name)) return false;
+      return skipUpgrade.equals(aPackage.skipUpgrade);
 
-      return name.equals(that.name);
     }
 
     @Override
     public int hashCode() {
-      return name.hashCode();
+      int result = name.hashCode();
+      result = 31 * result + skipUpgrade.hashCode();
+      return result;
     }
   }
-
-
 }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
index 039cf4d..66d3f52 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
@@ -70,12 +70,15 @@
           <packages>
             <package>
               <name>ambari-metrics-collector</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>ambari-metrics-monitor</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>ambari-metrics-hadoop-sink</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>gcc</name>
@@ -87,6 +90,7 @@
           <packages>
             <package>
               <name>ambari-metrics-assembly</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>gcc</name>
@@ -98,12 +102,15 @@
           <packages>
             <package>
               <name>ambari-metrics-collector</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>ambari-metrics-monitor</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>ambari-metrics-hadoop-sink</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml
index f1dd195..b3b7ea3 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml
@@ -164,6 +164,7 @@
             </package>
             <package>
               <name>hadoop-lzo</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -179,9 +180,11 @@
             </package>
             <package>
               <name>lzo</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>hadoop-lzo-native</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>hadoop-libhdfs</name>
@@ -203,6 +206,7 @@
             </package>
             <package>
               <name>liblzo2-2</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>hadoop-hdfs</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml
index 947f1cf..dc15741 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml
@@ -247,6 +247,7 @@
             </package>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -255,6 +256,7 @@
           <packages>
             <package>
               <name>mysql</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -263,6 +265,7 @@
           <packages>
             <package>
               <name>mysql-server</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -271,6 +274,7 @@
           <packages>
             <package>
               <name>mysql-client</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/metainfo.xml b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/metainfo.xml
index 49ef717..72f159a 100644
--- a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/metainfo.xml
@@ -77,12 +77,15 @@
           <packages>
             <package>
               <name>krb5-server</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>krb5-libs</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>krb5-workstation</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -92,15 +95,19 @@
           <packages>
             <package>
               <name>krb5-kdc</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>krb5-admin-server</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>krb5-user</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>krb5-config</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -110,12 +117,15 @@
           <packages>
             <package>
               <name>krb5</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>krb5-client</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>krb5-server</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/metainfo.xml b/ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/metainfo.xml
index a78c93a..5c16be9 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/metainfo.xml
@@ -117,6 +117,7 @@
             </package>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>extjs</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/metainfo.xml b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/metainfo.xml
index 9bf8d2a..0cf9c7d 100644
--- a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/metainfo.xml
@@ -71,6 +71,7 @@
             </package>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
index 67d146c..bbcc101 100644
--- a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
+++ b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
@@ -93,8 +93,7 @@ class InstallPackages(Script):
         allInstalledPackages(packages_installed_before)
         packages_installed_before = [package[0] for package in packages_installed_before]
         packages_were_checked = True
-        filtered_package_list = self.filter_package_list(package_list)
-        for package in filtered_package_list:
+        for package in package_list:
           name = self.format_package_name(package['name'], repository_version)
           Package(name, use_repos=list(current_repo_files) if OSCheck.is_ubuntu_family() else current_repositories)
         package_install_result = True
@@ -196,42 +195,5 @@ class InstallPackages(Script):
       return []
 
 
-  def filter_package_list(self, package_list):
-    """
-    Here we filter packages that are managed with custom logic in package
-    scripts. Usually this packages come from system repositories, and either
-     are not available when we restrict repository list, or should not be
-    installed on host at all.
-    :param package_list: original list
-    :return: filtered package_list
-    """
-    filtered_package_list = []
-
-    # hadoop-lzo package is installed only if LZO compression is enabled
-    lzo_packages = ['hadoop-lzo', 'lzo', 'hadoop-lzo-native', 'liblzo2-2', 'hadooplzo']
-    has_lzo = False
-    io_compression_codecs = default("/configurations/core-site/io.compression.codecs", None)
-    if io_compression_codecs:
-      has_lzo = "com.hadoop.compression.lzo" in io_compression_codecs.lower()
-
-    for package in package_list:
-      skip_package = False
-      # mysql* package logic is managed at HIVE scripts
-      if package['name'].startswith('mysql'):
-        skip_package = True
-      # Ambari metrics packages should not be upgraded during RU
-      if package['name'].startswith('ambari-metrics'):
-        skip_package = True
-
-      if not has_lzo:
-        for lzo_package in lzo_packages:
-          if package['name'].startswith(lzo_package):
-            skip_package = True
-            break
-
-      if not skip_package:
-        filtered_package_list.append(package)
-    return filtered_package_list
-
 if __name__ == "__main__":
   InstallPackages().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/metainfo.xml
index 90bb9f7..7733138 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/metainfo.xml
@@ -149,6 +149,7 @@
             </package>
             <package>
               <name>hadoop-lzo</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -164,9 +165,11 @@
             </package>
             <package>
               <name>lzo</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>hadoop-lzo-native</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>hadoop-libhdfs</name>
@@ -188,6 +191,7 @@
             </package>
             <package>
               <name>liblzo2-2</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>hadoop-hdfs</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HIVE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HIVE/metainfo.xml b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HIVE/metainfo.xml
index f8a84bf..2d8bd10 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HIVE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HIVE/metainfo.xml
@@ -223,6 +223,7 @@
             </package>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -231,6 +232,7 @@
           <packages>
             <package>
               <name>mysql</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -239,6 +241,7 @@
           <packages>
             <package>
               <name>mysql-server</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -247,6 +250,7 @@
           <packages>
             <package>
               <name>mysql-client</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/metainfo.xml b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/metainfo.xml
index 2d6f93f..e0e7a6c 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/metainfo.xml
@@ -117,6 +117,7 @@
             </package>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/HIVE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/HIVE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/HIVE/metainfo.xml
index f1bbb08..633f3a6 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/HIVE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/HIVE/metainfo.xml
@@ -59,6 +59,7 @@
             </package>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -67,6 +68,7 @@
           <packages>
             <package>
               <name>mysql</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -75,6 +77,7 @@
           <packages>
             <package>
               <name>mysql-server</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -83,6 +86,7 @@
           <packages>
             <package>
               <name>mysql-client</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/OOZIE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/OOZIE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/OOZIE/metainfo.xml
index 26d2789..27d4ba4 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/OOZIE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/OOZIE/metainfo.xml
@@ -42,6 +42,7 @@
             </package>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/HIVE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/HIVE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/HIVE/metainfo.xml
index 77cf405..7bad9fc 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/HIVE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/HIVE/metainfo.xml
@@ -59,6 +59,7 @@
             </package>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -67,6 +68,7 @@
           <packages>
             <package>
               <name>mysql</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -75,6 +77,7 @@
           <packages>
             <package>
               <name>mysql-server</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -83,6 +86,7 @@
           <packages>
             <package>
               <name>mysql-client</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/OOZIE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/OOZIE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/OOZIE/metainfo.xml
index 9216463..a62ef78 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/OOZIE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/OOZIE/metainfo.xml
@@ -42,6 +42,7 @@
             </package>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/metainfo.xml
index 9dbd65c..db5c0bc 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/metainfo.xml
@@ -57,6 +57,7 @@
             </package>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -65,6 +66,7 @@
           <packages>
             <package>
               <name>mysql</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -73,6 +75,7 @@
           <packages>
             <package>
               <name>mysql-server</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -81,6 +84,7 @@
           <packages>
             <package>
               <name>mysql-client</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
index ecd8ae8..b337263 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
@@ -38,9 +38,11 @@
             </package>
             <package>
               <name>lzo</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>hadooplzo_2_2_*</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>hadoop_2_2_*-libhdfs</name>
@@ -80,9 +82,11 @@
             </package>
             <package>
               <name>hadooplzo-2-2-.*</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>liblzo2-2</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>libhdfs0-2-2-.*</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/metainfo.xml
index 8eb5f28..ea41b9a 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/metainfo.xml
@@ -63,6 +63,7 @@
           <packages>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -80,6 +81,7 @@
             </package>
             <package>
               <name>mysql</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -102,6 +104,7 @@
           <packages>
             <package>
               <name>mysql-server</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -110,6 +113,7 @@
           <packages>
             <package>
               <name>mysql-client</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/HDP/2.2/services/SQOOP/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SQOOP/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SQOOP/metainfo.xml
index f264c4f..e7ff122 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SQOOP/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SQOOP/metainfo.xml
@@ -27,6 +27,7 @@
           <packages>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/HDFS/metainfo.xml
index b7f88be..107a3d6 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/HDFS/metainfo.xml
@@ -37,9 +37,11 @@
             </package>
             <package>
               <name>lzo</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>hadooplzo_2_3_*</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>hadoop_2_3_*-libhdfs</name>
@@ -79,6 +81,7 @@
             </package>
             <package>
               <name>hadooplzo-2-3-.*</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>libhdfs0-2-3-.*</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/HIVE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/HIVE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/HIVE/metainfo.xml
index eb4dd3c..0e12f09 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/HIVE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/HIVE/metainfo.xml
@@ -28,6 +28,7 @@
           <packages>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -45,6 +46,7 @@
             </package>
             <package>
               <name>mysql</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -67,6 +69,7 @@
           <packages>
             <package>
               <name>mysql-server</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -75,6 +78,7 @@
           <packages>
             <package>
               <name>mysql-client</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/SQOOP/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/SQOOP/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/SQOOP/metainfo.xml
index f443b85..5238914 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/SQOOP/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.GlusterFS/services/SQOOP/metainfo.xml
@@ -27,6 +27,7 @@
           <packages>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/metainfo.xml
index ecf98b4..6f8abc8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/metainfo.xml
@@ -70,9 +70,11 @@
             </package>
             <package>
               <name>lzo</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>hadooplzo_2_3_*</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>hadoop_2_3_*-libhdfs</name>
@@ -112,6 +114,7 @@
             </package>
             <package>
               <name>hadooplzo-2-3-.*</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>libhdfs0-2-3-.*</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/metainfo.xml
index 25dd403..ab6a57d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/metainfo.xml
@@ -28,6 +28,7 @@
           <packages>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>atlas-metadata*-hive-plugin</name>
@@ -48,6 +49,7 @@
             </package>
             <package>
               <name>mysql</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -70,6 +72,7 @@
           <packages>
             <package>
               <name>mysql-server</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -78,6 +81,7 @@
           <packages>
             <package>
               <name>mysql-client</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/HDP/2.3/services/SQOOP/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/SQOOP/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/SQOOP/metainfo.xml
index 66d74f9..1290cde 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/SQOOP/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/SQOOP/metainfo.xml
@@ -27,6 +27,7 @@
           <packages>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HDFS/metainfo.xml
index fdf8011..5ed7076 100644
--- a/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HDFS/metainfo.xml
@@ -149,6 +149,7 @@
             </package>
             <package>
               <name>hadoop-lzo</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -164,9 +165,11 @@
             </package>
             <package>
               <name>lzo</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>hadoop-lzo-native</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>hadoop-libhdfs</name>
@@ -188,6 +191,7 @@
             </package>
             <package>
               <name>liblzo2-2</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
             <package>
               <name>hadoop-hdfs</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HIVE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HIVE/metainfo.xml b/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HIVE/metainfo.xml
index bd32617..12f359a 100644
--- a/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HIVE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HIVE/metainfo.xml
@@ -223,6 +223,7 @@
             </package>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -231,6 +232,7 @@
           <packages>
             <package>
               <name>mysql</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -239,6 +241,7 @@
           <packages>
             <package>
               <name>mysql-server</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>
@@ -247,6 +250,7 @@
           <packages>
             <package>
               <name>mysql-client</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/OOZIE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/OOZIE/metainfo.xml b/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/OOZIE/metainfo.xml
index 7239383..0f388f6 100644
--- a/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/OOZIE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/OOZIE/metainfo.xml
@@ -117,6 +117,7 @@
             </package>
             <package>
               <name>mysql-connector-java</name>
+              <skipUpgrade>true</skipUpgrade>
             </package>
           </packages>
         </osSpecific>

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java
index 7ff7c7f..db3eca7 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java
@@ -341,9 +341,15 @@ public class ClusterStackVersionResourceProviderTest {
     RepositoryVersionEntity repoVersion = new RepositoryVersionEntity();
     repoVersion.setOperatingSystems(operatingSystemsJson);
 
-    ServiceOsSpecific.Package hivePackage = new ServiceOsSpecific.Package();
+    final ServiceOsSpecific.Package hivePackage = new ServiceOsSpecific.Package();
     hivePackage.setName("hive");
-    List<ServiceOsSpecific.Package> packages = Collections.singletonList(hivePackage);
+    final ServiceOsSpecific.Package mysqlPackage = new ServiceOsSpecific.Package();
+    mysqlPackage.setName("mysql");
+    mysqlPackage.setSkipUpgrade(Boolean.TRUE);
+    List<ServiceOsSpecific.Package> packages = new ArrayList<ServiceOsSpecific.Package>() {{
+      add(hivePackage);
+      add(mysqlPackage);
+    }};
 
     ActionManager actionManager = createNiceMock(ActionManager.class);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProviderTest.java
index d1e7297..7b20600 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProviderTest.java
@@ -27,6 +27,7 @@ import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.replay;
 import static org.easymock.EasyMock.verify;
 
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
@@ -146,9 +147,16 @@ public class HostStackVersionResourceProviderTest {
     RepositoryVersionEntity repoVersion = new RepositoryVersionEntity();
     repoVersion.setOperatingSystems(operatingSystemsJson);
 
-    ServiceOsSpecific.Package hivePackage = new ServiceOsSpecific.Package();
+    final ServiceOsSpecific.Package hivePackage = new ServiceOsSpecific.Package();
     hivePackage.setName("hive");
-    List<ServiceOsSpecific.Package> packages = Collections.singletonList(hivePackage);
+    final ServiceOsSpecific.Package mysqlPackage = new ServiceOsSpecific.Package();
+    mysqlPackage.setName("mysql");
+    mysqlPackage.setSkipUpgrade(Boolean.TRUE);
+    List<ServiceOsSpecific.Package> packages = new ArrayList<ServiceOsSpecific.Package>() {{
+      add(hivePackage);
+      add(mysqlPackage);
+    }};
+
 
     ActionManager actionManager = createNiceMock(ActionManager.class);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerCommonServicesTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerCommonServicesTest.java b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerCommonServicesTest.java
index 3aa7b72..6f3cf78 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerCommonServicesTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerCommonServicesTest.java
@@ -22,6 +22,7 @@ import static org.easymock.EasyMock.createNiceMock;
 import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.replay;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
@@ -172,7 +173,7 @@ public class StackManagerCommonServicesTest {
     assertEquals(1, configDependencies.size());
     assertEquals("global", configDependencies.get(0));
     assertEquals("global",
-        pigService.getConfigDependenciesWithComponents().get(0));
+            pigService.getConfigDependenciesWithComponents().get(0));
     ComponentInfo client = pigService.getClientComponent();
     assertNotNull(client);
     assertEquals("PIG", client.getName());
@@ -187,9 +188,14 @@ public class StackManagerCommonServicesTest {
     assertEquals("centos6", osSpecific.getOsFamily());
     assertNull(osSpecific.getRepo());
     List<ServiceOsSpecific.Package> packages = osSpecific.getPackages();
-    assertEquals(1, packages.size());
+    assertEquals(2, packages.size());
     ServiceOsSpecific.Package pkg = packages.get(0);
     assertEquals("pig", pkg.getName());
+    assertFalse(pkg.getSkipUpgrade());
+
+    ServiceOsSpecific.Package lzoPackage = packages.get(1);
+    assertEquals("lzo", lzoPackage.getName());
+    assertTrue(lzoPackage.getSkipUpgrade());
 
     assertEquals(pigService.getParent(), "common-services/PIG/1.0");
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/custom_actions/TestInstallPackages.py b/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
index c0c547a..3b3d0dc 100644
--- a/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
+++ b/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
@@ -83,6 +83,8 @@ class TestInstallPackages(RMFTestCase):
     self.assertResourceCalled('Package', 'hadoop_2_2_*', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
     self.assertResourceCalled('Package', 'snappy', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
     self.assertResourceCalled('Package', 'snappy-devel', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'lzo', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'hadooplzo_2_2_*', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
     self.assertResourceCalled('Package', 'hadoop_2_2_*-libhdfs', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
     self.assertResourceCalled('Package', 'ambari-log4j', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
     self.assertNoMoreResources()
@@ -131,6 +133,8 @@ class TestInstallPackages(RMFTestCase):
     self.assertResourceCalled('Package', 'hadoop_2_2_*', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
     self.assertResourceCalled('Package', 'snappy', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
     self.assertResourceCalled('Package', 'snappy-devel', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'lzo', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'hadooplzo_2_2_*', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
     self.assertResourceCalled('Package', 'hadoop_2_2_*-libhdfs', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
     self.assertResourceCalled('Package', 'ambari-log4j', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
     self.assertNoMoreResources()
@@ -246,133 +250,8 @@ class TestInstallPackages(RMFTestCase):
     self.assertResourceCalled('Package', 'hadoop_2_2_0_1_885*', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
     self.assertResourceCalled('Package', 'snappy', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
     self.assertResourceCalled('Package', 'snappy-devel', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'lzo', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+    self.assertResourceCalled('Package', 'hadooplzo_2_2_0_1_885*', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
     self.assertResourceCalled('Package', 'hadoop_2_2_0_1_885*-libhdfs', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
     self.assertResourceCalled('Package', 'ambari-log4j', use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-    self.assertNoMoreResources()
-
-
-  @patch("ambari_commons.os_check.OSCheck.is_suse_family")
-  @patch("resource_management.core.resources.packaging.Package")
-  @patch("resource_management.libraries.script.Script.put_structured_out")
-  @patch("resource_management.libraries.functions.packages_analyzer.allInstalledPackages")
-  def test_exclude_packages(self,allInstalledPackages_mock, put_structured_out_mock,
-                               package_mock, is_suse_family_mock):
-    allInstalledPackages_mock = MagicMock(side_effect = TestInstallPackages._add_packages)
-    is_suse_family_mock.return_value = True
-
-    config_file = self.get_src_folder()+"/test/python/custom_actions/configs/install_packages_config.json"
-    with open(config_file, "r") as f:
-      config_dict = json.load(f)
-
-    config_dict['roleParams']['package_list'] = '[{\"name\":\"mysql-connector-java\"},{\"name\":\"hive_2_2_*\"},' \
-                                                     '{\"name\":\"hive_2_2_*-hcatalog\"},{\"name\":\"hive_2_2_*-webhcat\"},' \
-                                                     '{\"name\":\"mysql\"},{\"name\":\"mysql-client\"}, {\"name\":\"ambari-metrics-collector\"},' \
-                                                     ' {\"name\":\"hadooplzo_2_2_2_0_2538-native\"}]'
-
-    self.executeScript("scripts/install_packages.py",
-                       classname="InstallPackages",
-                       command="actionexecute",
-                       config_dict=config_dict,
-                       target=RMFTestCase.TARGET_CUSTOM_ACTIONS,
-                       os_type=('Suse', '11', 'Final'),
-                       )
-    self.assertTrue(put_structured_out_mock.called)
-    self.assertEquals(put_structured_out_mock.call_args[0][0],
-                      {'package_installation_result': 'SUCCESS',
-                       'installed_repository_version': u'2.2.0.1-885',
-                       'stack_id': 'HDP-2.2',
-                       'ambari_repositories': []})
-    self.assertResourceCalled('Repository', 'HDP-UTILS-2.2.0.1-885',
-                              base_url=u'http://repo1/HDP/centos5/2.x/updates/2.2.0.0',
-                              action=['create'],
-                              components=[u'HDP-UTILS', 'main'],
-                              repo_template='repo_suse_rhel.j2',
-                              repo_file_name=u'HDP-2.2.0.1-885',
-                              mirror_list=None,
-                              append_to_file=False,
-                              )
-    self.assertResourceCalled('Repository', 'HDP-2.2.0.1-885',
-                              base_url=u'http://repo1/HDP/centos5/2.x/updates/2.2.0.0',
-                              action=['create'],
-                              components=[u'HDP', 'main'],
-                              repo_template='repo_suse_rhel.j2',
-                              repo_file_name=u'HDP-2.2.0.1-885',
-                              mirror_list=None,
-                              append_to_file=True,
-                              )
-    self.assertResourceCalled('Package', 'hive_2_2_0_1_885*',
-                              use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
-                                         'HDP-2.2.0.1-885'],
-    )
-    self.assertResourceCalled('Package', 'hive_2_2_0_1_885*-hcatalog',
-                              use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
-                                         'HDP-2.2.0.1-885'],
-    )
-    self.assertResourceCalled('Package', 'hive_2_2_0_1_885*-webhcat',
-                              use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
-                                         'HDP-2.2.0.1-885'],
-    )
-    self.assertNoMoreResources()
-
-    # Check case when LZO is enabled
-    config_file = self.get_src_folder()+"/test/python/custom_actions/configs/install_packages_config.json"
-    with open(config_file, "r") as f:
-      config_dict = json.load(f)
-    config_dict['configurations']['core-site'] = {
-      'io.compression.codecs': "org.apache.hadoop.io.compress.GzipCodec,org.apache.hadoop.io.compress.DefaultCodec,"
-                               "org.apache.hadoop.io.compress.SnappyCodec,com.hadoop.compression.lzo"
-    }
-    config_dict['roleParams']['package_list'] = '[{\"name\":\"mysql-connector-java\"},{\"name\":\"hive_2_2_*\"},' \
-                                                '{\"name\":\"hive_2_2_*-hcatalog\"},{\"name\":\"hive_2_2_*-webhcat\"},' \
-                                                '{\"name\":\"mysql\"},{\"name\":\"mysql-client\"}, {\"name\":\"ambari-metrics-collector\"},' \
-                                                ' {\"name\":\"hadooplzo_2_2_2_0_2538-native\"}]'
-
-    self.executeScript("scripts/install_packages.py",
-                       classname="InstallPackages",
-                       command="actionexecute",
-                       config_dict=config_dict,
-                       target=RMFTestCase.TARGET_CUSTOM_ACTIONS,
-                       os_type=('Suse', '11', 'Final'),
-                       )
-    self.assertTrue(put_structured_out_mock.called)
-    self.assertEquals(put_structured_out_mock.call_args[0][0],
-                      {'package_installation_result': 'SUCCESS',
-                       'installed_repository_version': u'2.2.0.1-885',
-                       'stack_id': 'HDP-2.2',
-                       'ambari_repositories': []})
-    self.assertResourceCalled('Repository', 'HDP-UTILS-2.2.0.1-885',
-                              base_url=u'http://repo1/HDP/centos5/2.x/updates/2.2.0.0',
-                              action=['create'],
-                              components=[u'HDP-UTILS', 'main'],
-                              repo_template='repo_suse_rhel.j2',
-                              repo_file_name=u'HDP-2.2.0.1-885',
-                              mirror_list=None,
-                              append_to_file=False,
-                              )
-    self.assertResourceCalled('Repository', 'HDP-2.2.0.1-885',
-                              base_url=u'http://repo1/HDP/centos5/2.x/updates/2.2.0.0',
-                              action=['create'],
-                              components=[u'HDP', 'main'],
-                              repo_template='repo_suse_rhel.j2',
-                              repo_file_name=u'HDP-2.2.0.1-885',
-                              mirror_list=None,
-                              append_to_file=True,
-                              )
-    self.assertResourceCalled('Package', 'hive_2_2_0_1_885*',
-                              use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
-                                         'HDP-2.2.0.1-885'],
-                              )
-    self.assertResourceCalled('Package', 'hive_2_2_0_1_885*-hcatalog',
-                              use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
-                                         'HDP-2.2.0.1-885'],
-                              )
-    self.assertResourceCalled('Package', 'hive_2_2_0_1_885*-webhcat',
-                              use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
-                                         'HDP-2.2.0.1-885'],
-                              )
-    self.assertResourceCalled('Package', 'hadooplzo_2_2_2_0_2538-native',
-                              use_repos=['rhui*', 'base', 'HDP-UTILS-2.2.0.1-885',
-                                         'HDP-2.2.0.1-885'],
-                              )
-    self.assertNoMoreResources()
-
+    self.assertNoMoreResources()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/46c15e85/ambari-server/src/test/resources/common-services/PIG/1.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/common-services/PIG/1.0/metainfo.xml b/ambari-server/src/test/resources/common-services/PIG/1.0/metainfo.xml
index 6ca5435..74d310f 100644
--- a/ambari-server/src/test/resources/common-services/PIG/1.0/metainfo.xml
+++ b/ambari-server/src/test/resources/common-services/PIG/1.0/metainfo.xml
@@ -42,6 +42,11 @@
             <package>
               <name>pig</name>
             </package>
+
+            <package>
+              <name>lzo</name>
+              <skipUpgrade>true</skipUpgrade>
+            </package>
           </packages>
         </osSpecific>
       </osSpecifics>


Mime
View raw message