예제 #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
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
 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'])