hcs-cli 0.1.315__py3-none-any.whl → 0.1.317__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_cli/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
- __version__ = "0.1.315"
1
+ __version__ = "0.1.317"
2
2
 
3
3
  from . import service
@@ -29,90 +29,96 @@ def deploy(data: dict, state: dict, save_state) -> dict:
29
29
  id = deployment["id"]
30
30
  providerLabel = data.get("providerLabel")
31
31
 
32
- def is_ready(s):
33
- return s in [
34
- "CREATE_PENDING",
35
- "CREATING",
36
- "READY",
37
- "POST_PROVISIONING_CONFIG_IN_PROGRESS",
38
- "UPDATE_PENDING",
39
- "UPDATING",
40
- "UPGRADE_PENDING",
41
- "UPGRADING",
42
- ]
43
-
44
- def is_error(s):
45
- return s.endswith("_FAILED") or s in [
46
- # 'CREATE_FAILED',
47
- "DELETED",
48
- # 'DELETE_FAILED',
49
- "DELETE_PENDING",
50
- "DELETING",
51
- "FORCE_DELETE_PENDING",
52
- "FORCE_DELETING",
53
- "FORCE_REPAIR_ACCEPTED",
54
- "FORCE_REPAIR_PENDING",
55
- # CONNECT_PENDING,
56
- # CREATE_ACCEPTED,
57
- # CREATE_FAILED,
58
- # CREATE_PENDING,
59
- # CREATING,
60
- "DELETED",
61
- # 'DELETE_FAILED',
62
- "DELETE_PENDING",
63
- "DELETING",
64
- "FORCE_DELETE_PENDING",
65
- "FORCE_DELETING",
66
- "FORCE_REPAIR_ACCEPTED",
67
- "FORCE_REPAIR_PENDING",
68
- # 'MIGRATE_FAILED',
69
- "MIGRATE_PENDING",
70
- "MIGRATING",
71
- # POST_PROVISIONING_CONFIG_IN_PROGRESS,
72
- # READY,
73
- "REPAIRING",
74
- "REPAIR_ACCEPTED",
75
- # 'REPAIR_FAILED',
76
- "REPAIR_PENDING",
77
- # 'UPDATE_FAILED',
78
- # 'UPDATE_PENDING',
79
- # 'UPDATING',
80
- # 'UPGRADE_FAILED',
81
- # 'UPGRADE_PENDING',
82
- # 'UPGRADING',
83
- ]
84
-
85
- def is_transition(s):
86
- return s.endswith("ING") or s in ["CREATE_ACCEPTED"]
87
-
88
- if providerLabel == "vsphere":
89
- polling_interval = "5s"
90
- timeout = "2m"
91
- elif providerLabel == "azure":
92
- # azure
93
- polling_interval = "1m"
94
- timeout = "20m"
95
- elif providerLabel == "akka":
96
- polling_interval = "5s"
97
- timeout = "2m"
32
+ _wait = data.get("_wait", True)
33
+
34
+ if _wait:
35
+
36
+ def is_ready(s):
37
+ return s in [
38
+ "CREATE_PENDING",
39
+ "CREATING",
40
+ "READY",
41
+ "POST_PROVISIONING_CONFIG_IN_PROGRESS",
42
+ "UPDATE_PENDING",
43
+ "UPDATING",
44
+ "UPGRADE_PENDING",
45
+ "UPGRADING",
46
+ ]
47
+
48
+ def is_error(s):
49
+ return s.endswith("_FAILED") or s in [
50
+ # 'CREATE_FAILED',
51
+ "DELETED",
52
+ # 'DELETE_FAILED',
53
+ "DELETE_PENDING",
54
+ "DELETING",
55
+ "FORCE_DELETE_PENDING",
56
+ "FORCE_DELETING",
57
+ "FORCE_REPAIR_ACCEPTED",
58
+ "FORCE_REPAIR_PENDING",
59
+ # CONNECT_PENDING,
60
+ # CREATE_ACCEPTED,
61
+ # CREATE_FAILED,
62
+ # CREATE_PENDING,
63
+ # CREATING,
64
+ "DELETED",
65
+ # 'DELETE_FAILED',
66
+ "DELETE_PENDING",
67
+ "DELETING",
68
+ "FORCE_DELETE_PENDING",
69
+ "FORCE_DELETING",
70
+ "FORCE_REPAIR_ACCEPTED",
71
+ "FORCE_REPAIR_PENDING",
72
+ # 'MIGRATE_FAILED',
73
+ "MIGRATE_PENDING",
74
+ "MIGRATING",
75
+ # POST_PROVISIONING_CONFIG_IN_PROGRESS,
76
+ # READY,
77
+ "REPAIRING",
78
+ "REPAIR_ACCEPTED",
79
+ # 'REPAIR_FAILED',
80
+ "REPAIR_PENDING",
81
+ # 'UPDATE_FAILED',
82
+ # 'UPDATE_PENDING',
83
+ # 'UPDATING',
84
+ # 'UPGRADE_FAILED',
85
+ # 'UPGRADE_PENDING',
86
+ # 'UPGRADING',
87
+ ]
88
+
89
+ def is_transition(s):
90
+ return s.endswith("ING") or s in ["CREATE_ACCEPTED"]
91
+
92
+ if providerLabel == "vsphere":
93
+ polling_interval = "5s"
94
+ timeout = "2m"
95
+ elif providerLabel == "azure":
96
+ # azure
97
+ polling_interval = "1m"
98
+ timeout = "20m"
99
+ elif providerLabel == "akka":
100
+ polling_interval = "5s"
101
+ timeout = "2m"
102
+ else:
103
+ polling_interval = "1m"
104
+ timeout = "20m"
105
+
106
+ try:
107
+ deployment = admin.edge.wait_for(
108
+ id,
109
+ org_id,
110
+ is_ready=is_ready,
111
+ is_error=is_error,
112
+ is_transition=is_transition,
113
+ polling_interval=polling_interval,
114
+ timeout=timeout,
115
+ )
116
+ except Exception as e:
117
+ deployment = admin.edge.get(id, org_id)
118
+ save_state(deployment)
119
+ raise PluginException("Error waiting for edge deployment. Status=" + deployment["status"]) from e
98
120
  else:
99
- polling_interval = "1m"
100
- timeout = "20m"
101
-
102
- try:
103
- deployment = admin.edge.wait_for(
104
- id,
105
- org_id,
106
- is_ready=is_ready,
107
- is_error=is_error,
108
- is_transition=is_transition,
109
- polling_interval=polling_interval,
110
- timeout=timeout,
111
- )
112
- except Exception as e:
113
- deployment = admin.edge.get(id, org_id)
114
- save_state(deployment)
115
- raise PluginException("Error waiting for edge deployment. Status=" + deployment["status"]) from e
121
+ pass # no wait
116
122
 
117
123
  site_id = data.get("siteId")
118
124
  if site_id:
@@ -2,7 +2,7 @@ import json
2
2
  import os
3
3
  import shlex
4
4
  import subprocess
5
- from typing import List, Tuple, Union
5
+ from typing import Any, List, Tuple, Union
6
6
 
7
7
  import click
8
8
 
@@ -18,7 +18,14 @@ def _split_command(cmd: Union[str, List[str]]) -> Tuple[List[str], str]:
18
18
 
19
19
 
20
20
  def exec(
21
- cmd, log_error=True, raise_on_error=True, inherit_output=False, cwd=None, input: str = None, show_command: bool = True, env: dict = None
21
+ cmd,
22
+ log_error=True,
23
+ raise_on_error=True,
24
+ inherit_output=False,
25
+ cwd=None,
26
+ input: Union[str, dict[Any, Any], list[Any]] = None,
27
+ show_command: bool = True,
28
+ env: dict = None,
22
29
  ):
23
30
  commands, cmd_text = _split_command(cmd)
24
31
  text = f"RUNNING: {cmd_text}"
@@ -55,7 +62,7 @@ def run_cli(
55
62
  output_json=False,
56
63
  raise_on_error=True,
57
64
  inherit_output: Union[bool, None] = None,
58
- input: str = None,
65
+ input: Union[str, dict[Any, Any], list[Any]] = None,
59
66
  show_command: bool = True,
60
67
  log_error: bool = True,
61
68
  env: dict = None,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hcs-cli
3
- Version: 0.1.315
3
+ Version: 0.1.317
4
4
  Summary: Horizon Cloud Service CLI.
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
@@ -14,7 +14,7 @@ Classifier: License :: OSI Approved :: MIT License
14
14
  Classifier: Operating System :: OS Independent
15
15
  Classifier: Programming Language :: Python :: 3
16
16
  Requires-Python: >=3.9
17
- Requires-Dist: hcs-core>=0.1.315
17
+ Requires-Dist: hcs-core>=0.1.317
18
18
  Requires-Dist: inquirerpy>=0.3.4
19
19
  Requires-Dist: matplotlib>=3.8.0
20
20
  Requires-Dist: paho-mqtt>=2.1.0
@@ -1,4 +1,4 @@
1
- hcs_cli/__init__.py,sha256=HpPkz1OWTqjWkMsif4IOB2b2XgE5McDpbjoGJhgMpFs,47
1
+ hcs_cli/__init__.py,sha256=kalA51nvL9r2WycXeW3H-kyqLPN91e0eb_ELOm5f-FM,47
2
2
  hcs_cli/__main__.py,sha256=lwPXLjh1OpOs4doVLJJ6_3XHtC-VqDOXiw45hvAQorM,684
3
3
  hcs_cli/main.py,sha256=87MoOqaYQ1V7m9LJbek3GR_RojErr4j6watZD8oenk0,3539
4
4
  hcs_cli/cmds/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -372,7 +372,7 @@ hcs_cli/provider/hcs/ad.py,sha256=Jseu9c8NMMukNz1S6LPq0XJqzACqttAOWgnP3ZQuBqs,19
372
372
  hcs_cli/provider/hcs/av_entitlement.py,sha256=e2p3BWhYSppthw4pGtd2UHQZeqdH08fqbPW9VhCYQZI,1318
373
373
  hcs_cli/provider/hcs/av_fs.py,sha256=UUke07p7cuUc_Kfoymz-EmO0YBj956PmGlYaKok9fB8,1647
374
374
  hcs_cli/provider/hcs/cert.py,sha256=KILh7DF6YTeQ_hr07zIBV0U5mHjtSQ28GhTRF8VyM4E,1631
375
- hcs_cli/provider/hcs/edge.py,sha256=GoT0duHVvCt_AOr1bkzjutxsAsy0hvWMY3hQOIPlHxQ,5477
375
+ hcs_cli/provider/hcs/edge.py,sha256=WfOCMnStlLWXeS_9aDIHDlyIzUv9lSsdLw3ubcrRlc0,5883
376
376
  hcs_cli/provider/hcs/entitlement.py,sha256=3LaNSLcVd9wY9AW2CzblR_0LpyuZVX3BmD4ij4U_YpI,1324
377
377
  hcs_cli/provider/hcs/gold_pattern.py,sha256=WvFRPNPgrXZdR_W_NN7D5ni803npVrZKJSmLH0wxdI0,2043
378
378
  hcs_cli/provider/hcs/identity_provider.py,sha256=kXsu8jhX77Fo_HSNd85V4sMd-uqD9QUm_yVcK0L6pyE,1415
@@ -475,7 +475,7 @@ hcs_cli/service/vmm/hoc_event.py,sha256=ukkfojIT6MwPxglKMGF8S3-Moa_K7hcRM3WrkrjA
475
475
  hcs_cli/support/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
476
476
  hcs_cli/support/constant.py,sha256=dVOiIaiH4rhC-cZJhTruXyv5ieS1j32YUhF8wEFjbEw,171
477
477
  hcs_cli/support/debug_util.py,sha256=Bb0gaYN8bSljXdFNnX3mElWWkL_lHP9lFEMP71LsIi0,2679
478
- hcs_cli/support/exec_util.py,sha256=PizPjM_DMyzoRDQCFOL1nyw-HNCTwicZ0mt2Qnv4Pb4,2996
478
+ hcs_cli/support/exec_util.py,sha256=Epa09iCouAky7NE17O5rG-q3vdw35XJzrIUitPStSsY,3098
479
479
  hcs_cli/support/inspect_util.py,sha256=weLylRM1_3O6nz0yUOiJUEBfR9TpUe-jpghmrQblSjE,3192
480
480
  hcs_cli/support/param_util.py,sha256=CHXWJvBF9EwFLYPn_CTOpFWdSyCP3w6iLlYByiz-nvE,1492
481
481
  hcs_cli/support/patch_util.py,sha256=r4IjpLA5yGqKer-wuSMB7d93BGPVnse_FhHcAxwYg7A,1524
@@ -489,7 +489,7 @@ hcs_cli/support/vm_table.py,sha256=aNyFtrQb2Cy4JBZx3sPt3_GpOHD7R6x4nITlwc9dZ4Q,2
489
489
  hcs_cli/support/scm/html_util.py,sha256=clgMpM90HxRRs3D9ORYYNB57AYh7y_-UzJrB4KX3dsY,458
490
490
  hcs_cli/support/scm/plan-editor.html.template,sha256=qXhHYjBsG8uaVlMkc0gnCePoSV3w5NyTkaLhXV9jlC0,26874
491
491
  hcs_cli/support/scm/plan_editor.py,sha256=pZtm9X_R-vs2JxJ_NX7-wTAoY-nhI-gFqhcyVDdEZVM,3108
492
- hcs_cli-0.1.315.dist-info/METADATA,sha256=M8ZNfiffa60yHr-KqnBStXM32oCsFmNMk7EXqAN2rGU,3568
493
- hcs_cli-0.1.315.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
494
- hcs_cli-0.1.315.dist-info/entry_points.txt,sha256=5uH-af1WUETSBSer2bu4YMGQNY5RriJHsjepb8ACiX8,42
495
- hcs_cli-0.1.315.dist-info/RECORD,,
492
+ hcs_cli-0.1.317.dist-info/METADATA,sha256=HMB8zm8jPlN3k2sXbJDFcC98-xfhppGUM5hdm4N2eqs,3568
493
+ hcs_cli-0.1.317.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
494
+ hcs_cli-0.1.317.dist-info/entry_points.txt,sha256=5uH-af1WUETSBSer2bu4YMGQNY5RriJHsjepb8ACiX8,42
495
+ hcs_cli-0.1.317.dist-info/RECORD,,