Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions zvmsdk/smtclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,27 @@ def get_power_state(self, userid):
with zvmutils.log_and_reraise_smt_request_failed(action):
results = self._request(requestData)
with zvmutils.expect_invalid_resp_data(results):
status = results['response'][0].partition(': ')[2]
return status
vmcp_status = results['response'][0].partition(': ')[2]
if vmcp_status == "off":
return vmcp_status
cmd = ["/opt/zthin/bin/IUCV/iucvclnt", userid, "date"]
try:
result_iucv = subprocess.check_output(cmd,
close_fds=True,
stderr=subprocess.STDOUT)
IUCV_status = "on"
except subprocess.CalledProcessError as err:
rc = err.returncode
output = err.output
output = output.decode('utf-8').strip()
if "UNAUTHORIZED_ERROR" in output:
return vmcp_status
IUCV_status = "off"
except Exception as err:
msg = ("Could not find the userid of the smt server: %s") % err
LOG.error(msg)
IUCV_status = "off"
return IUCV_status

def _check_power_state(self, userid, action):
# Get the vm status
Expand Down
Loading