Skip to content

Commit

Permalink
fixed a bug where list_clusters would always use DEFAULT_SOA_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
mjksmith committed Jan 21, 2016
1 parent 93c548c commit 6731acc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
11 changes: 9 additions & 2 deletions general_itests/steps/deployments_json_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

from paasta_tools import generate_deployments_for_service
from paasta_tools import marathon_tools
from paasta_tools.utils import InstanceConfig


@given(u'a test git repo is setup with commits')
Expand Down Expand Up @@ -73,8 +74,14 @@ def step_impl_when(context):
return_value=context.test_git_repo_dir),
mock.patch('paasta_tools.generate_deployments_for_service.parse_args',
autospec=True, return_value=fake_args),
mock.patch('paasta_tools.generate_deployments_for_service.get_branches_for_service', autospec=True,
return_value=['paasta-test_cluster.test_instance']),
mock.patch('paasta_tools.generate_deployments_for_service.get_instance_config_for_service', autospec=True,
return_value=[InstanceConfig(
cluster='paasta-test_cluster',
service='fake_deployments_json_service',
instance='test_instance',
config_dict={},
branch_dict={},
)]),
) as (
mock_get_git_url,
mock_parse_args,
Expand Down
6 changes: 6 additions & 0 deletions paasta_tools/cli/cmds/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,13 @@ def validate_chronos(service_path):
instance_type = 'chronos'

returncode = 0
print "Clusters:"
print list_clusters(service, soa_dir, instance_type)
for cluster in list_clusters(service, soa_dir, instance_type):
print cluster
print list_all_instances_for_service(
service=service, clusters=[cluster], instance_type=instance_type,
soa_dir=soa_dir)
for instance in list_all_instances_for_service(
service=service, clusters=[cluster], instance_type=instance_type,
soa_dir=soa_dir):
Expand Down
2 changes: 1 addition & 1 deletion paasta_tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ def get_default_cluster_for_service(service):
def get_soa_cluster_deploy_files(service=None, soa_dir=DEFAULT_SOA_DIR, instance_type=None):
if service is None:
service = '*'
service_path = os.path.join(DEFAULT_SOA_DIR, service)
service_path = os.path.join(soa_dir, service)

if instance_type == 'marathon' or instance_type == 'chronos':
instance_types = instance_type
Expand Down

0 comments on commit 6731acc

Please sign in to comment.