'Implements the DeleteStack API action.
Deletes the specified stack.'

def delete(self, req):

    self._enforce(req, 'DeleteStack')
    con = req.context
    try:
        identity = self._get_identity(con, req.params['StackName'])
        res = self.rpc_client.delete_stack(con, identity, cast=False)
    except Exception as ex:
        return exception.map_remote_error(ex)
    if (res is None):
        return api_utils.format_response('DeleteStack', '')
    else:
        return api_utils.format_response('DeleteStack', res['Error'])
