You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2013/08/15 21:49:22 UTC

git commit: AMBARI-2911. Remove dependency on epel with HDP Utils containing the bits needed for rhel5/rhel6. (Vitaly Brodetskyi via smohanty)

Updated Branches:
  refs/heads/trunk d95ecac92 -> 54c378872


AMBARI-2911. Remove dependency on epel with HDP Utils containing the bits needed for rhel5/rhel6. (Vitaly Brodetskyi via smohanty)


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

Branch: refs/heads/trunk
Commit: 54c3788726eb86369452983f9140094fdda3cb14
Parents: d95ecac
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Thu Aug 15 12:48:58 2013 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Thu Aug 15 12:48:58 2013 -0700

----------------------------------------------------------------------
 ambari-server/src/main/python/setupAgent.py     | 14 ------------
 .../stacks/HDP/2.0.5/repos/repoinfo.xml         | 24 --------------------
 .../stacks/HDPLocal/2.0.5/repos/repoinfo.xml    | 24 --------------------
 ambari-server/src/test/python/TestSetupAgent.py | 24 +-------------------
 4 files changed, 1 insertion(+), 85 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/54c37887/ambari-server/src/main/python/setupAgent.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/setupAgent.py b/ambari-server/src/main/python/setupAgent.py
index 4fbee69..717c92a 100755
--- a/ambari-server/src/main/python/setupAgent.py
+++ b/ambari-server/src/main/python/setupAgent.py
@@ -51,17 +51,6 @@ def installAgentSuse(projectVersion):
   zypperCommand = ["zypper", "install", "-y", "ambari-agent" + projectVersion]
   return execOsCommand(zypperCommand)
 
-def installPreReq():
-  """ required for ruby deps """
-  checkepel = ["yum", "repolist", "enabled"]
-  retval = execOsCommand(checkepel)
-  logval = str(retval["log"])
-  if not "epel" in logval:
-    yumCommand = ["yum", "-y", "install", "epel-release"]
-  else:
-    yumCommand = ["echo", "Epel already exists"]
-  return execOsCommand(yumCommand)
-
 def installAgent(projectVersion):
   """ Run yum install and make sure the agent install alright """
   # The command doesn't work with file mask ambari-agent*.rpm, so rename it on agent host
@@ -185,9 +174,6 @@ def main(argv=None):
     if (not ret["exitstatus"]==0):
       sys.exit(ret)
   else:
-    ret = installPreReq()
-    if (not ret["exitstatus"]==0):
-      sys.exit(ret)
     ret = installAgent(projectVersion)
     if (not ret["exitstatus"]==0):
       sys.exit(ret)

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/54c37887/ambari-server/src/main/resources/stacks/HDP/2.0.5/repos/repoinfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.5/repos/repoinfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.5/repos/repoinfo.xml
index d1d7716..7925e9e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.5/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.5/repos/repoinfo.xml
@@ -22,12 +22,6 @@
       <repoid>HDP-2.0.5</repoid>
       <reponame>HDP</reponame>
     </repo>
-    <repo>
-      <baseurl></baseurl>
-      <repoid>HDP-epel</repoid>
-      <reponame>HDP-epel</reponame>
-      <mirrorslist><![CDATA[http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch]]></mirrorslist>
-    </repo>
   </os>
   <os type="centos5">
     <repo>
@@ -35,12 +29,6 @@
       <repoid>HDP-2.0.5</repoid>
       <reponame>HDP</reponame>
     </repo>
-    <repo>
-      <baseurl></baseurl>
-      <repoid>HDP-epel</repoid>
-      <reponame>HDP-epel</reponame>
-      <mirrorslist><![CDATA[http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch]]></mirrorslist>
-    </repo>
   </os>
   <os type="redhat6">
     <repo>
@@ -48,12 +36,6 @@
       <repoid>HDP-2.0.5</repoid>
       <reponame>HDP</reponame>
     </repo>
-    <repo>
-      <baseurl></baseurl>
-      <repoid>HDP-epel</repoid>
-      <reponame>HDP-epel</reponame>
-      <mirrorslist><![CDATA[http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch]]></mirrorslist>
-    </repo>
   </os>
   <os type="redhat5">
     <repo>
@@ -61,12 +43,6 @@
       <repoid>HDP-2.0.5</repoid>
       <reponame>HDP</reponame>
     </repo>
-    <repo>
-      <baseurl></baseurl>
-      <repoid>HDP-epel</repoid>
-      <reponame>HDP-epel</reponame>
-      <mirrorslist><![CDATA[http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch]]></mirrorslist>
-    </repo>
   </os>
   <os type="suse11">
     <repo>

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/54c37887/ambari-server/src/main/resources/stacks/HDPLocal/2.0.5/repos/repoinfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDPLocal/2.0.5/repos/repoinfo.xml b/ambari-server/src/main/resources/stacks/HDPLocal/2.0.5/repos/repoinfo.xml
index b222227..925020d 100644
--- a/ambari-server/src/main/resources/stacks/HDPLocal/2.0.5/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDPLocal/2.0.5/repos/repoinfo.xml
@@ -22,12 +22,6 @@
       <repoid>HDP-2.0.5</repoid>
       <reponame>HDP</reponame>
     </repo>
-    <repo>
-      <baseurl></baseurl>
-      <repoid>HDP-epel</repoid>
-      <reponame>HDP-epel</reponame>
-      <mirrorslist><![CDATA[http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch]]></mirrorslist>
-    </repo>
   </os>
   <os type="centos5">
     <repo>
@@ -35,12 +29,6 @@
       <repoid>HDP-2.0.5</repoid>
       <reponame>HDP</reponame>
     </repo>
-    <repo>
-      <baseurl></baseurl>
-      <repoid>HDP-epel</repoid>
-      <reponame>HDP-epel</reponame>
-      <mirrorslist><![CDATA[http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch]]></mirrorslist>
-    </repo>
   </os>
   <os type="redhat6">
     <repo>
@@ -48,12 +36,6 @@
       <repoid>HDP-2.0.5</repoid>
       <reponame>HDP</reponame>
     </repo>
-    <repo>
-      <baseurl></baseurl>
-      <repoid>HDP-epel</repoid>
-      <reponame>HDP-epel</reponame>
-      <mirrorslist><![CDATA[http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch]]></mirrorslist>
-    </repo>
   </os>
   <os type="redhat5">
     <repo>
@@ -61,12 +43,6 @@
       <repoid>HDP-2.0.5</repoid>
       <reponame>HDP</reponame>
     </repo>
-    <repo>
-      <baseurl></baseurl>
-      <repoid>HDP-epel</repoid>
-      <reponame>HDP-epel</reponame>
-      <mirrorslist><![CDATA[http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch]]></mirrorslist>
-    </repo>
   </os>
   <os type="suse11">
     <repo>

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/54c37887/ambari-server/src/test/python/TestSetupAgent.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestSetupAgent.py b/ambari-server/src/test/python/TestSetupAgent.py
index 124fbff..3cdb514 100644
--- a/ambari-server/src/test/python/TestSetupAgent.py
+++ b/ambari-server/src/test/python/TestSetupAgent.py
@@ -279,18 +279,9 @@ class TestSetupAgent(TestCase):
   def test_installAgentSuse(self, Popen_mock):
     self.assertFalse(setup_agent.installAgentSuse("1") == None)
 
-  @patch.object(setup_agent, 'execOsCommand')
-  def test_installPreReq(self, execOsCommand_mock):
-    execOsCommand_mock.side_effect = [{"log": " epel "}, "hostname -f", {"log": " something "}, "hostname -f"]
-    setup_agent.installPreReq()
-    setup_agent.installPreReq()
-    self.assertTrue(execOsCommand_mock.call_count == 4)
-
-
   @patch.object(setup_agent, 'runAgent')
   @patch.object(setup_agent, 'configureAgent')
   @patch.object(setup_agent, 'installAgent')
-  @patch.object(setup_agent, 'installPreReq')
   @patch.object(setup_agent, 'installAgentSuse')
   @patch.object(setup_agent, 'is_suse')
   @patch.object(setup_agent, 'getOptimalVersion')
@@ -299,9 +290,8 @@ class TestSetupAgent(TestCase):
   @patch("os.path.dirname")
   @patch("os.path.realpath")
   def test_setup_agent_main(self, dirname_mock, realpath_mock, exit_mock, checkServerReachability_mock,
-                            getOptimalVersion_mock, is_suse_mock, installAgentSuse_mock, installPreReq_mock,
+                            getOptimalVersion_mock, is_suse_mock, installAgentSuse_mock,
                             installAgent_mock, configureAgent_mock, runAgent_mock):
-    installPreReq_mock.return_value = {'log': 'log', 'exitstatus': 0}
     installAgent_mock.return_value = {'log': 'log', 'exitstatus': 0}
     installAgentSuse_mock.return_value = {'log': 'log', 'exitstatus': 0}
     runAgent_mock.return_value = 0
@@ -318,19 +308,7 @@ class TestSetupAgent(TestCase):
     def side_effect(retcode):
       raise Exception(retcode, "sys.exit")
     exit_mock.side_effect = side_effect
-    #BUG-6769 Bootstrap does not fail on yum error
-    #if "yum -y install epel-release" return not 0 result
-    installPreReq_mock.return_value = {'log': 'log', 'exitstatus': 1}
-    try:
-        setup_agent.main(("setupAgent.py","agents_host","password", "server_hostname","1.1.1","8080"))
-        self.fail("Should throw exception")
-    except Exception:
-        # Expected
-        pass
-    self.assertTrue(exit_mock.called)
-    exit_mock.reset()
     #if "yum -y install --nogpgcheck ambari-agent" return not 0 result
-    installPreReq_mock.return_value = {'log': 'log', 'exitstatus': 0}
     installAgent_mock.return_value = {'log': 'log', 'exitstatus': 1}
     try:
         setup_agent.main(("setupAgent.py","agents_host","password", "server_hostname","1.1.1","8080"))