def get_firmware_upgrade_status(irmc_info, upgrade_type):
    """get firmware upgrade status of bios or irmc

    :param irmc_info: dict of iRMC params to access the server node
        {
          'irmc_address': host,
          'irmc_username': user_id,
          'irmc_password': password,
          'irmc_port': 80 or 443, default is 443,
          'irmc_auth_method': 'basic' or 'digest', default is 'digest',
          'irmc_client_timeout': timeout, default is 60,
          ...
        }
    :param upgrade_type: flag to check upgrade with bios or irmc
    :raises: ISCCIInvalidInputError if port and/or auth_method params
             are invalid
    :raises: SCCIClientError if SCCI failed
    """

    host = irmc_info.get('irmc_address')
    userid = irmc_info.get('irmc_username')
    password = irmc_info.get('irmc_password')
    port = irmc_info.get('irmc_port', 443)
    auth_method = irmc_info.get('irmc_auth_method', 'digest')
    client_timeout = irmc_info.get('irmc_client_timeout', 60)

    auth_obj = None
    try:
        protocol = {80: 'http', 443: 'https'}[port]
        auth_obj = {
            'basic': requests.auth.HTTPBasicAuth(userid, password),
            'digest': requests.auth.HTTPDigestAuth(userid, password)
        }[auth_method.lower()]
    except KeyError:
        raise SCCIInvalidInputError(
            ("Invalid port %(port)d or " +
             "auth_method for method %(auth_method)s") %
            {'port': port, 'auth_method': auth_method})
    try:
        if upgrade_type == 'bios':
            upgrade_type = '/biosprogress'
        elif upgrade_type == 'irmc':
            upgrade_type = '/irmcprogress'
        r = requests.get(protocol + '://' + host + upgrade_type,
                         verify=False,
                         timeout=(10, client_timeout),
                         allow_redirects=False,
                         auth=auth_obj)

        if r.status_code not in (200, 201):
            raise SCCIClientError(
                ('HTTP PROTOCOL ERROR, STATUS CODE = %s' %
                 str(r.status_code)))

        upgrade_status_xml = ET.fromstring(r.text)
        return upgrade_status_xml
    except ET.ParseError as parse_error:
        raise SCCIClientError(parse_error)
get firmware upgrade status of bios or irmc

    :param irmc_info: dict of iRMC params to access the server node
        {
          'irmc_address': host,
          'irmc_username': user_id,
          'irmc_password': password,
          'irmc_port': 80 or 443, default is 443,
          'irmc_auth_method': 'basic' or 'digest', default is 'digest',
          'irmc_client_timeout': timeout, default is 60,
          ...
        }
    :param upgrade_type: flag to check upgrade with bios or irmc
    :raises: ISCCIInvalidInputError if port and/or auth_method params
             are invalid
    :raises: SCCIClientError if SCCI failed