import socket
import urllib
from quantum.common.wsgi import Serializer
+ from quantum.common import exceptions
- 422: exceptions.NetworkNameExists,
+ EXCEPTIONS = {
+ 400: exceptions.BadInputError,
+ 401: exceptions.NotAuthorized,
+ 420: exceptions.NetworkNotFound,
+ 421: exceptions.NetworkInUse,
- 440: exceptions.AlreadyAttached,
- 441: exceptions.AttachmentNotReady,
+ 430: exceptions.PortNotFound,
+ 431: exceptions.StateInvalid,
+ 432: exceptions.PortInUse,
++ 440: exceptions.AlreadyAttached
+ }
- class api_call(object):
+
+ class ApiCall(object):
"""A Decorator to add support for format and tenant overriding"""
- def __init__(self, f):
- self.f = f
+ def __init__(self, function):
+ self.function = function
def __get__(self, instance, owner):
def with_params(*args, **kwargs):