Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions ascenderkit/api/pages/unified_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
)


Expand Down
9 changes: 7 additions & 2 deletions ascenderkit/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down