Do not use self in classmethod
cls should be used in classmethd, instead of self. Change-Id: I0797a0ad0007450d76efa02bd05a5ca9db878938
This commit is contained in:
parent
e9cc6ca372
commit
683865ee65
@ -89,7 +89,7 @@ class SecurityGroup(DatabaseModelBase):
|
||||
return sec_group
|
||||
|
||||
@classmethod
|
||||
def get_security_group_by_id_or_instance_id(self, id, tenant_id):
|
||||
def get_security_group_by_id_or_instance_id(cls, id, tenant_id):
|
||||
try:
|
||||
return SecurityGroup.find_by(id=id,
|
||||
tenant_id=tenant_id,
|
||||
|
@ -641,7 +641,7 @@ class BaseMySqlApp(object):
|
||||
{MySQLConfParser.SERVER_CONF_SECTION: {'datadir': value}})
|
||||
|
||||
@classmethod
|
||||
def get_client_auth_file(self):
|
||||
def get_client_auth_file(cls):
|
||||
return guestagent_utils.build_file_path("~", ".my.cnf")
|
||||
|
||||
def __init__(self, status, local_sql_client, keep_alive_connection_cls):
|
||||
|
@ -37,7 +37,7 @@ class FakeSwiftClient(object):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def Connection(self, *args, **kargs):
|
||||
def Connection(cls, *args, **kargs):
|
||||
LOG.debug("fake FakeSwiftClient Connection")
|
||||
return FakeSwiftConnection()
|
||||
|
||||
|
@ -332,11 +332,11 @@ class GuestAgentCassandraDBManagerTest(DatastoreManagerTest):
|
||||
models.CassandraUser(self._get_random_name(65536))
|
||||
|
||||
@classmethod
|
||||
def _serialize_collection(self, *collection):
|
||||
def _serialize_collection(cls, *collection):
|
||||
return [item.serialize() for item in collection]
|
||||
|
||||
@classmethod
|
||||
def _get_random_name(self, size,
|
||||
def _get_random_name(cls, size,
|
||||
chars=string.ascii_letters + string.digits):
|
||||
return ''.join(random.choice(chars) for _ in range(size))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user