Skip to content

Commit

Permalink
Fix builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorthu committed Oct 12, 2018
1 parent 1d0840b commit 397329b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions linodecli/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,8 @@ def get_token(self, username=None):
"""
Returns the token for a configured user
"""
t = os.environ[ENV_TOKEN_NAME]

try:
return t if t else self.config.get(username or 'DEFAULT', "token")
except ValueError:
print("No token set for user {}. Please provide a token through the "
"{} environment variable or reconfigure the CLI by running "
"`linode-cli configure`".format((username or 'DEFAULT', ENV_TOKEN_NAME)))
t = os.environ.get(ENV_TOKEN_NAME, None)
return t if t else self.config.get(username or 'DEFAULT', "token")

def configure(self, username=None):
"""
Expand Down

0 comments on commit 397329b

Please sign in to comment.