Exemplo n.º 1
0
    def validate_configs(cls, args):
        try:

            if args.d == 'qubole':
                return QuboleDeploymentConfig.validate_configs(args)

        except Exception as e:
            raise AfctlDeploymentException(e)
Exemplo n.º 2
0
    def deploy_project(cls, args, project_name, project_path):
        try:

            if args.type == "local":
                DockerDeploymentConfig.generate_dirs(project_path,
                                                     project_name)
                return DockerDeploymentConfig.deploy_project(
                    args, project_name)

            if args.type == "qubole":
                return QuboleDeploymentConfig.deploy_project(
                    args, project_name)

        except Exception as e:
            raise AfctlDeploymentException(e)
Exemplo n.º 3
0
 def test_validate_configs_on_update_should_pass_2(self):
     args = DummyArgParse(type='update', env='test_env', token='test_token', name="test_name")
     val = QuboleDeploymentConfig.validate_configs(args)
     assert str(val[0]) == "{'deployment': {'qubole': {'test_name': {'env': 'test_env', 'token': 'test_token'}}}}"
     assert val[1] is False
     assert val[2] is ''
Exemplo n.º 4
0
 def test_validate_configs_on_add_should_fail_2(self):
     args = DummyArgParse(type='add', env='test_env', cluster='test_cluster', name="test_name")
     val = QuboleDeploymentConfig.validate_configs(args)
     assert val[1] is True
     assert val[2] == "All arguments are required to add a new config. Check usage."
Exemplo n.º 5
0
 def test_validate_configs_on_add_should_fail_1(self):
     args = DummyArgParse(type='add', env='test_env', cluster='test_cluster', token='test_token')
     val = QuboleDeploymentConfig.validate_configs(args)
     assert val[1] is True
     assert val[2] == "Name of deployment is required. Check usage."
Exemplo n.º 6
0
 def test_validate_configs_on_add_should_pass(self):
     args = DummyArgParse(type='add', env='test_env', cluster='test_cluster', token='test_token', name="test_name")
     val = QuboleDeploymentConfig.validate_configs(args)
     assert str(val[0]) == "{'test_name': {'env': 'test_env', 'cluster': 'test_cluster', 'token': 'test_token'}}"
     assert val[1] is False
     assert val[2] is ''