From d2f6fd841902f80ece25583ec9d595a5b2a486f7 Mon Sep 17 00:00:00 2001 From: David Horsman <56004724+horsmand@users.noreply.github.com> Date: Wed, 13 Oct 2021 13:13:29 -0500 Subject: [PATCH] chore(deadline): add error handling for deadlinecommand json mode in configure_identity_registration_settings.py (#604) --- .../python/configure_identity_registration_settings.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/aws-rfdk/lib/deadline/scripts/python/configure_identity_registration_settings.py b/packages/aws-rfdk/lib/deadline/scripts/python/configure_identity_registration_settings.py index ee9b2d530..c14010e46 100644 --- a/packages/aws-rfdk/lib/deadline/scripts/python/configure_identity_registration_settings.py +++ b/packages/aws-rfdk/lib/deadline/scripts/python/configure_identity_registration_settings.py @@ -298,7 +298,13 @@ def run_json(self, *args: Iterable[str]): # Prepend the arguments with the json command-line flag transformed_args = ['--json'] + transformed_args - return json.loads(self._call_deadline_command(transformed_args)) + result = json.loads(self._call_deadline_command(transformed_args)) + + if 'ok' in result.keys(): + if result['ok'] == False: + raise ValueError('DeadlineCommandError: \n%s' % (result)) + + return result def dry_run(self, *args: Iterable[str]): transformed_args = self._transform_args(args)