a couple minor fixes w/ burnettk

This commit is contained in:
jasquat 2023-04-06 15:45:16 -04:00
parent 2521025dac
commit 082caa5aea
2 changed files with 6 additions and 2 deletions

View File

@ -28,7 +28,11 @@ REALM_NAME=${2-spiffworkflow}
while read -r input_line; do
if ! grep -qE '(^#|email)' <<<"$input_line" ; then
username=$(awk -F '@' '{print $1}' <<<"$input_line")
access_token=$("${script_dir}/get_token" "$username" "$username" "$REALM_NAME" || echo '')
password=$(awk -F ',' '{print $2}' <<<"$input_line")
if [[ -z "$password" ]]; then
password="$username"
fi
access_token=$("${script_dir}/get_token" "$username" "$password" "$REALM_NAME" || echo '')
if [[ -z "$access_token" || "$access_token" == "null" ]]; then
>&2 echo "ERROR: failed to get access token for '$username'"
else

View File

@ -128,7 +128,7 @@ class ApiError(Exception):
instance = cls(code, message, status_code=status_code)
instance.task_id = task_spec.name or ""
instance.task_name = task_spec.description or ""
if task_spec._wf_spec:
if hasattr(task_spec, '_wf_spec') and task_spec._wf_spec:
instance.file_name = task_spec._wf_spec.file
return instance