ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject ambari git commit: AMBARI-12982. Ambari-server 'mvn clean test' fails when Python 2.6 is picked up (aonishuk)
Date Wed, 02 Sep 2015 18:43:12 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 31edfe3ba -> a17c31abb


AMBARI-12982. Ambari-server 'mvn clean test' fails when Python 2.6 is picked up (aonishuk)


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

Branch: refs/heads/branch-2.1
Commit: a17c31abbf58e830c4966b4c37b92af5b240f00f
Parents: 31edfe3
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Wed Sep 2 21:43:04 2015 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Wed Sep 2 21:43:04 2015 +0300

----------------------------------------------------------------------
 .../package/scripts/oozie_server_upgrade.py       |  6 ++++--
 .../stacks/2.0.6/OOZIE/test_oozie_server.py       | 18 +++++++++++++++---
 .../stacks/2.0.6/common/test_stack_advisor.py     |  6 +++---
 3 files changed, 22 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a17c31ab/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
index 78d25bc..326e76c 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_server_upgrade.py
@@ -22,11 +22,11 @@ import shutil
 import tempfile
 
 from resource_management.core import shell
-from resource_management.core import sudo
 from resource_management.core.logger import Logger
 from resource_management.core.exceptions import Fail
 from resource_management.core.resources.system import Execute
 from resource_management.core.resources.system import Directory
+from resource_management.core.resources.system import File
 from resource_management.libraries.functions import Direction
 from resource_management.libraries.functions import format
 from resource_management.libraries.functions import compare_versions
@@ -154,7 +154,9 @@ class OozieUpgrade(Script):
     Logger.info("Copying {0} to {1}".format(oozie_ext_zip_file, params.oozie_libext_dir))
     Execute(("cp", oozie_ext_zip_file, params.oozie_libext_dir), sudo=True)
     Execute(("chown", format("{oozie_user}:{user_group}"), oozie_ext_zip_target_path), sudo=True)
-    sudo.chmod(oozie_ext_zip_target_path, 0644)
+    File(oozie_ext_zip_target_path,
+         mode=0644
+    )
 
     # Redownload jdbc driver to a new current location
     oozie.download_database_library_if_needed()

http://git-wip-us.apache.org/repos/asf/ambari/blob/a17c31ab/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
index 24ee07a..3341511 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
@@ -1174,6 +1174,9 @@ class TestOozieServer(RMFTestCase):
     self.assertResourceCalled('Directory', '/usr/hdp/current/oozie-server/libext', mode =
0777)
     self.assertResourceCalled('Execute', ('cp', '/usr/share/HDP-oozie/ext-2.2.zip', '/usr/hdp/current/oozie-server/libext'),
sudo=True)
     self.assertResourceCalled('Execute', ('chown', 'oozie:hadoop', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip'),
sudo=True)
+    self.assertResourceCalled('File', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip',
+        mode = 0644,
+    )
     self.assertNoMoreResources()
 
   @patch("os.path.isdir")
@@ -1239,11 +1242,13 @@ class TestOozieServer(RMFTestCase):
 
     self.assertResourceCalled('Execute', ('cp', '/usr/share/HDP-oozie/ext-2.2.zip', '/usr/hdp/current/oozie-server/libext'),
sudo=True)
     self.assertResourceCalled('Execute', ('chown', 'oozie:hadoop', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip'),
sudo=True)
-
+    self.assertResourceCalled('File', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip',
+        mode = 0644,
+    )
     self.assertNoMoreResources()
 
     self.assertEquals(1, mocks_dict['call'].call_count)
-    self.assertEquals(2, mocks_dict['checked_call'].call_count)
+    self.assertEquals(1, mocks_dict['checked_call'].call_count)
 
     self.assertEquals(
       ('conf-select', 'set-conf-dir', '--package', 'oozie', '--stack-version', '2.3.0.0-1234',
'--conf-version', '0'),
@@ -1294,6 +1299,9 @@ class TestOozieServer(RMFTestCase):
     self.assertResourceCalled('Directory', '/usr/hdp/current/oozie-server/libext',mode =
0777)
     self.assertResourceCalled('Execute', ('cp', '/usr/share/HDP-oozie/ext-2.2.zip', '/usr/hdp/current/oozie-server/libext'),
sudo=True)
     self.assertResourceCalled('Execute', ('chown', 'oozie:hadoop', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip'),
sudo=True)
+    self.assertResourceCalled('File', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip',
+        mode = 0644,
+    )
     self.assertNoMoreResources()
 
 
@@ -1489,13 +1497,16 @@ class TestOozieServer(RMFTestCase):
     self.assertResourceCalled('Execute', ('cp', '/usr/share/HDP-oozie/ext-2.2.zip', '/usr/hdp/current/oozie-server/libext'),
sudo=True)
     self.assertResourceCalled('Execute', ('chown', 'oozie:hadoop', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip'),
sudo=True)
 
+    self.assertResourceCalled('File', '/usr/hdp/current/oozie-server/libext/ext-2.2.zip',
+        mode = 0644,
+    )
     self.assertResourceCalled('Execute', 'ambari-sudo.sh cp /usr/hdp/2.3.0.0-1234/falcon/oozie/ext/falcon-oozie-el-extension-*.jar
/usr/hdp/current/oozie-server/libext')
     self.assertResourceCalled('Execute', 'ambari-sudo.sh chown oozie:hadoop /usr/hdp/current/oozie-server/libext/falcon-oozie-el-extension-*.jar')
 
     self.assertNoMoreResources()
 
     self.assertEquals(1, mocks_dict['call'].call_count)
-    self.assertEquals(2, mocks_dict['checked_call'].call_count)
+    self.assertEquals(1, mocks_dict['checked_call'].call_count)
 
     self.assertEquals(
       ('conf-select', 'set-conf-dir', '--package', 'oozie', '--stack-version', '2.3.0.0-1234',
'--conf-version', '0'),
@@ -1504,3 +1515,4 @@ class TestOozieServer(RMFTestCase):
     self.assertEquals(
       ('conf-select', 'create-conf-dir', '--package', 'oozie', '--stack-version', '2.3.0.0-1234',
'--conf-version', '0'),
        mocks_dict['call'].call_args_list[0][0][0])
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/a17c31ab/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index 86a34d9..75e59f9 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -994,7 +994,7 @@ class TestHDP206StackAdvisor(TestCase):
     ]}
     properties = {"property1": "/var/dir"}
     # only / mountpoint - no warning
-    self.assertIsNone(self.stackAdvisor.validatorNotRootFs(properties, 'property1', hostInfo))
+    self.assertTrue(self.stackAdvisor.validatorNotRootFs(properties, 'property1', hostInfo)
== None)
     # More preferable /grid/0 mountpoint - warning
     hostInfo["disk_info"].append(
       {
@@ -1004,7 +1004,7 @@ class TestHDP206StackAdvisor(TestCase):
       }
     )
     warn = self.stackAdvisor.validatorNotRootFs(properties, 'property1', hostInfo)
-    self.assertIsNotNone(warn)
+    self.assertTrue(warn != None)
     self.assertEquals({'message': 'The root device should not be used for property1', 'level':
'WARN'}, warn)
 
     # Set by user /var mountpoint, which is non-root , but not preferable - no warning
@@ -1015,4 +1015,4 @@ class TestHDP206StackAdvisor(TestCase):
         "mountpoint" : "/var"
       }
     )
-    self.assertIsNone(self.stackAdvisor.validatorNotRootFs(properties, 'property1', hostInfo))
+    self.assertTrue(self.stackAdvisor.validatorNotRootFs(properties, 'property1', hostInfo)
== None)


Mime
View raw message