cylera-cli 1.3.0__tar.gz → 1.3.1__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.0 → cylera_cli-1.3.1}/PKG-INFO +1 -1
- {cylera_cli-1.3.0 → cylera_cli-1.3.1}/cylera.py +26 -23
- {cylera_cli-1.3.0 → cylera_cli-1.3.1}/cylera_cli.egg-info/PKG-INFO +1 -1
- {cylera_cli-1.3.0 → cylera_cli-1.3.1}/pyproject.toml +1 -1
- {cylera_cli-1.3.0 → cylera_cli-1.3.1}/LICENSE +0 -0
- {cylera_cli-1.3.0 → cylera_cli-1.3.1}/README.md +0 -0
- {cylera_cli-1.3.0 → cylera_cli-1.3.1}/cylera_auth.py +0 -0
- {cylera_cli-1.3.0 → cylera_cli-1.3.1}/cylera_cli.egg-info/SOURCES.txt +0 -0
- {cylera_cli-1.3.0 → cylera_cli-1.3.1}/cylera_cli.egg-info/dependency_links.txt +0 -0
- {cylera_cli-1.3.0 → cylera_cli-1.3.1}/cylera_cli.egg-info/entry_points.txt +0 -0
- {cylera_cli-1.3.0 → cylera_cli-1.3.1}/cylera_cli.egg-info/requires.txt +0 -0
- {cylera_cli-1.3.0 → cylera_cli-1.3.1}/cylera_cli.egg-info/top_level.txt +0 -0
- {cylera_cli-1.3.0 → cylera_cli-1.3.1}/setup.cfg +0 -0
|
@@ -361,29 +361,32 @@ def switchorg(
|
|
|
361
361
|
require_config()
|
|
362
362
|
try:
|
|
363
363
|
with get_client() as client:
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
for
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
364
|
+
result = Organization(client).switch_organization(organization_id)
|
|
365
|
+
print_json(result)
|
|
366
|
+
|
|
367
|
+
current: dict[str, Any] = {}
|
|
368
|
+
for attempt in range(2):
|
|
369
|
+
print("Waiting for switch to take effect...", file=sys.stderr)
|
|
370
|
+
time.sleep(5)
|
|
371
|
+
# A new client each time: a token from before the switch keeps
|
|
372
|
+
# acting on the old organization, and one from a WorkOS sign-in
|
|
373
|
+
# can't be renewed in place, so it has to be exchanged again.
|
|
374
|
+
with get_client() as client:
|
|
375
|
+
current = Organization(client).get_organization()
|
|
376
|
+
if str(current.get("id", "")) == str(organization_id):
|
|
377
|
+
print(
|
|
378
|
+
f"Confirmed: now in org {current.get('name', organization_id)!r}",
|
|
379
|
+
file=sys.stderr,
|
|
380
|
+
)
|
|
381
|
+
return
|
|
382
|
+
if attempt == 0:
|
|
383
|
+
print("Not yet active, retrying...", file=sys.stderr)
|
|
384
|
+
|
|
385
|
+
print(
|
|
386
|
+
f"Warning: switch may still be pending. "
|
|
387
|
+
f"Current org: {current.get('name', 'unknown')!r}",
|
|
388
|
+
file=sys.stderr,
|
|
389
|
+
)
|
|
387
390
|
except CyleraAPIError as e:
|
|
388
391
|
print(f"API error: {e}", file=sys.stderr)
|
|
389
392
|
raise typer.Exit(1)
|
|
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
|