Deletes the given security group from OpenNebula. Either a name or a secgroup_id
    must be supplied.

    .. versionadded:: 2016.3.0

    name
        The name of the security group to delete. Can be used instead of
        ``secgroup_id``.

    secgroup_id
        The ID of the security group to delete. Can be used instead of ``name``.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f secgroup_delete opennebula name=my-secgroup
        salt-cloud --function secgroup_delete opennebula secgroup_id=100

def secgroup_delete(call=None, kwargs=None):
    '''
    Deletes the given security group from OpenNebula. Either a name or a secgroup_id
    must be supplied.

    .. versionadded:: 2016.3.0

    name
        The name of the security group to delete. Can be used instead of
        ``secgroup_id``.

    secgroup_id
        The ID of the security group to delete. Can be used instead of ``name``.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f secgroup_delete opennebula name=my-secgroup
        salt-cloud --function secgroup_delete opennebula secgroup_id=100
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The secgroup_delete 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_delete function requires either a \'name\' or a '
            '\'secgroup_id\' to be provided.'
        )

    server, user, password = _get_xml_rpc()
    auth = ':'.join([user, password])
    response = server.one.secgroup.delete(auth, int(secgroup_id))

    data = {
        'action': 'secgroup.delete',
        'deleted': response[0],
        'secgroup_id': response[1],
        'error_code': response[2],
    }

    return data