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

[FSTORE-1320] Fix hopsworks.login second attempt not taking parameters into account #192

Merged
merged 2 commits into from
Mar 22, 2024
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
5 changes: 3 additions & 2 deletions python/hopsworks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from pathlib import Path

from hopsworks.client.exceptions import RestAPIError, ProjectException
from hopsworks import version, constants
from hopsworks import version, constants, client
from hopsworks.connection import Connection

# Needs to run before import of hsml and hsfs
Expand Down Expand Up @@ -283,6 +283,7 @@ def _prompt_project(valid_connection, project):

def logout():
global _hw_connection
if type(_hw_connection) is Connection:
if isinstance(_hw_connection, Connection):
_hw_connection.close()
client.stop()
_hw_connection = Connection.connection
3 changes: 2 additions & 1 deletion python/hopsworks/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ def set_python_version(python_version):

def stop():
global _client
_client._close()
if _client:
_client._close()
_client = None
1 change: 1 addition & 0 deletions python/hopsworks/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def connect(self):
conn.connect()
```
"""
client.stop()
self._connected = True
try:
# init client
Expand Down
Loading