cylera-cli 1.3.1__tar.gz → 1.3.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.
- {cylera_cli-1.3.1 → cylera_cli-1.3.2}/PKG-INFO +1 -1
- {cylera_cli-1.3.1 → cylera_cli-1.3.2}/cylera.py +12 -3
- {cylera_cli-1.3.1 → cylera_cli-1.3.2}/cylera_cli.egg-info/PKG-INFO +1 -1
- {cylera_cli-1.3.1 → cylera_cli-1.3.2}/pyproject.toml +1 -1
- {cylera_cli-1.3.1 → cylera_cli-1.3.2}/LICENSE +0 -0
- {cylera_cli-1.3.1 → cylera_cli-1.3.2}/README.md +0 -0
- {cylera_cli-1.3.1 → cylera_cli-1.3.2}/cylera_auth.py +0 -0
- {cylera_cli-1.3.1 → cylera_cli-1.3.2}/cylera_cli.egg-info/SOURCES.txt +0 -0
- {cylera_cli-1.3.1 → cylera_cli-1.3.2}/cylera_cli.egg-info/dependency_links.txt +0 -0
- {cylera_cli-1.3.1 → cylera_cli-1.3.2}/cylera_cli.egg-info/entry_points.txt +0 -0
- {cylera_cli-1.3.1 → cylera_cli-1.3.2}/cylera_cli.egg-info/requires.txt +0 -0
- {cylera_cli-1.3.1 → cylera_cli-1.3.2}/cylera_cli.egg-info/top_level.txt +0 -0
- {cylera_cli-1.3.1 → cylera_cli-1.3.2}/setup.cfg +0 -0
|
@@ -361,7 +361,16 @@ def switchorg(
|
|
|
361
361
|
require_config()
|
|
362
362
|
try:
|
|
363
363
|
with get_client() as client:
|
|
364
|
-
|
|
364
|
+
org_api = Organization(client)
|
|
365
|
+
# GET /organization/ doesn't return the id switching takes (a
|
|
366
|
+
# mapping id, not the organization's), so the switch is
|
|
367
|
+
# confirmed by the target's name.
|
|
368
|
+
target_name = next(
|
|
369
|
+
(o.get("name") for o in org_api.get_available_organizations()
|
|
370
|
+
if str(o.get("id")) == str(organization_id)),
|
|
371
|
+
None,
|
|
372
|
+
)
|
|
373
|
+
result = org_api.switch_organization(organization_id)
|
|
365
374
|
print_json(result)
|
|
366
375
|
|
|
367
376
|
current: dict[str, Any] = {}
|
|
@@ -373,9 +382,9 @@ def switchorg(
|
|
|
373
382
|
# can't be renewed in place, so it has to be exchanged again.
|
|
374
383
|
with get_client() as client:
|
|
375
384
|
current = Organization(client).get_organization()
|
|
376
|
-
if
|
|
385
|
+
if target_name is not None and current.get("name") == target_name:
|
|
377
386
|
print(
|
|
378
|
-
f"Confirmed: now in org {
|
|
387
|
+
f"Confirmed: now in org {target_name!r}",
|
|
379
388
|
file=sys.stderr,
|
|
380
389
|
)
|
|
381
390
|
return
|
|
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
|