Skip to content

Commit

Permalink
🐛 Update export/import CLI no-auth (#647)
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.

Not a blocker, but installations without auth enabled still needed keep
username and password fields in config (even with a random content),
after this PR they don't have to be there.

Signed-off-by: Marek Aufart <maufart@redhat.com>
  • Loading branch information
aufi committed Jun 17, 2024
1 parent 68b5626 commit 25f6086
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 25f6086

Please sign in to comment.