Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): do not error unneccesarily on session stop #3642

Merged
merged 3 commits into from
Nov 10, 2023
Merged
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
10 changes: 8 additions & 2 deletions renku/core/session/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,16 @@ def stop_sessions(session_provider: ISessionProvider) -> SessionStopStatus:
return session_provider.session_stop(
project_name=project_name, session_name=session_name, stop_all=stop_all
)
except errors.RenkulabSessionGetUrlError:
except errors.RenkulabSessionGetUrlError as e:
if provider:
raise
return SessionStopStatus.FAILED
communication.warn(f"Didn't stop any renkulab sessions: {e}")
return SessionStopStatus.SUCCESSFUL
except errors.DockerError as e:
if provider:
raise
communication.warn(f"Didn't stop any docker sessions: {e}")
return SessionStopStatus.SUCCESSFUL

session_detail = "all sessions" if stop_all else f"session {session_name}" if session_name else "session"
project_name = get_renku_project_name()
Expand Down