def eject_virtual_media(self, device):
        """Ejects the Virtual Media image if one is inserted.

        :param device: virual media device
        :raises: IloError, on an error from iLO.
        :raises: IloInvalidInputError, if the device is not valid.
        """
        self._validate_virtual_media(device)
        manager = self._get_sushy_manager(PROLIANT_MANAGER_ID)
        try:
            vmedia_device = (
                manager.virtual_media.get_member_device(
                    VIRTUAL_MEDIA_MAP[device]))
            if not vmedia_device.inserted:
                LOG.debug(self._("No media available in the device '%s' to "
                                 "perform eject operation.") % device)
                return

            LOG.debug(self._("Ejecting the media image '%(url)s' from the "
                             "device %(device)s.") %
                      {'url': vmedia_device.image, 'device': device})
            vmedia_device.eject_media()
        except sushy.exceptions.SushyError as e:
            msg = (self._("The Redfish controller failed to eject the virtual"
                          " media device '%(device)s'. Error %(error)s.") %
                   {'device': device, 'error': str(e)})
            LOG.debug(msg)
            raise exception.IloError(msg)
def eject_virtual_media ( self , device ) : self . _validate_virtual_media ( device ) manager = self . _get_sushy_manager ( PROLIANT_MANAGER_ID ) try : vmedia_device = ( manager . virtual_media . get_member_device ( VIRTUAL_MEDIA_MAP [ device ] ) ) if not vmedia_device . inserted : LOG . debug ( self . _ ( "No media available in the device '%s' to " "perform eject operation." ) % device ) return LOG . debug ( self . _ ( "Ejecting the media image '%(url)s' from the " "device %(device)s." ) % { 'url' : vmedia_device . image , 'device' : device } ) vmedia_device . eject_media ( ) except sushy . exceptions . SushyError as e : msg = ( self . _ ( "The Redfish controller failed to eject the virtual" " media device '%(device)s'. Error %(error)s." ) % { 'device' : device , 'error' : str ( e ) } ) LOG . debug ( msg ) raise exception . IloError ( msg )
Ejects the Virtual Media image if one is inserted.

        :param device: virual media device
        :raises: IloError, on an error from iLO.
        :raises: IloInvalidInputError, if the device is not valid.