linode-cli 5.56.0__tar.gz → 5.56.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {linode_cli-5.56.0/linode_cli.egg-info → linode_cli-5.56.2}/PKG-INFO +3 -3
- {linode_cli-5.56.0 → linode_cli-5.56.2/linode_cli.egg-info}/PKG-INFO +3 -3
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linode_cli.egg-info/requires.txt +1 -1
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/configuration/config.py +18 -13
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/configuration/helpers.py +15 -2
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/data-3 +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/plugins/obj/__init__.py +11 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/version.py +1 -1
- {linode_cli-5.56.0 → linode_cli-5.56.2}/pyproject.toml +1 -1
- {linode_cli-5.56.0 → linode_cli-5.56.2}/LICENSE +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/MANIFEST.in +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/README.md +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linode_cli.egg-info/SOURCES.txt +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linode_cli.egg-info/dependency_links.txt +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linode_cli.egg-info/entry_points.txt +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linode_cli.egg-info/top_level.txt +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/__init__.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/__main__.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/api_request.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/arg_helpers.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/baked/__init__.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/baked/operation.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/baked/parsing.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/baked/request.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/baked/response.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/baked/util.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/cli.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/completion.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/configuration/__init__.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/configuration/auth.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/exit_codes.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/help_pages.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/helpers.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/oauth-landing-page.html +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/output/__init__.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/output/helpers.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/output/output_handler.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/overrides.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/plugins/__init__.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/plugins/firewall-editor.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/plugins/get-kubeconfig.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/plugins/image-upload.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/plugins/metadata.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/plugins/obj/buckets.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/plugins/obj/config.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/plugins/obj/helpers.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/plugins/obj/list.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/plugins/obj/objects.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/plugins/obj/website.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/plugins/plugins.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/plugins/region-table.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/linodecli/plugins/ssh.py +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/setup.cfg +0 -0
- {linode_cli-5.56.0 → linode_cli-5.56.2}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: linode-cli
|
|
3
|
-
Version: 5.56.
|
|
3
|
+
Version: 5.56.2
|
|
4
4
|
Summary: The official command-line interface for interacting with the Linode API.
|
|
5
5
|
Author-email: "Akamai Technologies Inc." <developers@linode.com>
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -15,7 +15,7 @@ Requires-Dist: rich
|
|
|
15
15
|
Requires-Dist: urllib3<3
|
|
16
16
|
Requires-Dist: linode-metadata>=0.3.0
|
|
17
17
|
Provides-Extra: obj
|
|
18
|
-
Requires-Dist: boto3; extra == "obj"
|
|
18
|
+
Requires-Dist: boto3>=1.36.0; extra == "obj"
|
|
19
19
|
Provides-Extra: dev
|
|
20
20
|
Requires-Dist: pylint>=2.17.4; extra == "dev"
|
|
21
21
|
Requires-Dist: pytest>=7.3.1; extra == "dev"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: linode-cli
|
|
3
|
-
Version: 5.56.
|
|
3
|
+
Version: 5.56.2
|
|
4
4
|
Summary: The official command-line interface for interacting with the Linode API.
|
|
5
5
|
Author-email: "Akamai Technologies Inc." <developers@linode.com>
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -15,7 +15,7 @@ Requires-Dist: rich
|
|
|
15
15
|
Requires-Dist: urllib3<3
|
|
16
16
|
Requires-Dist: linode-metadata>=0.3.0
|
|
17
17
|
Provides-Extra: obj
|
|
18
|
-
Requires-Dist: boto3; extra == "obj"
|
|
18
|
+
Requires-Dist: boto3>=1.36.0; extra == "obj"
|
|
19
19
|
Provides-Extra: dev
|
|
20
20
|
Requires-Dist: pylint>=2.17.4; extra == "dev"
|
|
21
21
|
Requires-Dist: pytest>=7.3.1; extra == "dev"
|
|
@@ -397,16 +397,21 @@ class CLIConfig:
|
|
|
397
397
|
print(f"\nConfiguring {username}\n")
|
|
398
398
|
|
|
399
399
|
# Configuring Defaults
|
|
400
|
-
regions =
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
400
|
+
regions = sorted(
|
|
401
|
+
[
|
|
402
|
+
r["id"]
|
|
403
|
+
for r in _do_get_request(self.base_url, "/regions")["data"]
|
|
404
|
+
]
|
|
405
|
+
)
|
|
406
|
+
types = sorted(
|
|
407
|
+
[
|
|
408
|
+
t["id"]
|
|
409
|
+
for t in _do_get_request(self.base_url, "/linode/types")["data"]
|
|
410
|
+
]
|
|
411
|
+
)
|
|
412
|
+
images = sorted(
|
|
413
|
+
[i["id"] for i in _do_get_request(self.base_url, "/images")["data"]]
|
|
414
|
+
)
|
|
410
415
|
|
|
411
416
|
is_full_access = _check_full_access(self.base_url, token)
|
|
412
417
|
|
|
@@ -423,9 +428,9 @@ class CLIConfig:
|
|
|
423
428
|
)
|
|
424
429
|
|
|
425
430
|
if "data" in users:
|
|
426
|
-
auth_users =
|
|
427
|
-
u["username"] for u in users["data"] if "ssh_keys" in u
|
|
428
|
-
|
|
431
|
+
auth_users = sorted(
|
|
432
|
+
[u["username"] for u in users["data"] if "ssh_keys" in u]
|
|
433
|
+
)
|
|
429
434
|
|
|
430
435
|
# get the preferred things
|
|
431
436
|
config["region"] = _default_thing_input(
|
|
@@ -3,8 +3,10 @@ General helper functions for configuraiton
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import configparser
|
|
6
|
+
import math
|
|
6
7
|
import os
|
|
7
8
|
import webbrowser
|
|
9
|
+
from functools import partial
|
|
8
10
|
from typing import Any, Callable, List, Optional
|
|
9
11
|
|
|
10
12
|
LEGACY_CONFIG_NAME = ".linode-cli"
|
|
@@ -142,13 +144,14 @@ def _default_thing_input(
|
|
|
142
144
|
exists = current_value is not None
|
|
143
145
|
|
|
144
146
|
idx_offset = int(exists) + 1
|
|
147
|
+
pad = partial(_pad_index, total=len(things) + idx_offset)
|
|
145
148
|
|
|
146
149
|
# If there is a current value, users should have the option to clear it
|
|
147
150
|
if exists:
|
|
148
|
-
print("
|
|
151
|
+
print(f"{pad(1)} - No Default")
|
|
149
152
|
|
|
150
153
|
for ind, thing in enumerate(things):
|
|
151
|
-
print(f"
|
|
154
|
+
print(f"{pad(ind + idx_offset)} - {thing}")
|
|
152
155
|
print()
|
|
153
156
|
|
|
154
157
|
while True:
|
|
@@ -184,6 +187,16 @@ def _default_thing_input(
|
|
|
184
187
|
return things[choice_idx]
|
|
185
188
|
|
|
186
189
|
|
|
190
|
+
def _pad_index(idx: int, total: int) -> str:
|
|
191
|
+
# NOTE: The implementation of this function could be less opaque if we're
|
|
192
|
+
# willing to say, "There will never be a case where total > X, because no
|
|
193
|
+
# one could examine and choose from that many options."
|
|
194
|
+
max_padding = math.floor(math.log10(total)) + 1
|
|
195
|
+
num_spaces = max_padding - math.floor(math.log10(idx))
|
|
196
|
+
|
|
197
|
+
return " " * num_spaces + str(idx)
|
|
198
|
+
|
|
199
|
+
|
|
187
200
|
def _default_text_input(
|
|
188
201
|
ask: str,
|
|
189
202
|
default: Optional[str] = None,
|
|
Binary file
|
|
@@ -56,6 +56,7 @@ from linodecli.plugins.obj.website import (
|
|
|
56
56
|
|
|
57
57
|
try:
|
|
58
58
|
import boto3
|
|
59
|
+
from botocore.config import Config
|
|
59
60
|
from botocore.exceptions import ClientError
|
|
60
61
|
|
|
61
62
|
HAS_BOTO = True
|
|
@@ -443,6 +444,16 @@ def _get_boto_client(cluster, access_key, secret_key):
|
|
|
443
444
|
aws_secret_access_key=secret_key,
|
|
444
445
|
region_name=cluster,
|
|
445
446
|
endpoint_url=BASE_URL_TEMPLATE.format(cluster),
|
|
447
|
+
config=Config(
|
|
448
|
+
# This addresses an incompatibility between boto3 1.36.x and
|
|
449
|
+
# some third-party S3-compatible storage platforms.
|
|
450
|
+
# In the future we may want to consider manually computing the
|
|
451
|
+
# CRC32 hash of a file before uploading it.
|
|
452
|
+
#
|
|
453
|
+
# See: https://github.com/boto/boto3/issues/4398#issuecomment-2619946229
|
|
454
|
+
request_checksum_calculation="when_required",
|
|
455
|
+
response_checksum_validation="when_required",
|
|
456
|
+
),
|
|
446
457
|
)
|
|
447
458
|
|
|
448
459
|
# set this for later use
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|