snapctl 0.49.3__py3-none-any.whl → 0.49.5__py3-none-any.whl
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.
Potentially problematic release.
This version of snapctl might be problematic. Click here for more details.
- snapctl/commands/byows.py +4 -2
- snapctl/commands/snapend.py +23 -8
- snapctl/config/constants.py +1 -1
- snapctl/data/releases/beta-0.49.4.mdx +8 -0
- snapctl/data/releases/beta-0.49.5.mdx +8 -0
- {snapctl-0.49.3.dist-info → snapctl-0.49.5.dist-info}/METADATA +1 -1
- {snapctl-0.49.3.dist-info → snapctl-0.49.5.dist-info}/RECORD +10 -8
- {snapctl-0.49.3.dist-info → snapctl-0.49.5.dist-info}/LICENSE +0 -0
- {snapctl-0.49.3.dist-info → snapctl-0.49.5.dist-info}/WHEEL +0 -0
- {snapctl-0.49.3.dist-info → snapctl-0.49.5.dist-info}/entry_points.txt +0 -0
snapctl/commands/byows.py
CHANGED
|
@@ -99,11 +99,12 @@ class Byows:
|
|
|
99
99
|
def _get_export_commands(snap_ids, port):
|
|
100
100
|
'''
|
|
101
101
|
Generate export commands for the given snap IDs and port.
|
|
102
|
+
Replace hyphens with underscores in environment variable names.
|
|
102
103
|
'''
|
|
103
104
|
env_vars = []
|
|
104
105
|
|
|
105
106
|
for snap_id in snap_ids:
|
|
106
|
-
upper_id = snap_id.upper()
|
|
107
|
+
upper_id = snap_id.upper().replace("-", "_")
|
|
107
108
|
env_vars.append(f"SNAPEND_{upper_id}_GRPC_URL=localhost:{port}")
|
|
108
109
|
env_vars.append(
|
|
109
110
|
f"SNAPEND_{upper_id}_HTTP_URL=http://localhost:{port}")
|
|
@@ -121,11 +122,12 @@ class Byows:
|
|
|
121
122
|
def _generate_env_file(snap_ids, port):
|
|
122
123
|
'''
|
|
123
124
|
Generate an environment file with the given snap IDs and port.
|
|
125
|
+
Replace hyphens with underscores in environment variable names.
|
|
124
126
|
'''
|
|
125
127
|
env_lines = []
|
|
126
128
|
|
|
127
129
|
for snap_id in snap_ids:
|
|
128
|
-
upper_id = snap_id.upper()
|
|
130
|
+
upper_id = snap_id.upper().replace("-", "_")
|
|
129
131
|
env_lines.append(
|
|
130
132
|
f"export SNAPEND_{upper_id}_GRPC_URL=localhost:{port}")
|
|
131
133
|
env_lines.append(
|
snapctl/commands/snapend.py
CHANGED
|
@@ -22,7 +22,7 @@ from snapctl.config.constants import SERVER_CALL_TIMEOUT, SNAPCTL_INPUT_ERROR, \
|
|
|
22
22
|
SNAPCTL_SNAPEND_APPLY_MANIFEST_MISMATCH_ERROR
|
|
23
23
|
from snapctl.config.hashes import PROTOS_TYPES, CLIENT_SDK_TYPES, SERVER_SDK_TYPES, \
|
|
24
24
|
SNAPEND_MANIFEST_TYPES, SDK_TYPES, SDK_ACCESS_AUTH_TYPE_LOOKUP
|
|
25
|
-
from snapctl.utils.echo import error, success, info
|
|
25
|
+
from snapctl.utils.echo import error, success, info, warning
|
|
26
26
|
from snapctl.utils.helper import snapctl_error, snapctl_success
|
|
27
27
|
|
|
28
28
|
|
|
@@ -84,17 +84,21 @@ class Snapend:
|
|
|
84
84
|
self.manifest_path_filename: Union[str, None] = manifest_path_filename
|
|
85
85
|
self.force: bool = force
|
|
86
86
|
self.category: str = category
|
|
87
|
-
self.portal_category: Union[str, None] = Snapend._make_portal_category(
|
|
88
|
-
category_format)
|
|
89
87
|
self.category_format: str = category_format
|
|
90
88
|
self.category_type: Union[str, None] = category_type
|
|
91
89
|
self.category_http_lib: Union[str, None] = category_http_lib
|
|
92
|
-
self.download_types: Union[
|
|
93
|
-
Dict[str, Dict[str, str]], None
|
|
94
|
-
] = Snapend._make_download_type(category)
|
|
95
90
|
self.out_path: Union[str, None] = out_path
|
|
96
91
|
self.snaps: Union[str, None] = snaps
|
|
92
|
+
self.blocking: bool = blocking
|
|
97
93
|
# Values below are derived values
|
|
94
|
+
# portal_category: This is purely because we have simplified the input for the user
|
|
95
|
+
# Only used for a reverse lookup to pass the category to the portal server
|
|
96
|
+
self.portal_category: Union[str, None] = Snapend._make_portal_category(
|
|
97
|
+
category_format)
|
|
98
|
+
# download_types: This stores our own internal mapping of the category to the type
|
|
99
|
+
self.download_types: Union[
|
|
100
|
+
Dict[str, Dict[str, str]], None
|
|
101
|
+
] = Snapend._make_download_type(category)
|
|
98
102
|
self.manifest_file_name: Union[str, None] = Snapend._get_manifest_file_name(
|
|
99
103
|
manifest_path_filename
|
|
100
104
|
)
|
|
@@ -102,7 +106,6 @@ class Snapend:
|
|
|
102
106
|
byosnaps) if byosnaps else None
|
|
103
107
|
self.byogs_list: Union[str, None] = Snapend._make_byogs_list(
|
|
104
108
|
byogs) if byogs else None
|
|
105
|
-
self.blocking: bool = blocking
|
|
106
109
|
# Validate input
|
|
107
110
|
self.validate_input()
|
|
108
111
|
|
|
@@ -127,6 +130,10 @@ class Snapend:
|
|
|
127
130
|
return 'client-sdk'
|
|
128
131
|
if category_format in SERVER_SDK_TYPES:
|
|
129
132
|
return 'server-sdk'
|
|
133
|
+
if category_format in PROTOS_TYPES:
|
|
134
|
+
return 'protos'
|
|
135
|
+
if category_format in SNAPEND_MANIFEST_TYPES:
|
|
136
|
+
return 'snapend-manifest'
|
|
130
137
|
return None
|
|
131
138
|
|
|
132
139
|
@staticmethod
|
|
@@ -240,6 +247,8 @@ class Snapend:
|
|
|
240
247
|
# Customize snaps
|
|
241
248
|
if self.snaps:
|
|
242
249
|
url += f"&snaps={self.snaps}"
|
|
250
|
+
if "None" in url:
|
|
251
|
+
warning('Detecting a potential issue in the download URL.')
|
|
243
252
|
res = requests.get(
|
|
244
253
|
url, headers={'api-key': self.api_key}, timeout=SERVER_CALL_TIMEOUT
|
|
245
254
|
)
|
|
@@ -391,8 +400,14 @@ class Snapend:
|
|
|
391
400
|
code=SNAPCTL_INPUT_ERROR)
|
|
392
401
|
if self.category not in Snapend.DOWNLOAD_TYPE_NOT_REQUIRED and \
|
|
393
402
|
(self.download_types is None or self.category_format not in self.download_types):
|
|
403
|
+
message = "Invalid format. Valid formats are " + \
|
|
404
|
+
"(req: --category sdk|protos|snapend-manifest --format " + \
|
|
405
|
+
"sdk(" + ", ".join(SDK_TYPES.keys()) + \
|
|
406
|
+
") | protos(" + ", ".join(PROTOS_TYPES.keys()) + ")" + \
|
|
407
|
+
") | snapend-manifest(" + \
|
|
408
|
+
", ".join(SNAPEND_MANIFEST_TYPES.keys()) + ")"
|
|
394
409
|
snapctl_error(
|
|
395
|
-
message=
|
|
410
|
+
message=message, code=SNAPCTL_INPUT_ERROR)
|
|
396
411
|
# Check the Protos category
|
|
397
412
|
if self.category == 'protos' and self.category_type not in Snapend.CATEGORY_TYPE_PROTOS:
|
|
398
413
|
snapctl_error(
|
snapctl/config/constants.py
CHANGED
|
@@ -3,13 +3,13 @@ snapctl/__main__.py,sha256=43jKoTk8b85hk_MT6499N3ruHdEfM8WBImd_-3VzjI8,116
|
|
|
3
3
|
snapctl/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
snapctl/commands/byogs.py,sha256=WumLZRriCVF0SSnMn8TUL--iWhh3Yub3yQ-jz30faI0,19486
|
|
5
5
|
snapctl/commands/byosnap.py,sha256=9Xe75VAi-KPFALSleUyMJsrvDJEG6cxBiGiF267PSJA,76897
|
|
6
|
-
snapctl/commands/byows.py,sha256=
|
|
6
|
+
snapctl/commands/byows.py,sha256=xmvTsWGjp3CkIvMj3LdVJO02P5W0-HfWqsP2pf9tsXE,18519
|
|
7
7
|
snapctl/commands/game.py,sha256=lAABIWIibrwcqvpKvTy_7UzzLtbiP6gdk4_qPBHFKOI,5248
|
|
8
8
|
snapctl/commands/generate.py,sha256=9-NlZVQllBT2LZT_t9S3ztwtHzTbM-C8_x0f6z70U3g,5606
|
|
9
9
|
snapctl/commands/release_notes.py,sha256=QlhBlywLiRTKBs3SlaxHf-0E0OEU_47Xjld9gGtj4Zw,1943
|
|
10
|
-
snapctl/commands/snapend.py,sha256=
|
|
10
|
+
snapctl/commands/snapend.py,sha256=lcg9HlgQ9YedP-GmNEZQz8UeIPmfa49KtLRgeeHyaCo,40310
|
|
11
11
|
snapctl/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
snapctl/config/constants.py,sha256=
|
|
12
|
+
snapctl/config/constants.py,sha256=9A7Ktr2fZ4O8ugnLMKUnMV01znnrKlfXGlJU4SOpy3Q,3716
|
|
13
13
|
snapctl/config/endpoints.py,sha256=jD0n5ocJBbIkrb97F2_r9hqAHzUuddAqzqqBAPUKDTI,477
|
|
14
14
|
snapctl/config/hashes.py,sha256=3OKAyOxQPnn--_hvPIzFJnhC8NVfQK4WT-RH4PHEV1w,5242
|
|
15
15
|
snapctl/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -28,14 +28,16 @@ snapctl/data/releases/beta-0.49.0.mdx,sha256=pqJP7NfM3ZMxs4SoeANCdDqTxjR9IBGbBI3
|
|
|
28
28
|
snapctl/data/releases/beta-0.49.1.mdx,sha256=4EXupEegYffnL5bu_XWxGbzIPp9xOzl7t4xbmhq52fU,200
|
|
29
29
|
snapctl/data/releases/beta-0.49.2.mdx,sha256=Vv_OIQyPieEGI9FgTUT0v5Gm0PC2JWa2FqcCUhnvx6s,176
|
|
30
30
|
snapctl/data/releases/beta-0.49.3.mdx,sha256=XmSfpiH-LqvKS2REJ5FGDcLgyEN-OcSzwrXNI_EhiGc,234
|
|
31
|
+
snapctl/data/releases/beta-0.49.4.mdx,sha256=olSEvzwrBgp6TfVYehYslhGrjLXz1EcybTmbXUmtA18,161
|
|
32
|
+
snapctl/data/releases/beta-0.49.5.mdx,sha256=I_NdMkfxtFUOhUQgCUfcnY1YraFim4eAtRYq5g0dJqs,138
|
|
31
33
|
snapctl/main.py,sha256=6EDEQlcF3GPSqH3-Ezl7bkI33ZKaFR_c55B0Dkt0pDM,25212
|
|
32
34
|
snapctl/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
35
|
snapctl/types/definitions.py,sha256=EQzLeiXkJ8ISRlCqHMviNVsWWpmhWjpKaOBLdlvOTmY,644
|
|
34
36
|
snapctl/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
37
|
snapctl/utils/echo.py,sha256=V0qgjqqGXRiueMkq31enmNmdqciC8S90qGRcK8UupXA,1090
|
|
36
38
|
snapctl/utils/helper.py,sha256=7ugGs1GE7Rywf1-tQxrgqXUU97EQYFjS3JUDpk9SX_Q,6850
|
|
37
|
-
snapctl-0.49.
|
|
38
|
-
snapctl-0.49.
|
|
39
|
-
snapctl-0.49.
|
|
40
|
-
snapctl-0.49.
|
|
41
|
-
snapctl-0.49.
|
|
39
|
+
snapctl-0.49.5.dist-info/LICENSE,sha256=6AcXm54KFSpmUI1ji9NIBd4Xl-DtjTqiyjBzfVb_CEk,2804
|
|
40
|
+
snapctl-0.49.5.dist-info/METADATA,sha256=LTqz4qckGzXeP20E2jP_ZtiVxIrNyjoQGA4NKDGMN5Y,36275
|
|
41
|
+
snapctl-0.49.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
42
|
+
snapctl-0.49.5.dist-info/entry_points.txt,sha256=tkKW9MzmFdRs6Bgkv29G78i9WEBK4WIOWunPfe3t2Wg,44
|
|
43
|
+
snapctl-0.49.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|