You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jl...@apache.org on 2016/03/10 00:50:08 UTC

[16/51] [abbrv] ambari git commit: AMBARI-15329: Code Cleanup: Remove hdp hardcodings in functions, variables etc. (jluniya)

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
index b6c682f..2847405 100644
--- a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
+++ b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
@@ -79,7 +79,7 @@ class TestHawqSegment(RMFTestCase):
         classname = 'HawqSegment',
         command = 'configure',
         config_file ='hawq_default.json',
-        hdp_stack_version = self.STACK_VERSION,
+        stack_version = self.STACK_VERSION,
         target = RMFTestCase.TARGET_COMMON_SERVICES
         )
 
@@ -94,7 +94,7 @@ class TestHawqSegment(RMFTestCase):
         classname = 'HawqSegment',
         command = 'install',
         config_file ='hawq_default.json',
-        hdp_stack_version = self.STACK_VERSION,
+        stack_version = self.STACK_VERSION,
         target = RMFTestCase.TARGET_COMMON_SERVICES
         )
 
@@ -109,7 +109,7 @@ class TestHawqSegment(RMFTestCase):
         classname = 'HawqSegment',
         command = 'start',
         config_file ='hawq_default.json',
-        hdp_stack_version = self.STACK_VERSION,
+        stack_version = self.STACK_VERSION,
         target = RMFTestCase.TARGET_COMMON_SERVICES
         )
 
@@ -144,7 +144,7 @@ class TestHawqSegment(RMFTestCase):
         classname = 'HawqSegment',
         command = 'stop',
         config_file ='hawq_default.json',
-        hdp_stack_version = self.STACK_VERSION,
+        stack_version = self.STACK_VERSION,
         target = RMFTestCase.TARGET_COMMON_SERVICES
         )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
index 7f4d3af..56a3f44 100644
--- a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
+++ b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
@@ -117,7 +117,7 @@ class TestHawqStandby(RMFTestCase):
         classname = 'HawqStandby',
         command = 'configure',
         config_file ='hawq_default.json',
-        hdp_stack_version = self.STACK_VERSION,
+        stack_version = self.STACK_VERSION,
         target = RMFTestCase.TARGET_COMMON_SERVICES
         )
 
@@ -132,7 +132,7 @@ class TestHawqStandby(RMFTestCase):
         classname = 'HawqStandby',
         command = 'install',
         config_file ='hawq_default.json',
-        hdp_stack_version = self.STACK_VERSION,
+        stack_version = self.STACK_VERSION,
         target = RMFTestCase.TARGET_COMMON_SERVICES
         )
 
@@ -152,7 +152,7 @@ class TestHawqStandby(RMFTestCase):
         classname = 'HawqStandby',
         command = 'start',
         config_file ='hawq_default.json',
-        hdp_stack_version = self.STACK_VERSION,
+        stack_version = self.STACK_VERSION,
         target = RMFTestCase.TARGET_COMMON_SERVICES
         )
 
@@ -185,7 +185,7 @@ class TestHawqStandby(RMFTestCase):
         classname = 'HawqStandby',
         command = 'stop',
         config_file ='hawq_default.json',
-        hdp_stack_version = self.STACK_VERSION,
+        stack_version = self.STACK_VERSION,
         target = RMFTestCase.TARGET_COMMON_SERVICES
         )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_client.py b/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_client.py
index f0f6326..17be97f 100644
--- a/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_client.py
+++ b/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_client.py
@@ -35,7 +35,7 @@ class TestMahoutClient(RMFTestCase):
       classname = "MahoutClient",
       command = "configure",
       config_file = "default.json",
-      hdp_stack_version = self.STACK_VERSION,
+      stack_version = self.STACK_VERSION,
       target = RMFTestCase.TARGET_COMMON_SERVICES)
 
     self.assertResourceCalled('Directory',
@@ -73,7 +73,7 @@ class TestMahoutClient(RMFTestCase):
       classname = "MahoutClient",
       command = "pre_upgrade_restart",
       config_dict = json_content,
-      hdp_stack_version = self.STACK_VERSION,
+      stack_version = self.STACK_VERSION,
       target = RMFTestCase.TARGET_COMMON_SERVICES)
 
     self.assertResourceCalled('Execute', ('ambari-python-wrap', '/usr/bin/hdp-select', 'set', 'mahout-client', '2.2.1.0-3242'), sudo=True)
@@ -98,7 +98,7 @@ class TestMahoutClient(RMFTestCase):
       classname = "MahoutClient",
       command = "pre_upgrade_restart",
       config_dict = json_content,
-      hdp_stack_version = self.STACK_VERSION,
+      stack_version = self.STACK_VERSION,
       target = RMFTestCase.TARGET_COMMON_SERVICES,
       call_mocks = itertools.cycle([(0, None, '')]),
       mocks_dict = mocks_dict)

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py b/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py
index 878b7f8..78ae3fe 100644
--- a/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.3/MAHOUT/test_mahout_service_check.py
@@ -32,7 +32,7 @@ class TestMahoutClient(RMFTestCase):
                        classname = "MahoutServiceCheck",
                        command = "service_check",
                        config_file="default.json",
-                       hdp_stack_version = self.STACK_VERSION,
+                       stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.3/PXF/test_pxf.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/PXF/test_pxf.py b/ambari-server/src/test/python/stacks/2.3/PXF/test_pxf.py
index 299638b..1147a7e 100644
--- a/ambari-server/src/test/python/stacks/2.3/PXF/test_pxf.py
+++ b/ambari-server/src/test/python/stacks/2.3/PXF/test_pxf.py
@@ -63,7 +63,7 @@ class TestPxf(RMFTestCase):
                        classname="Pxf",
                        command="install",
                        config_file="pxf_default.json",
-                       hdp_stack_version=self.STACK_VERSION,
+                       stack_version=self.STACK_VERSION,
                        target=RMFTestCase.TARGET_COMMON_SERVICES,
                        try_install=True)
 
@@ -91,7 +91,7 @@ class TestPxf(RMFTestCase):
                    classname="Pxf",
                    command="configure",
                    config_file="pxf_default.json",
-                   hdp_stack_version=self.STACK_VERSION,
+                   stack_version=self.STACK_VERSION,
                    target=RMFTestCase.TARGET_COMMON_SERVICES,
                    try_install=True)
 
@@ -103,7 +103,7 @@ class TestPxf(RMFTestCase):
                    classname="Pxf",
                    command="start",
                    config_file="pxf_default.json",
-                   hdp_stack_version=self.STACK_VERSION,
+                   stack_version=self.STACK_VERSION,
                    target=RMFTestCase.TARGET_COMMON_SERVICES,
                    try_install=True)
 
@@ -123,7 +123,7 @@ class TestPxf(RMFTestCase):
                    classname="Pxf",
                    command="stop",
                    config_file="pxf_default.json",
-                   hdp_stack_version=self.STACK_VERSION,
+                   stack_version=self.STACK_VERSION,
                    target=RMFTestCase.TARGET_COMMON_SERVICES,
                    try_install=True)
 
@@ -136,7 +136,7 @@ class TestPxf(RMFTestCase):
                    classname="Pxf",
                    command="status",
                    config_file="pxf_default.json",
-                   hdp_stack_version=self.STACK_VERSION,
+                   stack_version=self.STACK_VERSION,
                    target=RMFTestCase.TARGET_COMMON_SERVICES,
                    try_install=True)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py b/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
index f9c741d..c23fd96 100644
--- a/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
+++ b/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py
@@ -24,7 +24,7 @@ from stacks.utils.RMFTestCase import *
 from only_for_platform import not_for_platform, PLATFORM_WINDOWS
 
 @not_for_platform(PLATFORM_WINDOWS)
-@patch("resource_management.libraries.functions.get_hdp_version", new=MagicMock(return_value="2.3.2.0-1597"))
+@patch("resource_management.libraries.functions.get_stack_version", new=MagicMock(return_value="2.3.2.0-1597"))
 class TestSparkThriftServer(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "SPARK/1.2.0.2.2/package"
   STACK_VERSION = "2.3"
@@ -36,7 +36,7 @@ class TestSparkThriftServer(RMFTestCase):
                    classname = "SparkThriftServer",
                    command = "configure",
                    config_file="spark_default.json",
-                   hdp_stack_version = self.STACK_VERSION,
+                   stack_version = self.STACK_VERSION,
                    target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_default()
@@ -49,7 +49,7 @@ class TestSparkThriftServer(RMFTestCase):
                    classname = "SparkThriftServer",
                    command = "start",
                    config_file="spark_default.json",
-                   hdp_stack_version = self.STACK_VERSION,
+                   stack_version = self.STACK_VERSION,
                    target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assert_configure_default()
@@ -65,7 +65,7 @@ class TestSparkThriftServer(RMFTestCase):
                    classname = "SparkThriftServer",
                    command = "stop",
                    config_file="spark_default.json",
-                   hdp_stack_version = self.STACK_VERSION,
+                   stack_version = self.STACK_VERSION,
                    target = RMFTestCase.TARGET_COMMON_SERVICES
     )
     self.assertResourceCalled('Execute', '/usr/hdp/current/spark-client/sbin/stop-thriftserver.sh',
@@ -168,7 +168,7 @@ class TestSparkThriftServer(RMFTestCase):
                        classname = "SparkThriftServer",
                        command = "pre_upgrade_restart",
                        config_dict = json_content,
-                       hdp_stack_version = self.STACK_VERSION,
+                       stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES,
                        call_mocks = [(0, None, ''), (0, None)],
                        mocks_dict = mocks_dict)

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.3/STORM/test_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/STORM/test_service_check.py b/ambari-server/src/test/python/stacks/2.3/STORM/test_service_check.py
index 81d7827..47101d2 100644
--- a/ambari-server/src/test/python/stacks/2.3/STORM/test_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.3/STORM/test_service_check.py
@@ -32,7 +32,7 @@ class TestStormServiceCheck(TestStormBase):
                        classname="ServiceCheck",
                        command="service_check",
                        config_file="storm_default.json",
-                       hdp_stack_version = self.STACK_VERSION,
+                       stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES
     )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.3/STORM/test_storm_upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/STORM/test_storm_upgrade.py b/ambari-server/src/test/python/stacks/2.3/STORM/test_storm_upgrade.py
index f53525c..d0356ff 100644
--- a/ambari-server/src/test/python/stacks/2.3/STORM/test_storm_upgrade.py
+++ b/ambari-server/src/test/python/stacks/2.3/STORM/test_storm_upgrade.py
@@ -41,7 +41,7 @@ class TestStormUpgrade(RMFTestCase):
       classname = "StormUpgrade",
       command = "delete_storm_zookeeper_data",
       config_dict = json_content,
-      hdp_stack_version = self.STACK_VERSION,
+      stack_version = self.STACK_VERSION,
       target = RMFTestCase.TARGET_COMMON_SERVICES,
       call_mocks = [],
       mocks_dict = mocks_dict)
@@ -73,7 +73,7 @@ class TestStormUpgrade(RMFTestCase):
       classname = "StormUpgrade",
       command = "delete_storm_zookeeper_data",
       config_dict = json_content,
-      hdp_stack_version = self.STACK_VERSION,
+      stack_version = self.STACK_VERSION,
       target = RMFTestCase.TARGET_COMMON_SERVICES,
       call_mocks = [],
       mocks_dict = mocks_dict)

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/2.3/YARN/test_ats_1_5.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.3/YARN/test_ats_1_5.py b/ambari-server/src/test/python/stacks/2.3/YARN/test_ats_1_5.py
index f826b55..9197cf1 100644
--- a/ambari-server/src/test/python/stacks/2.3/YARN/test_ats_1_5.py
+++ b/ambari-server/src/test/python/stacks/2.3/YARN/test_ats_1_5.py
@@ -31,8 +31,8 @@ origin_exists = os.path.exists
   side_effect=lambda *args: origin_exists(args[0])
   if args[0][-2:] == "j2" else True))
 
-@patch.object(Script, "is_hdp_stack_greater_or_equal", new = MagicMock(return_value=False))
-@patch.object(functions, "get_hdp_version", new = MagicMock(return_value="2.0.0.0-1234"))
+@patch.object(Script, "is_stack_greater_or_equal", new = MagicMock(return_value=False))
+@patch.object(functions, "get_stack_version", new = MagicMock(return_value="2.0.0.0-1234"))
 class TestAts(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "YARN/2.1.0.2.0/package"
   STACK_VERSION = "2.3"
@@ -42,7 +42,7 @@ class TestAts(RMFTestCase):
                        classname="ApplicationTimelineServer",
                        command="configure",
                        config_file="ats_1_5.json",
-                       hdp_stack_version = self.STACK_VERSION,
+                       stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES
                        )
     self.assert_configure_default()

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7221e5a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
index ca32649..380fa39 100644
--- a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
+++ b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
@@ -61,7 +61,7 @@ class RMFTestCase(TestCase):
                     config_dict=None,
                     # common mocks for all the scripts
                     config_overrides = None,
-                    hdp_stack_version = None,
+                    stack_version = None,
                     checked_call_mocks = itertools.cycle([(0, "OK.")]),
                     call_mocks = itertools.cycle([(0, "OK.")]),
                     os_type=('Suse','11','Final'),
@@ -82,7 +82,7 @@ class RMFTestCase(TestCase):
       configs_path = os.path.join(src_dir, PATH_TO_CUSTOM_ACTION_TESTS, "configs")
     elif target == self.TARGET_COMMON_SERVICES:
       base_path = os.path.join(src_dir, PATH_TO_COMMON_SERVICES)
-      configs_path = os.path.join(src_dir, PATH_TO_STACK_TESTS, hdp_stack_version, "configs")
+      configs_path = os.path.join(src_dir, PATH_TO_STACK_TESTS, stack_version, "configs")
     else:
       raise RuntimeError("Wrong target value %s", target)
     script_path = os.path.join(base_path, norm_path)