Skip to content

Commit b7e714f

Browse files
committed
Revert "poll for process-executions instead of process"
This reverts commit f533b0a.
1 parent f533b0a commit b7e714f

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

netfoundry/network.py

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -669,22 +669,22 @@ def create_endpoint(self, name: str, attributes: list=[], session_identity: str=
669669
# frame
670670
if wait:
671671
try:
672-
self.wait_for_status(expect="SUCCESS",type="process-executions", id=process_id, wait=wait, sleep=sleep, progress=progress)
672+
self.wait_for_status(expect="FINISHED",type="process", id=process_id, wait=wait, sleep=sleep, progress=progress)
673673
except:
674-
raise Exception("ERROR: timed out waiting for process status 'SUCCESS'")
674+
raise Exception("ERROR: timed out waiting for process status 'FINISHED'")
675675
try:
676676
# this may be redundant, but in any case was already present as a mechanism for fetching the finished entity,
677-
# and may still serve as insurance that the zitiId is in fact defined when process status is SUCCESS
677+
# and may still serve as insurance that the zitiId is in fact defined when process status is FINISHED
678678
finished = self.wait_for_property_defined(property_name="zitiId", property_type=str, entity_type="endpoint",
679679
id=started['id'], wait=3, sleep=1)
680680
except:
681681
raise Exception("ERROR: timed out waiting for property 'zitiId' to be defined")
682682
return(finished)
683683
else:
684684
try:
685-
self.wait_for_statuses(expected_statuses=["RUNNING","SUCCESS"],type="process-executions", id=process_id, wait=5, sleep=2, progress=progress)
685+
self.wait_for_statuses(expected_statuses=["STARTED","FINISHED"],type="process", id=process_id, wait=5, sleep=2, progress=progress)
686686
except:
687-
raise Exception("ERROR: timed out waiting for process status 'RUNNING' or 'SUCCESS'")
687+
raise Exception("ERROR: timed out waiting for process status 'STARTED' or 'FINISHED'")
688688
return(started)
689689

690690
def create_edge_router(self, name: str, attributes: list=[], link_listener: bool=False, data_center_id: str=None,
@@ -753,12 +753,12 @@ def create_edge_router(self, name: str, attributes: list=[], link_listener: bool
753753
# frame
754754
if wait:
755755
try:
756-
self.wait_for_status(expect="SUCCESS",type="process-executions", id=process_id, wait=wait, sleep=sleep, progress=progress)
756+
self.wait_for_status(expect="FINISHED",type="process", id=process_id, wait=wait, sleep=sleep, progress=progress)
757757
except:
758-
raise Exception("ERROR: timed out waiting for process status 'SUCCESS'")
758+
raise Exception("ERROR: timed out waiting for process status 'FINISHED'")
759759
try:
760760
# this may be redundant, but in any case was already present as a mechanism for fetching the finished entity,
761-
# and may still serve as insurance that the zitiId is in fact defined when process status is SUCCESS
761+
# and may still serve as insurance that the zitiId is in fact defined when process status is FINISHED
762762
finished = self.wait_for_property_defined(property_name="zitiId", property_type=str, entity_type="edge-router",
763763
id=started['id'], wait=3, sleep=1)
764764
except:
@@ -768,9 +768,9 @@ def create_edge_router(self, name: str, attributes: list=[], link_listener: bool
768768
return(finished)
769769
else:
770770
try:
771-
self.wait_for_statuses(expected_statuses=["RUNNING","SUCCESS"],type="process-executions", id=process_id, wait=5, sleep=2, progress=progress)
771+
self.wait_for_statuses(expected_statuses=["STARTED","FINISHED"],type="process", id=process_id, wait=5, sleep=2, progress=progress)
772772
except:
773-
raise Exception("ERROR: timed out waiting for process status 'RUNNING' or 'SUCCESS'")
773+
raise Exception("ERROR: timed out waiting for process status 'STARTED' or 'FINISHED'")
774774
return(started)
775775

776776
def create_edge_router_policy(self, name: str, endpoint_attributes: list=[], edge_router_attributes: list=[], wait: int=30):
@@ -987,22 +987,22 @@ def create_service_simple(self, name: str, client_host_name: str, client_port: i
987987
# frame
988988
if wait:
989989
try:
990-
self.wait_for_status(expect="SUCCESS",type="process-executions", id=process_id, wait=wait, sleep=sleep, progress=progress)
990+
self.wait_for_status(expect="FINISHED",type="process", id=process_id, wait=wait, sleep=sleep, progress=progress)
991991
except:
992-
raise Exception("ERROR: timed out waiting for process status 'SUCCESS'")
992+
raise Exception("ERROR: timed out waiting for process status 'FINISHED'")
993993
try:
994994
# this may be redundant, but in any case was already present as a mechanism for fetching the finished entity,
995-
# and may still serve as insurance that the zitiId is in fact defined when process status is SUCCESS
995+
# and may still serve as insurance that the zitiId is in fact defined when process status is FINISHED
996996
finished = self.wait_for_property_defined(property_name="zitiId", property_type=str, entity_type="service",
997997
id=started['id'], wait=3, sleep=1)
998998
except:
999999
raise Exception("ERROR: timed out waiting for property 'zitiId' to be defined")
10001000
return(finished)
10011001
else:
10021002
try:
1003-
self.wait_for_statuses(expected_statuses=["RUNNING","SUCCESS"],type="process-executions", id=process_id, wait=5, sleep=2, progress=progress)
1003+
self.wait_for_statuses(expected_statuses=["STARTED","FINISHED"],type="process", id=process_id, wait=5, sleep=2, progress=progress)
10041004
except:
1005-
raise Exception("ERROR: timed out waiting for process status 'RUNNING' or 'SUCCESS'")
1005+
raise Exception("ERROR: timed out waiting for process status 'STARTED' or 'FINISHED'")
10061006
return(started)
10071007

10081008
# the above method was renamed to follow the development of PSM-based services (platform service models)
@@ -1084,22 +1084,22 @@ def create_service_policy(self, name: str, services: list, endpoints: list, type
10841084
# frame
10851085
if wait:
10861086
try:
1087-
self.wait_for_status(expect="SUCCESS",type="process-executions", id=process_id, wait=wait, sleep=sleep, progress=progress)
1087+
self.wait_for_status(expect="FINISHED",type="process", id=process_id, wait=wait, sleep=sleep, progress=progress)
10881088
except:
1089-
raise Exception("ERROR: timed out waiting for process status 'SUCCESS'")
1089+
raise Exception("ERROR: timed out waiting for process status 'FINISHED'")
10901090
try:
10911091
# this may be redundant, but in any case was already present as a mechanism for fetching the finished entity,
1092-
# and may still serve as insurance that the zitiId is in fact defined when process status is SUCCESS
1092+
# and may still serve as insurance that the zitiId is in fact defined when process status is FINISHED
10931093
finished = self.wait_for_property_defined(property_name="zitiId", property_type=str, entity_type="service-policy",
10941094
id=started['id'], wait=3, sleep=1)
10951095
except:
10961096
raise Exception("ERROR: timed out waiting for property 'zitiId' to be defined")
10971097
return(finished)
10981098
else:
10991099
try:
1100-
self.wait_for_statuses(expected_statuses=["RUNNING","SUCCESS"],type="process-executions", id=process_id, wait=5, sleep=2, progress=progress)
1100+
self.wait_for_statuses(expected_statuses=["STARTED","FINISHED"],type="process", id=process_id, wait=5, sleep=2, progress=progress)
11011101
except:
1102-
raise Exception("ERROR: timed out waiting for process status 'RUNNING' or 'SUCCESS'")
1102+
raise Exception("ERROR: timed out waiting for process status 'STARTED' or 'FINISHED'")
11031103
return(started)
11041104

11051105

@@ -1173,22 +1173,22 @@ def create_service_edge_router_policy(self, name: str, services: list, edge_rout
11731173
# frame
11741174
if wait:
11751175
try:
1176-
self.wait_for_status(expect="SUCCESS",type="process-executions", id=process_id, wait=wait, sleep=sleep, progress=progress)
1176+
self.wait_for_status(expect="FINISHED",type="process", id=process_id, wait=wait, sleep=sleep, progress=progress)
11771177
except:
1178-
raise Exception("ERROR: timed out waiting for process status 'SUCCESS'")
1178+
raise Exception("ERROR: timed out waiting for process status 'FINISHED'")
11791179
try:
11801180
# this may be redundant, but in any case was already present as a mechanism for fetching the finished entity,
1181-
# and may still serve as insurance that the zitiId is in fact defined when process status is SUCCESS
1181+
# and may still serve as insurance that the zitiId is in fact defined when process status is FINISHED
11821182
finished = self.wait_for_property_defined(property_name="zitiId", property_type=str, entity_type="service-edge-router-policy",
11831183
id=started['id'], wait=3, sleep=1)
11841184
except:
11851185
raise Exception("ERROR: timed out waiting for property 'zitiId' to be defined")
11861186
return(finished)
11871187
else:
11881188
try:
1189-
self.wait_for_statuses(expected_statuses=["RUNNING","SUCCESS"],type="process-executions", id=process_id, wait=5, sleep=2, progress=progress)
1189+
self.wait_for_statuses(expected_statuses=["STARTED","FINISHED"],type="process", id=process_id, wait=5, sleep=2, progress=progress)
11901190
except:
1191-
raise Exception("ERROR: timed out waiting for process status 'RUNNING' or 'SUCCESS'")
1191+
raise Exception("ERROR: timed out waiting for process status 'STARTED' or 'FINISHED'")
11921192
return(started)
11931193

11941194
def create_service_with_configs(self, name: str, intercept_config_data: dict, host_config_data: dict, attributes: list=[],
@@ -1277,22 +1277,22 @@ def create_service_with_configs(self, name: str, intercept_config_data: dict, ho
12771277
# frame
12781278
if wait:
12791279
try:
1280-
self.wait_for_status(expect="SUCCESS",type="process-executions", id=process_id, wait=wait, sleep=sleep, progress=progress)
1280+
self.wait_for_status(expect="FINISHED",type="process", id=process_id, wait=wait, sleep=sleep, progress=progress)
12811281
except:
1282-
raise Exception("ERROR: timed out waiting for process status 'SUCCESS'")
1282+
raise Exception("ERROR: timed out waiting for process status 'FINISHED'")
12831283
try:
12841284
# this may be redundant, but in any case was already present as a mechanism for fetching the finished entity,
1285-
# and may still serve as insurance that the zitiId is in fact defined when process status is SUCCESS
1285+
# and may still serve as insurance that the zitiId is in fact defined when process status is FINISHED
12861286
finished = self.wait_for_property_defined(property_name="zitiId", property_type=str, entity_type="service",
12871287
id=started['id'], wait=3, sleep=1)
12881288
except:
12891289
raise Exception("ERROR: timed out waiting for property 'zitiId' to be defined")
12901290
return(finished)
12911291
else:
12921292
try:
1293-
self.wait_for_statuses(expected_statuses=["RUNNING","SUCCESS"],type="process-executions", id=process_id, wait=5, sleep=2, progress=progress)
1293+
self.wait_for_statuses(expected_statuses=["STARTED","FINISHED"],type="process", id=process_id, wait=5, sleep=2, progress=progress)
12941294
except:
1295-
raise Exception("ERROR: timed out waiting for process status 'RUNNING' or 'SUCCESS'")
1295+
raise Exception("ERROR: timed out waiting for process status 'STARTED' or 'FINISHED'")
12961296
return(started)
12971297

12981298
@docstring_parameters(valid_service_protocols=VALID_SERVICE_PROTOCOLS)
@@ -1598,22 +1598,22 @@ def create_service_advanced(self, name: str, endpoints: list, client_hosts: list
15981598
# frame
15991599
if wait:
16001600
try:
1601-
self.wait_for_status(expect="SUCCESS",type="process-executions", id=process_id, wait=wait, sleep=sleep, progress=progress)
1601+
self.wait_for_status(expect="FINISHED",type="process", id=process_id, wait=wait, sleep=sleep, progress=progress)
16021602
except:
1603-
raise Exception("ERROR: timed out waiting for process status 'SUCCESS'")
1603+
raise Exception("ERROR: timed out waiting for process status 'FINISHED'")
16041604
try:
16051605
# this may be redundant, but in any case was already present as a mechanism for fetching the finished entity,
1606-
# and may still serve as insurance that the zitiId is in fact defined when process status is SUCCESS
1606+
# and may still serve as insurance that the zitiId is in fact defined when process status is FINISHED
16071607
finished = self.wait_for_property_defined(property_name="zitiId", property_type=str, entity_type="service",
16081608
id=started['id'], wait=3, sleep=1)
16091609
except:
16101610
raise Exception("ERROR: timed out waiting for property 'zitiId' to be defined")
16111611
return(finished)
16121612
else:
16131613
try:
1614-
self.wait_for_statuses(expected_statuses=["RUNNING","SUCCESS"],type="process-executions", id=process_id, wait=5, sleep=2, progress=progress)
1614+
self.wait_for_statuses(expected_statuses=["STARTED","FINISHED"],type="process", id=process_id, wait=5, sleep=2, progress=progress)
16151615
except:
1616-
raise Exception("ERROR: timed out waiting for process status 'RUNNING' or 'SUCCESS'")
1616+
raise Exception("ERROR: timed out waiting for process status 'STARTED' or 'FINISHED'")
16171617
return(started)
16181618

16191619
# the above method was renamed to follow the development of PSM-based services (platform service models)

0 commit comments

Comments
 (0)