Skip to content

Commit

Permalink
Fix media mounting eject implementation: (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Nov 24, 2024
2 parents b971208 + b2b18b7 commit eb78b9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/redfishwrapper/virtual_media.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (c *Client) SetVirtualMedia(ctx context.Context, kind string, mediaURL stri

for _, vm := range virtualMedia {
var ejected bool
if vm.Inserted {
if vm.Inserted && vm.SupportsMediaEject {
if err := vm.EjectMedia(); err != nil {
return false, err
}
Expand All @@ -53,7 +53,7 @@ func (c *Client) SetVirtualMedia(ctx context.Context, kind string, mediaURL stri
if mediaURL == "" {
// Only ejecting the media was requested.
// For BMC's that don't support the "inserted" property, we need to eject the media if it's not already ejected.
if !ejected {
if !ejected && vm.SupportsMediaEject {
if err := vm.EjectMedia(); err != nil {
return false, err
}
Expand Down

0 comments on commit eb78b9e

Please sign in to comment.