Skip to content

Commit 5fbaac8

Browse files
rh-bot-1vsibirsk
andauthored
Update VMI pause/unpause (#2596) (#2602)
removed wait_for_domstate_pause_status from pause/unpause (when called with wait=True): 1. check for domstate was an old w/a with is irrelevant now 2. executing domstate command on virt-launhcer pod can be done only with admin client (even though pause/unpause can be executed by unpriv client) Co-authored-by: vsibirsk <[email protected]>
1 parent 0d56f62 commit 5fbaac8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ocp_resources/virtual_machine_instance.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import shlex
22
from typing import Any
3+
from warnings import warn
34

45
import xmltodict
56
from kubernetes.dynamic.exceptions import ResourceNotFoundError
@@ -151,10 +152,14 @@ def wait_for_pause_status(self, pause, timeout=TIMEOUT_4MINUTES):
151152
TimeoutExpiredError: If resource not exists.
152153
"""
153154
self.logger.info(f"Wait until {self.kind} {self.name} is {'Paused' if pause else 'Unpuased'}")
154-
self.wait_for_domstate_pause_status(pause=pause, timeout=timeout)
155155
self.wait_for_vmi_condition_pause_status(pause=pause, timeout=timeout)
156156

157157
def wait_for_domstate_pause_status(self, pause, timeout=TIMEOUT_4MINUTES):
158+
warn(
159+
message="wait_for_domstate_pause_status is deprecated and will be removed the next version.",
160+
category=DeprecationWarning,
161+
stacklevel=2,
162+
)
158163
pause_status = "paused" if pause else "running"
159164
samples = TimeoutSampler(
160165
wait_timeout=timeout,
@@ -269,6 +274,11 @@ def get_domstate(self):
269274
Returns:
270275
String: VMI Status as string
271276
"""
277+
warn(
278+
message="get_domstate is deprecated and will be removed the next version.",
279+
category=DeprecationWarning,
280+
stacklevel=2,
281+
)
272282
return self.execute_virsh_command(command="domstate")
273283

274284
def get_dommemstat(self):

0 commit comments

Comments
 (0)