Metaclass Python 3.x Compatibility

use "six.add_metaclass" instead of "__metaclass__"

Change-Id: I57390fec40afe3a965be3215db8f79b9cf862a70
This commit is contained in:
janonymous 2015-07-20 21:41:58 +05:30
parent f3f1f1cab9
commit 06326d7465

View File

@ -19,6 +19,8 @@ from optparse import OptionParser
from urlparse import urlparse from urlparse import urlparse
import random import random
import six
from swift.common.manager import Manager from swift.common.manager import Manager
from swift.common import utils, ring from swift.common import utils, ring
from swift.common.storage_policy import POLICIES from swift.common.storage_policy import POLICIES
@ -62,10 +64,8 @@ def command(f):
return f return f
@six.add_metaclass(meta_command)
class BrainSplitter(object): class BrainSplitter(object):
__metaclass__ = meta_command
def __init__(self, url, token, container_name='test', object_name='test', def __init__(self, url, token, container_name='test', object_name='test',
server_type='container', policy=None): server_type='container', policy=None):
self.url = url self.url = url