Skip to content

Commit

Permalink
Update export/import CLI no-auth
Browse files Browse the repository at this point in the history
Updating export/import CLI config file parsing to not fail on parsing
config file without username or password fields.

Signed-off-by: Marek Aufart <[email protected]>
  • Loading branch information
aufi committed Jun 10, 2024
1 parent 01b8079 commit 7ee9634
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hack/tool/tackle
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class TackleTool:
self.dataDir = dataDir
self.Url = tackle2Url
# Gather Keycloak access token for Tackle
self.Token = getHubToken(tackle2Url, c['username'], c['password'], tackle2Token)
self.Token = getHubToken(tackle2Url, c.get('username', ''), c.get('password', ''), tackle2Token)
self.TokenRenewAfter = int(time.time()) + TOKEN_REFRESH_SECONDS

self.encKeyVerified = False
Expand Down Expand Up @@ -191,7 +191,7 @@ class TackleTool:

def checkTokenLifetime(self):
if self.TokenRenewAfter < int(time.time()):
self.Token = getHubToken(self.Url, c['username'], c['password'], False)
self.Token = getHubToken(self.Url, c.get('username', ''), c.get('password', ''), False)
self.TokenRenewAfter = int(time.time()) + TOKEN_REFRESH_SECONDS

def apiJSON(self, url, data=None, method='GET', ignoreErrors=False):
Expand Down

0 comments on commit 7ee9634

Please sign in to comment.