<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def flash_firmware(self, redfish_inst, file_url):
 """Perform firmware flashing on a redfish system :param file_url: url to firmware bits. :param redfish_inst: redfish instance :raises: IloError, on an error from iLO. """

        action_data = {
            'ImageURI': file_url,
        }
        target_uri = self._get_firmware_update_element().target_uri
        try:
            self._conn.post(target_uri, data=action_data)
        except sushy.exceptions.SushyError as e:
            msg = (('The Redfish controller failed to update firmware '
                    'with file %(file)s Error %(error)s') %
                   {'file': file_url, 'error': str(e)})
            LOG.debug(msg)  # noqa
            raise exception.IloError(msg)

        self.wait_for_redfish_firmware_update_to_complete(redfish_inst)
        try:
            state, percent = self.get_firmware_update_progress()
        except sushy.exceptions.SushyError as e:
            msg = ('Failed to get firmware progress update '
                   'Error %(error)s' % {'error': str(e)})
            LOG.debug(msg)
            raise exception.IloError(msg)

        if state == "Error":
            msg = 'Unable to update firmware'
            LOG.debug(msg)  # noqa
            raise exception.IloError(msg)
        elif state == "Unknown":
            msg = 'Status of firmware update not known'
            LOG.debug(msg)  # noqa
        else:  # "Complete" | "Idle"
            LOG.info('Flashing firmware file: %s ... done', file_url)