diff --git a/ascenderkit/api/pages/unified_jobs.py b/ascenderkit/api/pages/unified_jobs.py index a9e42a6..760656f 100644 --- a/ascenderkit/api/pages/unified_jobs.py +++ b/ascenderkit/api/pages/unified_jobs.py @@ -139,17 +139,20 @@ def controller_dir(self): """ self.get() job_args = self.job_args - # Server-side value, not a brand reference: this must stay in step with - # JOB_FOLDER_PREFIX in awx/main/constants.py over in ctrliq/ascender. - expected_prefix = f'/tmp/awx_{self.id}' + # Server-side values, not brand references: these must stay in step with + # JOB_FOLDER_PREFIX and FORMER_JOB_FOLDER_PREFIX in + # ascender/main/constants.py over in ctrliq/ascender. Both are accepted, + # because this client talks to whichever release the server is running + # and the folder name changed between two of them. + expected_prefixes = (f'/tmp/ascender_{self.id}', f'/tmp/awx_{self.id}') for arg1, arg2 in zip(job_args[:-1], job_args[1:]): if arg1 == '-v': if ':' in arg2: host_loc = arg2.split(':')[0] - if host_loc.startswith(expected_prefix): + if host_loc.startswith(expected_prefixes): return host_loc raise RuntimeError( - f'Could not find a controller private_data_dir for this job. Searched for volume mount to {expected_prefix} inside of args {job_args}' + f'Could not find a controller private_data_dir for this job. Searched for a volume mount to one of {expected_prefixes} inside of args {job_args}' ) diff --git a/ascenderkit/ws.py b/ascenderkit/ws.py index 671b258..b4a7671 100644 --- a/ascenderkit/ws.py +++ b/ascenderkit/ws.py @@ -60,8 +60,13 @@ def __init__( csrftoken=None, add_received_time=False, # Server-side value, not a brand reference: this must stay in step with - # SESSION_COOKIE_NAME in awx/settings/defaults.py over in ctrliq/ascender. - session_cookie_name='awx_sessionid', + # SESSION_COOKIE_NAME in ascender/settings/defaults.py over in + # ctrliq/ascender, which was awx_sessionid before the rename. Unlike the + # HTTP side this cookie is sent rather than read, so it has to be the one + # name the server expects: a caller holding a Connection should pass its + # session_cookie_name, which Connection discovers from the + # X-API-Session-Cookie-Name header at login and is right for any release. + session_cookie_name='ascender_sessionid', verify=None, ): # delay this import, because this is an optional dependency