Helper function to retrieve objtype from pillars if objname
    is string_types, used for SupportedLoginProviders and
    OpenIdConnectProviderARNs.

def _get_object(objname, objtype):
    '''
    Helper function to retrieve objtype from pillars if objname
    is string_types, used for SupportedLoginProviders and
    OpenIdConnectProviderARNs.
    '''
    ret = None
    if objname is None:
        return ret

    if isinstance(objname, string_types):
        if objname in __opts__:
            ret = __opts__[objname]
        master_opts = __pillar__.get('master', {})
        if objname in master_opts:
            ret = master_opts[objname]
        if objname in __pillar__:
            ret = __pillar__[objname]
    elif isinstance(objname, objtype):
        ret = objname

    if not isinstance(ret, objtype):
        ret = None

    return ret