You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jg...@apache.org on 2018/05/17 16:08:32 UTC

[ambari] branch branch-feature-AMBARI-14714 updated (fbdfeb6 -> b8fef94)

This is an automated email from the ASF dual-hosted git repository.

jgolieb pushed a change to branch branch-feature-AMBARI-14714
in repository https://gitbox.apache.org/repos/asf/ambari.git.


    from fbdfeb6  AMBARI-23746. Distinguish componentId and hostComponentId (#1288)
     new 3e07779  Remove unused code.
     new b8fef94  Fix constant declaration.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../app/controllers/wizard/step8_controller.js     |  83 --------
 ambari-web/app/utils/ajax/ajax.js                  |  13 --
 ambari-web/app/utils/constants.js                  |  18 +-
 ambari-web/test/controllers/wizard/step8_test.js   | 216 ---------------------
 4 files changed, 10 insertions(+), 320 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
jgolieb@apache.org.

[ambari] 01/02: Remove unused code.

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgolieb pushed a commit to branch branch-feature-AMBARI-14714
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit 3e07779c6959e29fbef23a67a453009a39f79663
Author: Jason Golieb <jg...@hortonworks.com>
AuthorDate: Wed May 16 11:10:24 2018 -0700

    Remove unused code.
---
 .../app/controllers/wizard/step8_controller.js     |  83 --------
 ambari-web/app/utils/ajax/ajax.js                  |  13 --
 ambari-web/test/controllers/wizard/step8_test.js   | 216 ---------------------
 3 files changed, 312 deletions(-)

diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 0ba11c9..80a352c 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -365,47 +365,6 @@ App.WizardStep8Controller = App.WizardStepController.extend(App.AddSecurityConfi
   },
 
   /**
-   * Load repo info for add Service/Host wizard review page
-   * @return {$.ajax|null}
-   * @method loadRepoInfo
-   */
-  loadRepoInfo: function () {
-    var stackName = App.get('currentStackName');
-    var currentStackVersionNumber = App.get('currentStackVersionNumber');
-    var currentStackVersion = App.StackVersion.find().filterProperty('stack', stackName).findProperty('version', currentStackVersionNumber);
-    var currentRepoVersion = currentStackVersion.get('repositoryVersion.repositoryVersion');
-
-    return App.ajax.send({
-      name: 'cluster.load_repo_version',
-      sender: this,
-      data: {
-        stackName: stackName,
-        repositoryVersion: currentRepoVersion
-      },
-      success: 'loadRepoInfoSuccessCallback',
-      error: 'loadRepoInfoErrorCallback'
-    });
-  },
-
-  /**
-   * Save all repo base URL of all OS type to <code>repoInfo<code>
-   * @param {object} data
-   * @method loadRepoInfoSuccessCallback
-   */
-  loadRepoInfoSuccessCallback: function (data) {
-    Em.assert('Current repo-version may be only one', data.items.length === 1);
-    if (data.items.length) {
-      var allRepos = this.generateRepoInfo(Em.getWithDefault(data, 'items.0.repository_versions.0.operating_systems', []));
-      allRepos.set('display_name', Em.I18n.t("installer.step8.repoInfo.displayName"));
-      this.get('clusterInfo').set('repoInfo', allRepos);
-      //if the property is missing, set as false
-      this.get('clusterInfo').set('useRedhatSatellite', data.items[0].repository_versions[0].operating_systems[0].OperatingSystems.ambari_managed_repositories === false);
-    } else {
-      this.loadDefaultRepoInfo();
-    }
-  },
-
-  /**
    * Generate list regarding info about OS versions and repositories.
    *
    * @param {Object{}} oses - OS array
@@ -424,48 +383,6 @@ App.WizardStep8Controller = App.WizardStepController.extend(App.AddSecurityConfi
   },
 
   /**
-   * Load repo info from stack. Used if installed stack doesn't have upgrade info.
-   *
-   * @returns {$.Deferred}
-   * @method loadDefaultRepoInfo
-   */
-  loadDefaultRepoInfo: function() {
-    var nameVersionCombo = App.get('currentStackVersion').split('-');
-
-    return App.ajax.send({
-      name: 'cluster.load_repositories',
-      sender: this,
-      data: {
-        stackName: nameVersionCombo[0],
-        stackVersion: nameVersionCombo[1]
-      },
-      success: 'loadDefaultRepoInfoSuccessCallback',
-      error: 'loadRepoInfoErrorCallback'
-    });
-  },
-
-  /**
-   * @param {Object} data - JSON data from server
-   * @method loadDefaultRepoInfoSuccessCallback
-   */
-  loadDefaultRepoInfoSuccessCallback: function (data) {
-    var allRepos = this.generateRepoInfo(Em.getWithDefault(data, 'items', []));
-    allRepos.set('display_name', Em.I18n.t("installer.step8.repoInfo.displayName"));
-    this.get('clusterInfo').set('repoInfo', allRepos);
-    //if the property is missing, set as false
-    this.get('clusterInfo').set('useRedhatSatellite', data.items[0].OperatingSystems.ambari_managed_repositories === false);
-  },
-
-  /**
-   * @method loadRepoInfoErrorCallback
-   */
-  loadRepoInfoErrorCallback: function () {
-    var allRepos = [];
-    allRepos.set('display_name', Em.I18n.t("installer.step8.repoInfo.displayName"));
-    this.get('clusterInfo').set('repoInfo', allRepos);
-  },
-
-  /**
    * Load all info about services to <code>services</code> variable
    * @method loadServices
    */
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index d288030..9223787 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -1418,19 +1418,6 @@ var urls = {
       };
     }
   },
-  'cluster.load_repositories': {
-    'real': '/stacks/{stackName}/versions/{stackVersion}/operating_systems?fields=repositories/*,OperatingSystems/*',
-    'mock': '/data/stacks/HDP-2.1/operating_systems.json',
-    'format': function (data) {
-      return {
-        data: data.data
-      };
-    }
-  },
-  'cluster.load_repo_version': {
-    'real': '/stacks/{stackName}/versions?fields=repository_versions/operating_systems/repositories/*,repository_versions/operating_systems/OperatingSystems/*,repository_versions/RepositoryVersions/display_name&repository_versions/RepositoryVersions/repository_version={repositoryVersion}',
-    'mock': ''
-  },
   'cluster.load_current_repo_stack_services': {
     'real': '/clusters/{clusterName}/stack_versions?fields=repository_versions/RepositoryVersions/stack_services,ClusterStackVersions/stack,ClusterStackVersions/version',
     'mock': '/data/stack_versions/stack_version_all.json'
diff --git a/ambari-web/test/controllers/wizard/step8_test.js b/ambari-web/test/controllers/wizard/step8_test.js
index 1d2f9e1..9aa63d0 100644
--- a/ambari-web/test/controllers/wizard/step8_test.js
+++ b/ambari-web/test/controllers/wizard/step8_test.js
@@ -655,222 +655,6 @@ describe('App.WizardStep8Controller', function () {
       });
   });
 
-  describe('#loadRepoInfo', function() {
-
-    beforeEach(function () {
-      var stubForGet = sinon.stub(App, 'get');
-      stubForGet.withArgs('currentStackName').returns('HDP');
-      stubForGet.withArgs('currentStackVersionNumber').returns('2.3');
-      sinon.stub(App.StackVersion, 'find', function() {
-        return [
-          Em.Object.create({state: 'NOT_CURRENT', stack: 'HDP', version: '2.3', repositoryVersion: {repositoryVersion: '2.3.0.0-2208'}})
-        ];
-      });
-    });
-
-    afterEach(function () {
-      App.get.restore();
-      App.StackVersion.find.restore();
-    });
-    it('should use current StackVersion', function() {
-      installerStep8Controller.loadRepoInfo();
-      var args = testHelpers.findAjaxRequest('name', 'cluster.load_repo_version');
-      expect(args[0].data).to.eql({stackName: 'HDP', repositoryVersion: '2.3.0.0-2208'});
-    });
-  });
-
-  describe('#loadRepoInfoSuccessCallback', function () {
-    beforeEach(function () {
-      installerStep8Controller.set('clusterInfo', Em.Object.create({}));
-    });
-
-    it('should assert error if no data returned from server', function () {
-      expect(function () {
-        installerStep8Controller.loadRepoInfoSuccessCallback({items: []});
-      }).to.throw(Error);
-    });
-
-    Em.A([
-      {
-        m: 'Normal JSON',
-        e: {
-          base_url: ['baseurl1', 'baseurl2'],
-          os_type: ['redhat6', 'suse11'],
-          repo_id: ['HDP-2.3', 'HDP-UTILS-1.1.0.20']
-        },
-        items: [
-          {
-            repository_versions: [
-              {
-                operating_systems: [
-                  {
-                    OperatingSystems: {
-                      ambari_managed_repositories: true
-                    },
-                    repositories: [
-                      {
-                        Repositories: {
-                          base_url: 'baseurl1',
-                          os_type: 'redhat6',
-                          repo_id: 'HDP-2.3'
-                        }
-                      }
-                    ]
-                  },
-                  {
-                    OperatingSystems: {
-                      ambari_managed_repositories: true
-                    },
-                    repositories: [
-                      {
-                        Repositories: {
-                          base_url: 'baseurl2',
-                          os_type: 'suse11',
-                          repo_id: 'HDP-UTILS-1.1.0.20'
-                        }
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ]
-      }
-    ]).forEach(function (test) {
-
-      it(test.m, function () {
-        installerStep8Controller.loadRepoInfoSuccessCallback({items: test.items});
-        expect(installerStep8Controller.get('clusterInfo.repoInfo').mapProperty('base_url')).to.eql(test.e.base_url);
-        expect(installerStep8Controller.get('clusterInfo.repoInfo').mapProperty('os_type')).to.eql(test.e.os_type);
-        expect(installerStep8Controller.get('clusterInfo.repoInfo').mapProperty('repo_id')).to.eql(test.e.repo_id);
-      });
-
-    });
-
-    /*Em.A([
-        {
-          items: [
-            {
-              repositories: [
-                {
-                  Repositories: {
-                    os_type: 'redhat5',
-                    base_url: 'url1'
-                  }
-                }
-              ],
-              OperatingSystems: {
-                is_type: ''
-              }
-            }
-          ],
-          m: 'only redhat5',
-          e: {
-            base_url: ['url1'],
-            os_type: ['redhat5']
-          }
-        },
-        {
-          items: [
-            {
-              repositories: [
-                {
-                  Repositories: {
-                    os_type: 'redhat5',
-                    base_url: 'url1'
-                  }
-                }
-              ],
-              OperatingSystems: {
-                is_type: ''
-              }
-            },
-            {
-              repositories: [
-                {
-                  Repositories: {
-                    os_type: 'redhat6',
-                    base_url: 'url2'
-                  }
-                }
-              ],
-              OperatingSystems: {
-                is_type: ''
-              }
-            }
-          ],
-          m: 'redhat5, redhat6',
-          e: {
-            base_url: ['url1', 'url2'],
-            os_type: ['redhat5', 'redhat6']
-          }
-        },
-        {
-          items: [
-            {
-              repositories: [
-                {
-                  Repositories: {
-                    os_type: 'redhat5',
-                    base_url: 'url1'
-                  }
-                }
-              ],
-              OperatingSystems: {
-                is_type: ''
-              }
-            },
-            {
-              repositories: [
-                {
-                  Repositories: {
-                    os_type: 'redhat6',
-                    base_url: 'url2'
-                  }
-                }
-              ],
-              OperatingSystems: {
-                is_type: ''
-              }
-            },
-            {
-              repositories: [
-                {
-                  Repositories: {
-                    os_type: 'sles11',
-                    base_url: 'url3'
-                  }
-                }
-              ],
-              OperatingSystems: {
-                is_type: ''
-              }
-            }
-          ],
-          m: 'redhat5, redhat6, sles11',
-          e: {
-            base_url: ['url1', 'url2', 'url3'],
-            os_type: ['redhat5', 'redhat6', 'sles11']
-          }
-        }
-      ]).forEach(function (test) {
-        it(test.m, function () {
-          installerStep8Controller.loadRepoInfoSuccessCallback({items: test.items});
-          expect(installerStep8Controller.get('clusterInfo.repoInfo').mapProperty('base_url')).to.eql(test.e.base_url);
-          expect(installerStep8Controller.get('clusterInfo.repoInfo').mapProperty('os_type')).to.eql(test.e.os_type);
-        });
-      });*/
-  });
-
-  describe('#loadRepoInfoErrorCallback', function() {
-    it('should set [] to repoInfo', function() {
-      installerStep8Controller.set('clusterInfo', Em.Object.create({repoInfo: [{}, {}]}));
-      installerStep8Controller.loadRepoInfoErrorCallback({});
-      expect(installerStep8Controller.get('clusterInfo.repoInfo.length')).to.be.equal(0);
-    });
-  });
-
   describe('#loadHbaseMasterValue', function () {
     Em.A([
         {

-- 
To stop receiving notification emails like this one, please contact
jgolieb@apache.org.

[ambari] 02/02: Fix constant declaration.

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgolieb pushed a commit to branch branch-feature-AMBARI-14714
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit b8fef94c6abf9ebc0df34cf3e3e08760442fb7f4
Author: Jason Golieb <jg...@hortonworks.com>
AuthorDate: Wed May 16 16:34:54 2018 -0700

    Fix constant declaration.
---
 ambari-web/app/utils/constants.js | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/ambari-web/app/utils/constants.js b/ambari-web/app/utils/constants.js
index 0695d3e..06defe9 100644
--- a/ambari-web/app/utils/constants.js
+++ b/ambari-web/app/utils/constants.js
@@ -28,11 +28,13 @@ App.False = false;
 App.True = true;
 
 //upgrade process states
-App.UpgradeState.NotRequired = 'NOT_REQUIRED';
-App.UpgradeState.Pending = 'PENDING';
-App.UpgradeState.InProgress = 'IN_PROGRESS';
-App.UpgradeState.Holding = 'HOLDING';
-App.UpgradeState.Completed = 'COMPLETED';
-App.UpgradeState.Aborted = 'ABORTED';
-App.UpgradeState.Failed = 'HOLDING_FAILED';
-App.UpgradeState.Timeout = 'HOLDING_TIMEDOUT';
\ No newline at end of file
+App.UpgradeState = {
+  NotRequired: 'NOT_REQUIRED',
+  Pending: 'PENDING',
+  InProgress: 'IN_PROGRESS',
+  Holding: 'HOLDING',
+  Completed: 'COMPLETED',
+  Aborted: 'ABORTED',
+  Failed: 'HOLDING_FAILED',
+  Timeout: 'HOLDING_TIMEDOUT'
+}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
jgolieb@apache.org.