瀏覽代碼

AMBARI-18337: Syntax Error in Ambari HAWQ Unit test with Python 2.6 (Masahiro Tanaka via lavjain)

ljainpivotalio 9 年之前
父節點
當前提交
ef837ba141
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      ambari-server/src/test/python/common-services/HAWQ/test_service_advisor.py

+ 5 - 5
ambari-server/src/test/python/common-services/HAWQ/test_service_advisor.py

@@ -643,7 +643,7 @@ class TestHAWQ200ServiceAdvisor(TestCase):
                           recommendations["recommendations"]["blueprint"]["host_groups"]]
     for sublist in componentsListList:
       hostComponents = [item["name"] for item in sublist]
-      self.assertFalse({'HAWQMASTER', 'HAWQSTANDBY'}.issubset(hostComponents))
+      self.assertFalse(set(['HAWQMASTER', 'HAWQSTANDBY']).issubset(hostComponents))
 
   def test_createComponentLayoutRecommendations_hawq_1_Host(self):
 
@@ -721,7 +721,7 @@ class TestHAWQ200ServiceAdvisor(TestCase):
       ]
     }
 
-    hawqSegmentHosts = {"c6401.ambari.apache.org", "c6402.ambari.apache.org", "c6403.ambari.apache.org"}
+    hawqSegmentHosts = set(["c6401.ambari.apache.org", "c6402.ambari.apache.org", "c6403.ambari.apache.org"])
     self.insertHAWQServiceAdvisorInfo(services)
     recommendations = self.serviceAdvisor.createComponentLayoutRecommendations(services, hosts)
     hostNames = self.getHostsFromRecommendations(recommendations, "HAWQSEGMENT")
@@ -766,7 +766,7 @@ class TestHAWQ200ServiceAdvisor(TestCase):
       ]
     }
 
-    hawqSegmentHosts = {"c6401.ambari.apache.org", "c6403.ambari.apache.org"}
+    hawqSegmentHosts = set(["c6401.ambari.apache.org", "c6403.ambari.apache.org"])
     self.insertHAWQServiceAdvisorInfo(services)
     recommendations = self.serviceAdvisor.createComponentLayoutRecommendations(services, hosts)
     hostNames = self.getHostsFromRecommendations(recommendations, "HAWQSEGMENT")
@@ -826,7 +826,7 @@ class TestHAWQ200ServiceAdvisor(TestCase):
       ]
     }
 
-    hawqSegmentHosts = {"c6402.ambari.apache.org"}
+    hawqSegmentHosts = set(["c6402.ambari.apache.org"])
     self.insertHAWQServiceAdvisorInfo(services)
     recommendations = self.serviceAdvisor.createComponentLayoutRecommendations(services, hosts)
     hostNames = self.getHostsFromRecommendations(recommendations, "HAWQSEGMENT")
@@ -1326,4 +1326,4 @@ class TestHAWQ200ServiceAdvisor(TestCase):
     configurations["core-site"]["properties"].pop("ipc.server.listen.queue.size")
     problems = self.serviceAdvisor.validateCORESiteConfigurations(configurations["core-site"]["properties"], defaults, configurations, services, hosts)
     self.assertEqual(len(problems), 1)
-    self.assertEqual(problems[0], expected)
+    self.assertEqual(problems[0], expected)