mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Catch ClientError
when reloading instance state.
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
6f6259ff36
commit
ae92ea10db
1 changed files with 5 additions and 2 deletions
|
@ -1094,8 +1094,11 @@ class VM:
|
|||
def state(self) -> str | None:
|
||||
_state: str | None = None
|
||||
if self.instance:
|
||||
self.instance.reload()
|
||||
_state = self.instance.state["Name"]
|
||||
try:
|
||||
self.instance.reload()
|
||||
_state = self.instance.state["Name"]
|
||||
except ClientError:
|
||||
pass
|
||||
return _state
|
||||
|
||||
@property
|
||||
|
|
Loading…
Add table
Reference in a new issue