<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_firmware(node):
 """Performs SUM based firmware update on the node. This method performs SUM firmware update by mounting the SPP ISO on the node. It performs firmware update on all or some of the firmware components. :param node: A node object of type dict. :returns: Operation Status string. :raises: SUMOperationError, when the vmedia device is not found or when the mount operation fails or when the image validation fails. :raises: IloConnectionError, when the iLO connection fails. :raises: IloError, when vmedia eject or insert operation fails. """

    sum_update_iso = node['clean_step']['args'].get('url')

    # Validates the http image reference for SUM update ISO.
    try:
        utils.validate_href(sum_update_iso)
    except exception.ImageRefValidationFailed as e:
        raise exception.SUMOperationError(reason=e)

    # Ejects the CDROM device in the iLO and inserts the SUM update ISO
    # to the CDROM device.
    info = node.get('driver_info')
    ilo_object = client.IloClient(info.get('ilo_address'),
                                  info.get('ilo_username'),
                                  info.get('ilo_password'))

    ilo_object.eject_virtual_media('CDROM')
    ilo_object.insert_virtual_media(sum_update_iso, 'CDROM')

    # Waits for the OS to detect the disk and update the label file. SPP ISO
    # is identified by matching its label.
    time.sleep(WAIT_TIME_DISK_LABEL_TO_BE_VISIBLE)
    vmedia_device_dir = "/dev/disk/by-label/"
    for file in os.listdir(vmedia_device_dir):
        if fnmatch.fnmatch(file, 'SPP*'):
            vmedia_device_file = os.path.join(vmedia_device_dir, file)

    if not os.path.exists(vmedia_device_file):
        msg = "Unable to find the virtual media device for SUM"
        raise exception.SUMOperationError(reason=msg)

    # Validates the SPP ISO image for any file corruption using the checksum
    # of the ISO file.
    expected_checksum = node['clean_step']['args'].get('checksum')
    try:
        utils.verify_image_checksum(vmedia_device_file, expected_checksum)
    except exception.ImageRefValidationFailed as e:
        raise exception.SUMOperationError(reason=e)

    # Mounts SPP ISO on a temporary directory.
    vmedia_mount_point = tempfile.mkdtemp()
    try:
        try:
            processutils.execute("mount", vmedia_device_file,
                                 vmedia_mount_point)
        except processutils.ProcessExecutionError as e:
            msg = ("Unable to mount virtual media device %(device)s: "
                   "%(error)s" % {'device': vmedia_device_file, 'error': e})
            raise exception.SUMOperationError(reason=msg)

        # Executes the SUM based firmware update by passing the 'smartupdate'
        # executable path if exists else 'hpsum' executable path and the
        # components specified (if any).
        sum_file_path = os.path.join(vmedia_mount_point, SUM_LOCATION)
        if not os.path.exists(sum_file_path):
            sum_file_path = os.path.join(vmedia_mount_point, HPSUM_LOCATION)

        components = node['clean_step']['args'].get('components')
        result = _execute_sum(sum_file_path, vmedia_mount_point,
                              components=components)

        processutils.trycmd("umount", vmedia_mount_point)
    finally:
        shutil.rmtree(vmedia_mount_point, ignore_errors=True)

    return result