Retrieves information for the given security group. Either a name or a
    secgroup_id must be supplied.

    .. versionadded:: 2016.3.0

    name
        The name of the security group for which to gather information. Can be
        used instead of ``secgroup_id``.

    secgroup_id
        The ID of the security group for which to gather information. Can be
        used instead of ``name``.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f secgroup_info opennebula name=my-secgroup
        salt-cloud --function secgroup_info opennebula secgroup_id=5

def secgroup_info(call=None, kwargs=None):
    '''
    Retrieves information for the given security group. Either a name or a
    secgroup_id must be supplied.

    .. versionadded:: 2016.3.0

    name
        The name of the security group for which to gather information. Can be
        used instead of ``secgroup_id``.

    secgroup_id
        The ID of the security group for which to gather information. Can be
        used instead of ``name``.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f secgroup_info opennebula name=my-secgroup
        salt-cloud --function secgroup_info opennebula secgroup_id=5
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The secgroup_info function must be called with -f or --function.'
        )

    if kwargs is None:
        kwargs = {}

    name = kwargs.get('name', None)
    secgroup_id = kwargs.get('secgroup_id', None)

    if secgroup_id:
        if name:
            log.warning(
                'Both the \'secgroup_id\' and \'name\' arguments were provided. '
                '\'secgroup_id\' will take precedence.'
            )
    elif name:
        secgroup_id = get_secgroup_id(kwargs={'name': name})
    else:
        raise SaltCloudSystemExit(
            'The secgroup_info function requires either a name or a secgroup_id '
            'to be provided.'
        )

    server, user, password = _get_xml_rpc()
    auth = ':'.join([user, password])

    info = {}
    response = server.one.secgroup.info(auth, int(secgroup_id))[1]
    tree = _get_xml(response)
    info[tree.find('NAME').text] = _xml_to_dict(tree)

    return info