-
Notifications
You must be signed in to change notification settings - Fork 95
Fixed error on parsing PID for status command. #641
Conversation
Fixes #633 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI fails in what seems to be related areas, will take a look when CI passes.
meanwhile - can you elaborate on what was the error (output before/after the fix) and what config is needed to repro ?
@@ -591,7 +591,8 @@ def get_service_status(): | |||
if output[2] == "not": | |||
return NOT_RUNNING_STATUS | |||
|
|||
pid = output[3].split("=")[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a comment with expected result example (makes easy to understand and check the code).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the error:
File "/usr/lib/vmware/vmdkops/bin/vmdkops_admin.py", line 594, in get_service_status
pid = output[3].split("=")[1]
TypeError: a bytes-like object is required, not 'str'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's OK - but can you please add a comment (in the code) with the example of output so the output[3].split("=")[1]
becomes clear ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, and this is the fixed output:
python /usr/lib/vmware/vmdkops/bin/vmdkops_admin.py status
Version: 0.7.3f2c66a-0.0.1
Status: Running
Pid: 5585696
Port: 1019
LogConfigFile: /etc/vmware/vmdkops/log_config.json
LogFile: /var/log/vmware/vmdk_ops.log
the fix looks good and good to go when CI passes |
You may want to check CI, vmdkopsAdmin testStatus test is failing. |
c62323b
to
de47d77
Compare
Its a different test thats failing (vmdkops_admin_sanity_test.py), the new On Tue, Oct 25, 2016 at 9:39 AM, Govindan T tgovin1@gmail.com wrote:
|
More byte to string handling in test code. Fixed. On Tue, Oct 25, 2016 at 10:05 AM, Govindan T tgovin1@gmail.com wrote:
|
Restarted CI test for this change I'll check and update. On Tue, Oct 25, 2016 at 9:34 AM, Prashant Dhamdhere <
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Also added a unit test for status command.