-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update smartctl.py #50
Conversation
This change in behaviour requires:
Also, since the plugin now supports new cases, would it be appropriate to add a new test case that checks explicitly the new cases? |
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.
(see previous comments)
400c6d7
to
09469f8
Compare
Yes I saw them... I'm waiting for an xcpng 8.3 with megaraid to be able to test it for real and I will update the tests. I will also ping XO team. |
I pinged the XO team about the modification: vatesfr/xen-orchestra#8272 |
@stormi & @benjamreis about adding new tests for megaraid. The problem I have is that currently the plugin is looping through devices and run the command for each of them. Like:
As the command cannot be run for unit test I mocked it. It is fine because I currently have only one device. But how can I mock the run_command to return a different output for each devices ? If I add megaraid devices I will have three different outputs to return. EDITED: it looks like we can have iterable side_effect... let's try that :) |
This patch adds supports for megaraid devices by processing the output of the smartctl command regarding this type of hardware. It was previously ignored. Signed-off-by: 1234Erwan <[email protected]>
The `-d` parameter expects the type of the device and not its name. This patch fixes the issue. Signed-off-by: Guillaume <[email protected]>
Signed-off-by: Guillaume <[email protected]>
The function `_list_disks` is now `_list_devices`. Signed-off-by: Guillaume <[email protected]>
Signed-off-by: Guillaume <[email protected]>
This patch improves tests to include the newly supported megaraid devices. To achieve this we rewrite the tests and use iterable side effects. As the modifications are significants this is the first commit with new structure but we will extend them in the future. Signed-off-by: Guillaume <[email protected]>
Note: I squashed all commit from @1234Erwan into one commit to cleanup the tree. So I think it is more readable and this allows the work that has done to be preserved. |
I updated the Readme and the tests so I think it is ok now
@stormi @benjamreis no hurry but it is ok to review it now since XO team verified that there was no impact on their side 👍 |
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.
It looks good to me. I only had a quick overview of the code and mostly focused on the described functional changes. I'm counting on @benjamreis (or someone else if that's not his responsibility anymore) to review the code in detail if needed.
I'll review it this afternoon - since I already took a look I think its okay for me to re-review it 👍 |
It superseded #46