예제 #1
0
    def test_build_nodemanager_decommission_request(self):
        c_name = "c1"
        instances = [self.i1, self.i2]

        res = decomission_helper.build_nodemanager_decommission_request(
            c_name, instances)

        self.assertEqual("i1,i2",
                         res["RequestInfo"]["parameters"]["excluded_hosts"])
        self.assertEqual("c1",
                         res["RequestInfo"]["operation_level"]["cluster_name"])
예제 #2
0
    def test_build_nodemanager_decommission_request(self):
        c_name = "c1"
        instances = [self.i1, self.i2]

        res = decomission_helper.build_nodemanager_decommission_request(
            c_name, instances)

        self.assertEqual("i1,i2",
                         res["RequestInfo"]["parameters"]["excluded_hosts"])
        self.assertEqual("c1",
                         res["RequestInfo"]["operation_level"]["cluster_name"])
예제 #3
0
 def decommission_nodemanagers(self, cluster_name, instances):
     url = self._base_url + "/clusters/%s/requests" % cluster_name
     data = d_helper.build_nodemanager_decommission_request(cluster_name,
                                                            instances)
     resp = self.post(url, data=jsonutils.dumps(data))
     self.wait_ambari_request(self.req_id(resp), cluster_name)