Skip to content

Commit

Permalink
Fix token command (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdlambert authored Mar 23, 2020
1 parent 33d32c5 commit 6e0edae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions bond/commands/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ def update_token(token):
bonds = BondDatabase.get_bonds()
if bondid not in bonds.keys():
bonds[bondid] = dict()
bonds[bondid]["token"] = token
print(f"Updated token for {bondid}")
bonds.get(bondid, {})["token"] = token
print("Updated token for %s" % bondid)
BondDatabase.set("bonds", bonds)


class TokenCommand(BaseCommand):
subcmd = "token"
help = "Manage token-based authentication."
arguments = {"TOKEN": {"help": "Save Bond token to local database"}}
arguments = {"token": {"help": "Save Bond token to local database"}}

def run(self, args):
update_token(args["Token"])
update_token(args.token)


def register():
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='bond-cli',
version='0.0.6',
version='0.0.7',
author='Olibra',
packages=find_packages(),
scripts=['bond/bond'],
Expand Down

0 comments on commit 6e0edae

Please sign in to comment.