コード例 #1
0
    def _await_datanodes(self, cluster):
        datanodes_count = len(vu.get_datanodes(cluster))
        if datanodes_count < 1:
            return

        LOG.info(_LI("Waiting %s datanodes to start up"), datanodes_count)
        with remote.get_remote(vu.get_namenode(cluster)) as r:
            while True:
                if run.check_datanodes_count(r, datanodes_count):
                    LOG.info(_LI('Datanodes on cluster %s have been started'),
                             cluster.name)
                    return

                context.sleep(1)

                if not g.check_cluster_exists(cluster):
                    LOG.info(
                        _LI('Stop waiting datanodes on cluster %s since it has'
                            ' been deleted'), cluster.name)
                    return
コード例 #2
0
ファイル: versionhandler.py プロジェクト: stannie42/sahara
    def _await_datanodes(self, cluster):
        datanodes_count = len(vu.get_datanodes(cluster))
        if datanodes_count < 1:
            return

        LOG.info(_LI("Waiting %s datanodes to start up"), datanodes_count)
        with remote.get_remote(vu.get_namenode(cluster)) as r:
            while True:
                if run.check_datanodes_count(r, datanodes_count):
                    LOG.info(
                        _LI('Datanodes on cluster %s has been started'),
                        cluster.name)
                    return

                context.sleep(1)

                if not g.check_cluster_exists(cluster):
                    LOG.info(
                        _LI('Stop waiting datanodes on cluster %s since it has'
                            ' been deleted'), cluster.name)
                    return
コード例 #3
0
ファイル: test_run_scripts.py プロジェクト: xinw1012/sahara
 def test_check_datanodes_count_expects_zero(self):
     remote = mock.Mock()
     self.assertTrue(run_scripts.check_datanodes_count(remote, 0))
     self.assertEqual(remote.execute_command.call_count, 0)
コード例 #4
0
ファイル: test_run_scripts.py プロジェクト: xinw1012/sahara
 def test_check_datanodes_count_nonzero_exitcode(self):
     remote = mock.Mock()
     remote.execute_command.return_value = (1, "1")
     self.assertFalse(run_scripts.check_datanodes_count(remote, 1))
コード例 #5
0
ファイル: test_run_scripts.py プロジェクト: xinw1012/sahara
 def test_check_datanodes_count_negative(self):
     remote = mock.Mock()
     remote.execute_command.return_value = (0, "1")
     self.assertFalse(run_scripts.check_datanodes_count(remote, 2))
コード例 #6
0
ファイル: test_run_scripts.py プロジェクト: B-Rich/sahara
 def test_check_datanodes_count_expects_zero(self):
     remote = mock.Mock()
     self.assertTrue(run_scripts.check_datanodes_count(remote, 0))
     self.assertEqual(remote.execute_command.call_count, 0)
コード例 #7
0
ファイル: test_run_scripts.py プロジェクト: B-Rich/sahara
 def test_check_datanodes_count_nonzero_exitcode(self):
     remote = mock.Mock()
     remote.execute_command.return_value = (1, "1")
     self.assertFalse(run_scripts.check_datanodes_count(remote, 1))
コード例 #8
0
ファイル: test_run_scripts.py プロジェクト: B-Rich/sahara
 def test_check_datanodes_count_negative(self):
     remote = mock.Mock()
     remote.execute_command.return_value = (0, "1")
     self.assertFalse(run_scripts.check_datanodes_count(remote, 2))