-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 redfish module for compatibility with VirtualMedia resource location #5124
Update redfish module for compatibility with VirtualMedia resource location #5124
Conversation
…cation from Manager to Systems
Docs Build 📝Thank you for contribution!✨ This PR has been merged and your docs changes will be incorporated when they are next published. |
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.
Thanks for your contribution.
# if ejected, 'Inserted' should be False | ||
if (not data.get('Inserted', False)): | ||
# Base on current XCC capability, slot RDOC1/2 and Remote1/2/3/4 are not supported to Insert/Eject. | ||
if ("/Systems/1/" in uri or "/Manager/1/" in uri) and ('RDOC' in uri or 'Remote' in uri): |
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.
Is this correct for all kind of Redfish devices out there?
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.
We may use another way to identify lenovo XCC, like 'Vendor' in /redfish/v1.
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.
I would also avoid hard coding things like "RDOC" and "Remote" as methods to detect the capability of setting the image. We may need to think of different logic to determine when a slot cannot be modified. I was hoping the Allow
HTTP header would be able to tell us this, but it seems like you can PATCH other properties on this type of virtual media resource. I'll ask around if we can think of more hardened logic for this.
changelogs/fragments/5124-compatibility-virtualmedia-resource-location.yaml
Outdated
Show resolved
Hide resolved
# if ejected, 'Inserted' should be False | ||
if (not data.get('Inserted', False)): | ||
# Base on current Lenovo server capability, filter out slot RDOC1/2 and Remote1/2/3/4 which are not supported to Insert/Eject. | ||
if vendor == 'Lenovo' and ('RDOC' in uri or 'Remote' in uri): |
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.
I'm still working to see if there are alternatives to this type of inspection. I'm not coming up on much at the moment though, so this may be the only path forward.
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.
Unfortunately I'm not finding other good alternatives, so this is the best we can work with at this time.
@@ -202,6 +202,16 @@ def _get_extended_message(error): | |||
def _init_session(self): | |||
pass | |||
|
|||
def _get_vendor(self): |
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.
As a note to myself, I may want to consider making more use of this to handle vendor-specific checks in the future (and possibly revisit existing vendor checks). This is a good addition to have.
shipit |
Backport to stable-5: 💚 backport PR created✅ Backport PR branch: Backported as #5180 🤖 @patchback |
…cation (#5124) * Update redfish module for compatibility with VirtualMedia resource location from Manager to Systems * Add changelogs fragments for PR 5124 * Update some issue according to the suggestions * update changelogs fragment to list new features in the minor_changes catagory Co-authored-by: Tami YY3 Pan <panyy3@lenovo.com> (cherry picked from commit 766c109)
…cation (#5124) (#5180) * Update redfish module for compatibility with VirtualMedia resource location from Manager to Systems * Add changelogs fragments for PR 5124 * Update some issue according to the suggestions * update changelogs fragment to list new features in the minor_changes catagory Co-authored-by: Tami YY3 Pan <panyy3@lenovo.com> (cherry picked from commit 766c109) Co-authored-by: jixj5 <66418293+jixj5@users.noreply.github.com>
…cation (ansible-collections#5124) * Update redfish module for compatibility with VirtualMedia resource location from Manager to Systems * Add changelogs fragments for PR 5124 * Update some issue according to the suggestions * update changelogs fragment to list new features in the minor_changes catagory Co-authored-by: Tami YY3 Pan <panyy3@lenovo.com>
…cation (ansible-collections#5124) * Update redfish module for compatibility with VirtualMedia resource location from Manager to Systems * Add changelogs fragments for PR 5124 * Update some issue according to the suggestions * update changelogs fragment to list new features in the minor_changes catagory Co-authored-by: Tami YY3 Pan <panyy3@lenovo.com>
SUMMARY
Update redfish module for compatibility due to redfish spec changes the virtualMedia resource location from Manager to Systems.
ISSUE TYPE
COMPONENT NAME
redfish
ADDITIONAL INFORMATION
Virtual media resource locates on Manager or Systems category.