Merge "Do not use self in classmethod"

This commit is contained in:
Zuul 2019-01-24 15:47:00 +00:00 committed by Gerrit Code Review
commit 9828d09a68
4 changed files with 5 additions and 5 deletions

View File

@ -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,

View File

@ -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):

View File

@ -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()

View File

@ -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))