hcs-core 0.1.306__py3-none-any.whl → 0.1.308__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.
- hcs_core/__init__.py +1 -1
- hcs_core/sglib/client_util.py +28 -15
- hcs_core/sglib/login_support.py +1 -1
- {hcs_core-0.1.306.dist-info → hcs_core-0.1.308.dist-info}/METADATA +1 -1
- {hcs_core-0.1.306.dist-info → hcs_core-0.1.308.dist-info}/RECORD +6 -6
- {hcs_core-0.1.306.dist-info → hcs_core-0.1.308.dist-info}/WHEEL +0 -0
hcs_core/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.308"
|
hcs_core/sglib/client_util.py
CHANGED
|
@@ -288,10 +288,13 @@ def wait_for_res_deleted(
|
|
|
288
288
|
resource_name: str,
|
|
289
289
|
fn_get: Callable,
|
|
290
290
|
timeout: str,
|
|
291
|
-
|
|
291
|
+
polling_interval: int = 10,
|
|
292
292
|
fn_is_error: Callable = None,
|
|
293
293
|
):
|
|
294
294
|
timeout_seconds = _parse_timeout(timeout)
|
|
295
|
+
polling_interval_seconds = _parse_timeout(polling_interval)
|
|
296
|
+
if polling_interval_seconds < 3:
|
|
297
|
+
polling_interval_seconds = 3
|
|
295
298
|
start = time.time()
|
|
296
299
|
while True:
|
|
297
300
|
t = fn_get()
|
|
@@ -310,7 +313,7 @@ def wait_for_res_deleted(
|
|
|
310
313
|
sleep_seconds = remaining_seconds
|
|
311
314
|
if sleep_seconds > polling_interval_seconds:
|
|
312
315
|
sleep_seconds = polling_interval_seconds
|
|
313
|
-
|
|
316
|
+
time.sleep(sleep_seconds)
|
|
314
317
|
|
|
315
318
|
|
|
316
319
|
# flake8: noqa=E731
|
|
@@ -337,21 +340,25 @@ def wait_for_res_status(
|
|
|
337
340
|
field_name = get_status
|
|
338
341
|
get_status = lambda t: t[field_name]
|
|
339
342
|
if status_map:
|
|
340
|
-
if isinstance(status_map["ready"], str):
|
|
341
|
-
status_map["ready"] = [status_map["ready"]]
|
|
342
|
-
if isinstance(status_map["transition"], str):
|
|
343
|
-
status_map["transition"] = [status_map["transition"]]
|
|
344
|
-
if isinstance(status_map["error"], str):
|
|
345
|
-
status_map["error"] = [status_map["error"]]
|
|
346
343
|
if is_ready:
|
|
347
344
|
raise CtxpException("Can not specify is_ready when status_map is provided.")
|
|
348
345
|
if is_error:
|
|
349
346
|
raise CtxpException("Can not specify is_error when status_map is provided.")
|
|
350
347
|
if is_transition:
|
|
351
348
|
raise CtxpException("Can not specify is_transition when status_map is provided.")
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
349
|
+
|
|
350
|
+
ready_status = status_map["ready"]
|
|
351
|
+
error_status = status_map["error"]
|
|
352
|
+
transition_status = status_map["transition"]
|
|
353
|
+
if isinstance(ready_status, str):
|
|
354
|
+
ready_status = [ready_status]
|
|
355
|
+
if isinstance(error_status, str):
|
|
356
|
+
error_status = [error_status]
|
|
357
|
+
if isinstance(transition_status, str):
|
|
358
|
+
transition_status = [transition_status]
|
|
359
|
+
is_ready = lambda s: s in ready_status
|
|
360
|
+
is_error = lambda s: error_status is None or s in error_status
|
|
361
|
+
is_transition = lambda s: transition_status is None or s in transition_status
|
|
355
362
|
else:
|
|
356
363
|
if not is_ready:
|
|
357
364
|
raise CtxpException("Either status_map or is_ready must be specified.")
|
|
@@ -359,6 +366,9 @@ def wait_for_res_status(
|
|
|
359
366
|
raise CtxpException("Either status_map or is_error must be specified.")
|
|
360
367
|
if not is_transition:
|
|
361
368
|
raise CtxpException("Either status_map or is_transition must be specified.")
|
|
369
|
+
ready_status = None
|
|
370
|
+
error_status = None
|
|
371
|
+
transition_status = None
|
|
362
372
|
|
|
363
373
|
while True:
|
|
364
374
|
t = fn_get()
|
|
@@ -368,9 +378,9 @@ def wait_for_res_status(
|
|
|
368
378
|
raise CtxpException(prefix + "Not found.")
|
|
369
379
|
status = get_status(t)
|
|
370
380
|
if is_error(status):
|
|
371
|
-
msg = prefix + f"
|
|
372
|
-
if
|
|
373
|
-
msg += f", expected={
|
|
381
|
+
msg = prefix + f"Unexpected terminal state. Actual={status}"
|
|
382
|
+
if ready_status:
|
|
383
|
+
msg += f", expected={ready_status}"
|
|
374
384
|
print("-- DUMP START --", file=sys.stderr)
|
|
375
385
|
print(json.dumps(t, indent=4), file=sys.stderr)
|
|
376
386
|
print("-- DUMP END --", file=sys.stderr)
|
|
@@ -383,7 +393,10 @@ def wait_for_res_status(
|
|
|
383
393
|
now = time.time()
|
|
384
394
|
remaining_seconds = timeout_seconds - (now - start)
|
|
385
395
|
if remaining_seconds < 1:
|
|
386
|
-
|
|
396
|
+
msg = prefix + f"Timeout. Current: {status}."
|
|
397
|
+
if ready_status:
|
|
398
|
+
msg += f" Expected: {ready_status}."
|
|
399
|
+
raise TimeoutError(msg)
|
|
387
400
|
sleep_seconds = remaining_seconds
|
|
388
401
|
if sleep_seconds > polling_interval_seconds:
|
|
389
402
|
sleep_seconds = polling_interval_seconds
|
hcs_core/sglib/login_support.py
CHANGED
|
@@ -61,7 +61,7 @@ _auth_success_html = """
|
|
|
61
61
|
</style>
|
|
62
62
|
</head>
|
|
63
63
|
<body>
|
|
64
|
-
<h3>You have successfully logged into
|
|
64
|
+
<h3>You have successfully logged into Omnissa Horizon Cloud Service.</h3>
|
|
65
65
|
<p>You can close this window, and return to the terminal.</p>
|
|
66
66
|
<br/>
|
|
67
67
|
<p><a href="https://github.com/euc-eng/hcs-cli/blob/dev/README.md">HCS CLI</a> is in beta. <a href="https://github.com/euc-eng/hcs-cli/blob/main/doc/hcs-cli-cheatsheet.md">Cheatsheet</a>:</p>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
hcs_core/__init__.py,sha256=
|
|
1
|
+
hcs_core/__init__.py,sha256=qSc0Z_CWHIMdNw3OW6HVtxiJ07LV2FgD_5oaAcFDSQc,24
|
|
2
2
|
hcs_core/ctxp/__init__.py,sha256=bHVHhJP10Luz1a3Kk3zFx14dAO4SY6Q20Lrv8rNWWGc,1075
|
|
3
3
|
hcs_core/ctxp/_init.py,sha256=fMcRMPfJx-N0c-u0Zj2sFVKQL1-lWQd28gooAZETGUA,2933
|
|
4
4
|
hcs_core/ctxp/cli_options.py,sha256=cwlUgYXzIie9eRcu8fkBo_iFvC8LhflKGblWYtM2Hto,2739
|
|
@@ -44,12 +44,12 @@ hcs_core/plan/provider/dev/fibonacci.py,sha256=8WhDr5c9harNAlVPZomQJEqbWe0hUqbpp
|
|
|
44
44
|
hcs_core/sglib/__init__.py,sha256=oT0etW7vsEbHlXiGL5x23ZXyyFqeLi81RxQQ5lfKSV0,654
|
|
45
45
|
hcs_core/sglib/auth.py,sha256=r9zgLdnybuHsf3_j6nTP4SGoS2dD3keYZ-c25o2Mx64,6766
|
|
46
46
|
hcs_core/sglib/cli_options.py,sha256=dEoUllUs_N97jGtc3mccNgbkVJILfuJR4FHSuVGmSf0,2438
|
|
47
|
-
hcs_core/sglib/client_util.py,sha256=
|
|
47
|
+
hcs_core/sglib/client_util.py,sha256=4YH-QoqkpF2DtXhemYx4vM19YBzUWk4iNL2BvYLTDmg,14617
|
|
48
48
|
hcs_core/sglib/csp.py,sha256=UcO68YtLOPDQWiTjPVIPwQ2Z-Mywc-154aoIkLdyzwE,10991
|
|
49
49
|
hcs_core/sglib/ez_client.py,sha256=dWQx-EMTrySz1EVzsSu4ZezORR3_iEOAcZigtbuvIQ8,8404
|
|
50
50
|
hcs_core/sglib/hcs_client.py,sha256=pjrAVQDEy2tiQMypMpOzODFntT6aNHXjje8or_mkL2U,804
|
|
51
51
|
hcs_core/sglib/init.py,sha256=w_0ZU70Q1TGbSZsqSi7ewKQqpExFlepOT7mIqH0wnho,310
|
|
52
|
-
hcs_core/sglib/login_support.py,sha256=
|
|
52
|
+
hcs_core/sglib/login_support.py,sha256=unwzx8_W8knWqSm-jN9wFzkQGpw4U5z4kfzKb_Sjlvw,7575
|
|
53
53
|
hcs_core/sglib/payload_util.py,sha256=Hnj7rjzrQ1j5gpbrwZX34biN8MIZjy6dOJZ63ulmzdw,685
|
|
54
54
|
hcs_core/sglib/requtil.py,sha256=O37DrD4VVBmmRkkHJLbDtPfFq8l6fLZwYZggt2FTEFc,920
|
|
55
55
|
hcs_core/sglib/utils.py,sha256=8a-e-nUhAbulZtV05CB5loov6Kgq8_Q0TxYwfvu7Bj8,3178
|
|
@@ -64,6 +64,6 @@ hcs_core/util/query_util.py,sha256=uYfcEF_00eUs_S5OK64zpH0cnb6dwy91_J1OY5ZrFVs,3
|
|
|
64
64
|
hcs_core/util/scheduler.py,sha256=bPpCmGUL1UctJMfLPAg-h4Hl2YZr96FiI78-G_Usn08,2958
|
|
65
65
|
hcs_core/util/ssl_util.py,sha256=MvU102fGwWWh9hhSmLnn1qQIWuD6TjZnN0iH0MXUtW0,1239
|
|
66
66
|
hcs_core/util/versions.py,sha256=6nyyZzi3P69WQfioPc2_YWZQcUc13mC1eKoK58b3WUQ,1709
|
|
67
|
-
hcs_core-0.1.
|
|
68
|
-
hcs_core-0.1.
|
|
69
|
-
hcs_core-0.1.
|
|
67
|
+
hcs_core-0.1.308.dist-info/METADATA,sha256=JuZytTkuXr8DG9TFxm0YaGbV7mXY2BKdDsutxbr8D0c,1951
|
|
68
|
+
hcs_core-0.1.308.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
69
|
+
hcs_core-0.1.308.dist-info/RECORD,,
|
|
File without changes
|