You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by xi...@apache.org on 2014/05/23 01:05:06 UTC

git commit: AMBARI-5851. Host Checks: Repository Issue should not exist due to repo OS name changes.(xiwang)

Repository: ambari
Updated Branches:
  refs/heads/trunk 42b08d22a -> e924455a2


AMBARI-5851. Host Checks: Repository Issue should not exist due to repo OS name changes.(xiwang)


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

Branch: refs/heads/trunk
Commit: e924455a218853ac3c8168a3b369656a08ba7817
Parents: 42b08d2
Author: Xi Wang <xi...@apache.org>
Authored: Wed May 21 18:09:38 2014 -0700
Committer: Xi Wang <xi...@apache.org>
Committed: Thu May 22 16:04:12 2014 -0700

----------------------------------------------------------------------
 .../app/controllers/wizard/step3_controller.js  | 27 +++++++++++++++++---
 ambari-web/app/messages.js                      |  2 +-
 2 files changed, 24 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e924455a/ambari-web/app/controllers/wizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js
index 819f562..61526be 100644
--- a/ambari-web/app/controllers/wizard/step3_controller.js
+++ b/ambari-web/app/controllers/wizard/step3_controller.js
@@ -818,22 +818,22 @@ App.WizardStep3Controller = Em.Controller.extend({
     if (this.get('content.stacks')) {
       var selectedStack = this.get('content.stacks').findProperty('isSelected', true);
       var selectedOS = [];
+      var self = this;
       var isValid = false;
       if (selectedStack && selectedStack.operatingSystems) {
         selectedStack.get('operatingSystems').filterProperty('selected', true).forEach(function (os) {
           selectedOS.pushObject(os.osType);
-          if (os.osType == osType) {
+          if (self.repoToAgentOsType(os.osType).indexOf(osType) >= 0) {
             isValid = true;
           }
         });
       }
-
       if (isValid) {
         return '';
       } else {
         console.log('WARNING: Getting host os type does NOT match the user selected os group in step1. ' +
-          'Host Name: ' + hostName + '. Host os type:' + osType + '. Selected group:' + selectedOS);
-        return Em.I18n.t('installer.step3.hostWarningsPopup.repositories.context').format(hostName, osType, selectedOS);
+          'Host Name: ' + hostName + '. Host os type:' + osType + '. Selected group:' + selectedOS.uniq());
+        return Em.I18n.t('installer.step3.hostWarningsPopup.repositories.context').format(hostName, osType, selectedOS.uniq());
       }
     } else {
       return '';
@@ -841,6 +841,25 @@ App.WizardStep3Controller = Em.Controller.extend({
   },
 
   /**
+   * return the supported agent os types for a repo os type
+   * @param {string} repoType
+   * @return {array} supported agent os type array
+   * @method repoToAgentOsType
+   */
+  repoToAgentOsType : function (repoType) {
+    switch (repoType) {
+      case "redhat6":
+        return ["redhat6", "centos6", "oraclelinux6", "rhel6"];
+      case "redhat5":
+        return ["redhat5", "centos5", "oraclelinux5", "rhel5"];
+      case "suse11":
+        return ["suse11", "sles11", "opensuse11"];
+      case "debian12":
+        return ["debian12", "ubuntu12"];
+    }
+  },
+
+  /**
    * Check if current host has enough free disk usage.
    * @param {string} hostName
    * @param {object} diskInfo

http://git-wip-us.apache.org/repos/asf/ambari/blob/e924455a/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index c3794a2..33e8c9f 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -468,7 +468,7 @@ Em.I18n.translations = {
   'installer.step3.hostWarningsPopup.summary':'{0} on {1}',
   'installer.step3.hostWarningsPopup.repositories':'Repository Issues',
   'installer.step3.hostWarningsPopup.repositories.name':'Repository for OS not available',
-  'installer.step3.hostWarningsPopup.repositories.context':'Host ({0}) has a {1} OS type, But the repositories chosen in "Select Stack" step was {2}.',
+  'installer.step3.hostWarningsPopup.repositories.context':'Host ({0}) is {1} OS type, but the repositories chosen in "Select Stack" step was {2}. Selected repositories dont support such host OS type.',
   'installer.step3.hostWarningsPopup.repositories.message': 'The following registered hosts have different Operating System types from the available Repositories chosen in "Select Stack" step. You can go back to "Select Stack" step to select another OS repository <b>or</b> remove the host.',
   'installer.step3.hostWarningsPopup.disk':'Disk Issues',
   'installer.step3.hostWarningsPopup.disk.name':'Not enough disk space ',