Skip to content
Open
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
6 changes: 4 additions & 2 deletions linodecli/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ def get_bash_completions(ops):
complete -F _linode_cli lin"""
)

command_template = Template("""$command)
command_template = Template(
"""$command)
COMPREPLY=( $(compgen -W "$actions --help" -- ${cur}) )
return 0
;;""")
;;"""
)

command_blocks = [
command_template.safe_substitute(
Expand Down
17 changes: 10 additions & 7 deletions linodecli/configuration/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,12 @@ def _get_token_terminal(base_url: str) -> Tuple[str, str]:
:returns: A tuple containing the user's username and token.
:rtype: Tuple[str, str]
"""
print(f"""
First, we need a Personal Access Token. To get one, please visit
{TOKEN_GENERATION_URL} and click
"Create a Personal Access Token". The CLI needs access to everything
on your account to work correctly.""")
print(
"First, we need a Personal Access Token. To get one, please visit\n"
f"{TOKEN_GENERATION_URL} and click\n"
'"Create a Personal Access Token". The CLI needs access to everything\n'
"on your account to work correctly."
)

while True:
token = input("Personal Access Token: ")
Expand Down Expand Up @@ -327,13 +328,15 @@ def log_message(self, form, *args): # pylint: disable=arguments-differ
# figure out the URL to direct the user to and print out the prompt
# pylint: disable-next=line-too-long
url = f"https://login.linode.com/oauth/authorize?client_id={OAUTH_CLIENT_ID}&response_type=token&scopes=*&redirect_uri=http://localhost:{serv.server_address[1]}"
print(f"""A browser should open directing you to this URL to authenticate:
print(
f"""A browser should open directing you to this URL to authenticate:

{url}

If you are not automatically directed there, please copy/paste the link into your browser
to continue..
""")
"""
)

webbrowser.open(url)

Expand Down
7 changes: 4 additions & 3 deletions linodecli/configuration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ def _check_browsers() -> bool:

# pylint: disable-next=protected-access
if not KNOWN_GOOD_BROWSERS.intersection(webbrowser._tryorder):
print("""
This tool defaults to web-based authentication,
however no known-working browsers were found.""")
print(
"This tool defaults to web-based authentication,\n"
"however no known-working browsers were found."
)
while True:
r = input("Try it anyway? [y/N]: ")
if r.lower() in "yn ":
Expand Down
4 changes: 0 additions & 4 deletions tests/integration/linodes/test_linode_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ def test_interface_settings_update(
interface_id,
"--default_route.ipv6_interface_id",
interface_id,
"--default_route.ipv4_eligible_interface_ids",
interface_id,
"--default_route.ipv6_eligible_interface_ids",
interface_id,
"--json",
]
)
Expand Down
Loading