From f4b08a9f771f76fbac7991c7d22de1a1b0eb5a0c Mon Sep 17 00:00:00 2001 From: Fred Park Date: Fri, 24 Mar 2017 14:54:19 -0700 Subject: [PATCH] Fix for multi-instance auto complete - Also only read credentials json if valid --- convoy/batch.py | 2 +- shipyard.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/convoy/batch.py b/convoy/batch.py index 9e8617b..de558d8 100644 --- a/convoy/batch.py +++ b/convoy/batch.py @@ -1754,7 +1754,7 @@ def add_jobs( # 1. check docker images in task against pre-loaded on pool # 2. if tasks have dependencies, set it if so # 3. if there are multi-instance tasks - mi_ac = settings.job_multi_instance_auto_complete(config) + mi_ac = settings.job_multi_instance_auto_complete(jobspec) multi_instance = False mi_docker_container_name = None reserved_task_id = None diff --git a/shipyard.py b/shipyard.py index 1186d83..d15333c 100755 --- a/shipyard.py +++ b/shipyard.py @@ -218,11 +218,11 @@ class CliContext(object): if self.configdir is not None and self.json_credentials is None: self.json_credentials = pathlib.Path( self.configdir, 'credentials.json') - if (self.json_credentials is not None and - not isinstance(self.json_credentials, pathlib.Path)): - self.json_credentials = pathlib.Path(self.json_credentials) - if self.json_credentials.exists(): - self._read_json_file(self.json_credentials) + if self.json_credentials is not None: + if not isinstance(self.json_credentials, pathlib.Path): + self.json_credentials = pathlib.Path(self.json_credentials) + if self.json_credentials.exists(): + self._read_json_file(self.json_credentials) def _init_config( self, skip_global_config=False, skip_pool_config=False,