コード例 #1
0
 def test_hosts_set(self, conf_mock):
     conf_mock.return_value = {
         "username": "******",
         "port": "22",
         "coordinator": "hello",
         "workers": ["a", "b"]
     }
     topology.set_env_from_conf()
     self.assertEqual(topology.env.hosts, ['hello', 'a', 'b'])
コード例 #2
0
ファイル: main.py プロジェクト: youngwookim/presto-admin
def load_topology():
    try:
        topology.set_env_from_conf()
    except ConfigFileNotFoundError as e:
        # If there is no topology file, just store empty
        # roledefs for now and save the error in the environment variables.
        # If the task is an install task, we will set up a prompt for the
        # user to interactively enter the config vars. Else, we will error
        # out at a later point.
        state.env['topology_config_not_found'] = e
        pass
コード例 #3
0
def load_topology():
    try:
        topology.set_env_from_conf()
    except ConfigFileNotFoundError as e:
        # If there is no topology file, just store empty
        # roledefs for now and save the error in the environment variables.
        # If the task is an install task, we will set up a prompt for the
        # user to interactively enter the config vars. Else, we will error
        # out at a later point.
        state.env['topology_config_not_found'] = e
        pass
コード例 #4
0
ファイル: test_topology.py プロジェクト: Svjard/presto-admin
 def test_hosts_set(self, conf_mock):
     conf_mock.return_value = {"username": "******", "port": "22",
                               "coordinator": "hello",
                               "workers": ["a", "b"]}
     topology.set_env_from_conf()
     self.assertEqual(topology.env.hosts, ['hello', 'a', 'b'])