Make methods static where it's possible

Change-Id: If6c1fa05044e65ec1e72a3e5f63e6db826469a2d
This commit is contained in:
Dina Belova
2014-12-10 13:01:29 +03:00
parent 9307ae8132
commit ce8c06d413
4 changed files with 10 additions and 5 deletions

View File

@@ -143,7 +143,8 @@ class CeilometerShell(object):
subparser.add_argument(*args, **kwargs)
subparser.set_defaults(func=callback)
def _setup_logging(self, debug):
@staticmethod
def _setup_logging(debug):
format = '%(levelname)s (%(module)s) %(message)s'
if debug:
logging.basicConfig(format=format, level=logging.DEBUG)
@@ -174,7 +175,8 @@ class CeilometerShell(object):
# Return parsed args
return api_version, subcommand_parser.parse_args(argv)
def no_project_and_domain_set(self, args):
@staticmethod
def no_project_and_domain_set(args):
if not (args.os_project_id or (args.os_project_name and
(args.os_user_domain_name or args.os_user_domain_id)) or
(args.os_tenant_id or args.os_tenant_name)):

View File

@@ -30,7 +30,8 @@ def fake_headers():
class FakeServiceCatalog(object):
def url_for(self, endpoint_type, service_type):
@staticmethod
def url_for(endpoint_type, service_type):
return 'http://192.168.1.5:8004/v1/f14b41234'

View File

@@ -35,7 +35,8 @@ FAKE_ENV = {
class ClientTest(utils.BaseTestCase):
def create_client(self, env, api_version=2, endpoint=None, exclude=[]):
@staticmethod
def create_client(env, api_version=2, endpoint=None, exclude=[]):
env = dict((k, v) for k, v in env.items()
if k not in exclude)

View File

@@ -25,7 +25,8 @@ class Statistics(base.Resource):
class StatisticsManager(base.Manager):
resource_class = Statistics
def _build_aggregates(self, aggregates):
@staticmethod
def _build_aggregates(aggregates):
url_aggregates = []
for aggregate in aggregates:
if 'param' in aggregate: