Soft restart#920
Conversation
1df8632 to
b304638
Compare
zvmsdk/smtclient.py
Outdated
| try: | ||
| self.execute_cmd(userid, 'date') | ||
| except Exception as err: | ||
| return os_version |
There was a problem hiding this comment.
We can utilize the below try except block to return the os_version
zvmsdk/smtclient.py
Outdated
| @@ -1407,56 +1407,73 @@ def guest_capture(self, userid, image_name, capture_type='rootonly', | |||
|
|
|||
| def guest_get_os_version(self, userid): | |||
| os_version = '' | |||
There was a problem hiding this comment.
this can be changed to : os_version = ‘-‘ as we are returning - as os_version whenever we are unable to find one in the release file
zvmsdk/smtclient.py
Outdated
| os_version = ''.join((distro, distro_version)) | ||
|
|
||
| else: | ||
| os_version = "-" |
There was a problem hiding this comment.
Else block is not required as we are anyways defined the os_version at top
zvmsdk/smtclient.py
Outdated
| os_version = "-" | ||
|
|
||
| except Exception as err: | ||
| os_version = "-" |
There was a problem hiding this comment.
Instead of re initializing os_version, Is is possible to add a logging here
b304638 to
696b652
Compare
zvmsdk/smtclient.py
Outdated
| distro_version = release_info[0].split()[6] | ||
| os_version = ''.join((distro, distro_version)) | ||
| """ | ||
| Retrieves the operating system details of the VM. |
There was a problem hiding this comment.
Retrieves the operating system name and version of the VM from release file
zvmsdk/smtclient.py
Outdated
| """ | ||
| Retrieves the operating system details of the VM. | ||
| :param userid: User ID of the VM. | ||
| :return: A string containing the OS details. |
There was a problem hiding this comment.
A string containing the OS name and version information
Signed-off-by: suraksha <p.v.sai.suraksha@ibm.com>
696b652 to
77a0e61
Compare
|
As stated by @Bischoff and verified by me This might conflict with MR 860 Please review your changes @P-V-SAI-SURAKSHA and the changes in MR 860 to find a common ground |
Don't worry, I will rebase on top of your work. I am slower, and I don't want to block you. It was more of a heads up message, so you know I am working on this part as well. Approving. |
Purpose of the PR: To gracefully handle scenarios when the OS release file is missing from the VM.