hcs-core 0.1.306__tar.gz → 0.1.308__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.
Files changed (71) hide show
  1. {hcs_core-0.1.306 → hcs_core-0.1.308}/PKG-INFO +1 -1
  2. hcs_core-0.1.308/hcs_core/__init__.py +1 -0
  3. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/sglib/client_util.py +28 -15
  4. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/sglib/login_support.py +1 -1
  5. hcs_core-0.1.306/hcs_core/__init__.py +0 -1
  6. {hcs_core-0.1.306 → hcs_core-0.1.308}/.gitignore +0 -0
  7. {hcs_core-0.1.306 → hcs_core-0.1.308}/README.md +0 -0
  8. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/__init__.py +0 -0
  9. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/_init.py +0 -0
  10. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/built_in_cmds/__init__.py +0 -0
  11. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/built_in_cmds/_ut.py +0 -0
  12. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/built_in_cmds/context.py +0 -0
  13. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/built_in_cmds/profile.py +0 -0
  14. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/cli_options.py +0 -0
  15. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/cli_processor.py +0 -0
  16. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/cmd_util.py +0 -0
  17. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/config.py +0 -0
  18. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/context.py +0 -0
  19. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/data_util.py +0 -0
  20. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/dispatcher.py +0 -0
  21. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/duration.py +0 -0
  22. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/extension.py +0 -0
  23. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/fn_util.py +0 -0
  24. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/fstore.py +0 -0
  25. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/jsondot.py +0 -0
  26. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/logger.py +0 -0
  27. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/profile.py +0 -0
  28. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/profile_store.py +0 -0
  29. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/recent.py +0 -0
  30. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/state.py +0 -0
  31. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/task_schd.py +0 -0
  32. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/telemetry.py +0 -0
  33. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/template_util.py +0 -0
  34. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/timeutil.py +0 -0
  35. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/util.py +0 -0
  36. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/ctxp/var_template.py +0 -0
  37. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/plan/__init__.py +0 -0
  38. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/plan/actions.py +0 -0
  39. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/plan/base_provider.py +0 -0
  40. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/plan/context.py +0 -0
  41. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/plan/core.py +0 -0
  42. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/plan/dag.py +0 -0
  43. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/plan/helper.py +0 -0
  44. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/plan/kop.py +0 -0
  45. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/plan/provider/__init__.py +0 -0
  46. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/plan/provider/dev/__init__.py +0 -0
  47. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/plan/provider/dev/_prepare.py +0 -0
  48. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/plan/provider/dev/dummy.py +0 -0
  49. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/plan/provider/dev/fibonacci.py +0 -0
  50. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/sglib/__init__.py +0 -0
  51. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/sglib/auth.py +0 -0
  52. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/sglib/cli_options.py +0 -0
  53. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/sglib/csp.py +0 -0
  54. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/sglib/ez_client.py +0 -0
  55. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/sglib/hcs_client.py +0 -0
  56. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/sglib/init.py +0 -0
  57. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/sglib/payload_util.py +0 -0
  58. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/sglib/requtil.py +0 -0
  59. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/sglib/utils.py +0 -0
  60. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/util/__init__.py +0 -0
  61. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/util/check_license.py +0 -0
  62. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/util/duration.py +0 -0
  63. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/util/exit.py +0 -0
  64. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/util/hcs_constants.py +0 -0
  65. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/util/job_view.py +0 -0
  66. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/util/pki_util.py +0 -0
  67. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/util/query_util.py +0 -0
  68. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/util/scheduler.py +0 -0
  69. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/util/ssl_util.py +0 -0
  70. {hcs_core-0.1.306 → hcs_core-0.1.308}/hcs_core/util/versions.py +0 -0
  71. {hcs_core-0.1.306 → hcs_core-0.1.308}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hcs-core
3
- Version: 0.1.306
3
+ Version: 0.1.308
4
4
  Summary: Horizon Cloud Service CLI module.
5
5
  Project-URL: Homepage, https://github.com/euc-eng/hcs-cli
6
6
  Project-URL: Bug Tracker, https://github.com/euc-eng/hcs-cli/issues
@@ -0,0 +1 @@
1
+ __version__ = "0.1.308"
@@ -288,10 +288,13 @@ def wait_for_res_deleted(
288
288
  resource_name: str,
289
289
  fn_get: Callable,
290
290
  timeout: str,
291
- polling_interval_seconds: int = 10,
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
- exit.sleep(sleep_seconds)
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
- is_ready = lambda s: s in status_map["ready"]
353
- is_error = lambda s: s in status_map["error"]
354
- is_transition = lambda s: s in status_map["transition"]
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"Status error. Actual={status}"
372
- if status_map:
373
- msg += f", expected={status_map['ready']}"
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
- raise TimeoutError(prefix + "Timeout.")
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
@@ -61,7 +61,7 @@ _auth_success_html = """
61
61
  </style>
62
62
  </head>
63
63
  <body>
64
- <h3>You have successfully logged into VMware Horizon Cloud Service.</h3>
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 +0,0 @@
1
- __version__ = "0.1.306"
File without changes
File without changes
File without changes