Merge "fixed several pep8 issues"

This commit is contained in:
Jenkins
2014-05-29 05:46:54 +00:00
committed by Gerrit Code Review
7 changed files with 25 additions and 24 deletions

View File

@@ -21,7 +21,7 @@ import socket
try:
import ssl
except ImportError:
#TODO(bcwaldon): Handle this failure more gracefully
# TODO(bcwaldon): Handle this failure more gracefully
pass
try:

View File

@@ -108,7 +108,7 @@ class HTTPServiceUnavailable(HTTPException):
code = 503
#NOTE(bcwaldon): Build a mapping of HTTP codes to corresponding exception
# NOTE(bcwaldon): Build a mapping of HTTP codes to corresponding exception
# classes
_code_map = {}
for obj_name in dir(sys.modules[__name__]):

View File

@@ -156,7 +156,7 @@ class CeilometerShell(object):
parser.add_argument('--ceilometer-api-version',
default=cliutils.env(
'CEILOMETER_API_VERSION', default='2'),
'CEILOMETER_API_VERSION', default='2'),
help='Defaults to env[CEILOMETER_API_VERSION] '
'or 2.')

View File

@@ -38,18 +38,20 @@ AN_ALARM = {u'alarm_actions': [u'http://site:8000/alarm'],
u'period': 240.0,
u'statistic': u'avg',
u'threshold': 200.0,
u'comparison_operator': 'gt',
},
u'time_constraints': [{u'name': u'cons1',
u'description': u'desc1',
u'start': u'0 11 * * *',
u'duration': 300,
u'timezone': u''},
{u'name': u'cons2',
u'description': u'desc2',
u'start': u'0 23 * * *',
u'duration': 600,
u'timezone': ''}],
u'comparison_operator': 'gt'},
u'time_constraints': [
{
u'name': u'cons1',
u'description': u'desc1',
u'start': u'0 11 * * *',
u'duration': 300,
u'timezone': u''},
{
u'name': u'cons2',
u'description': u'desc2',
u'start': u'0 23 * * *',
u'duration': 600,
u'timezone': ''}],
u'timestamp': u'2013-05-09T13:41:23.085000',
u'enabled': True,
u'alarm_id': u'alarm-id',

View File

@@ -20,12 +20,12 @@ from ceilometerclient.common import base
def _get_opt_path(simple_params=[], **kwargs):
l = []
#get simple paramters
# get simple paramters
for key in simple_params:
val = kwargs.get(key)
if val:
l.append(key + '=' + val)
#get metadata query paramters
# get metadata query paramters
metaquery = kwargs.get('metaquery')
if metaquery:
l.extend(metaquery.split(':'))

View File

@@ -80,7 +80,7 @@ def cli_to_array(cli_query):
frags = re.findall(r'([[a-zA-Z0-9_.]+)([><!]=)([^ -,\t\n\r\f\v]+)',
string)
if len(frags) == 0:
#single char split (<,=)
# single char split (<,=)
frags = re.findall(r'([a-zA-Z0-9_.]+)([><=])([^ -,\t\n\r\f\v]+)',
string)
return frags

View File

@@ -59,8 +59,8 @@ SIMPLE_OPERATORS = ["=", "!=", "<", "<=", '>', '>=']
help='Field for group by.')
@utils.arg('-a', '--aggregate', metavar='<FUNC>[<-<PARAM>]', action='append',
default=[], help=('Function for data aggregation. '
'Available aggregates are: '
'%s.' % ", ".join(AGGREGATES.keys())))
'Available aggregates are: '
'%s.' % ", ".join(AGGREGATES.keys())))
def do_statistics(cc, args):
'''List the statistics for a meter.'''
aggregates = []
@@ -693,10 +693,9 @@ def do_event_list(cc, args={}):
fields = ['message_id', 'event_type', 'generated', 'traits']
utils.print_list(events, fields, field_labels,
formatters={
'traits': utils.nested_list_of_dict_formatter('traits',
['name',
'type',
'value'])})
'traits': utils.nested_list_of_dict_formatter(
'traits', ['name', 'type', 'value']
)})
@utils.arg('-m', '--message_id', metavar='<message_id>',