Merge "Remove redundant parentheses"

This commit is contained in:
Jenkins 2014-08-26 10:51:20 +00:00 committed by Gerrit Code Review
commit 881cad5b78
13 changed files with 34 additions and 34 deletions

View File

@ -227,5 +227,5 @@ def get_hypervisor_inspector():
invoke_on_load=True)
return mgr.driver
except ImportError as e:
LOG.error(_("Unable to load the hypervisor inspector: %s") % (e))
LOG.error(_("Unable to load the hypervisor inspector: %s") % e)
return Inspector()

View File

@ -38,9 +38,9 @@ class DataProcessing(plugin.NotificationBase):
@property
def event_types(self):
return [
'%s.create' % (self.resource_name),
'%s.update' % (self.resource_name),
'%s.delete' % (self.resource_name),
'%s.create' % self.resource_name,
'%s.update' % self.resource_name,
'%s.delete' % self.resource_name,
]
@staticmethod

View File

@ -51,7 +51,7 @@ def parse_snmp_return(ret, is_bulk=False):
else:
err = False
data = varBinds
return (err, data)
return err, data
EXACT = 'type_exact'

View File

@ -67,7 +67,7 @@ class User(IdentityCRUD):
@property
def event_types(self):
return ['%s.*' % (self.resource_name)]
return ['%s.*' % self.resource_name]
class Group(IdentityCRUD):
@ -77,7 +77,7 @@ class Group(IdentityCRUD):
@property
def event_types(self):
return ['%s.*' % (self.resource_name)]
return ['%s.*' % self.resource_name]
class Project(IdentityCRUD):
@ -87,7 +87,7 @@ class Project(IdentityCRUD):
@property
def event_types(self):
return ['%s.*' % (self.resource_name)]
return ['%s.*' % self.resource_name]
class Role(IdentityCRUD):
@ -97,7 +97,7 @@ class Role(IdentityCRUD):
@property
def event_types(self):
return ['%s.*' % (self.resource_name)]
return ['%s.*' % self.resource_name]
class Trust(IdentityCRUD):
@ -108,8 +108,8 @@ class Trust(IdentityCRUD):
@property
def event_types(self):
return [
'%s.created' % (self.resource_name),
'%s.deleted' % (self.resource_name)
'%s.created' % self.resource_name,
'%s.deleted' % self.resource_name,
]

View File

@ -50,9 +50,9 @@ class NetworkNotificationBase(plugin.NotificationBase):
# there is no resource id assigned by Neutron yet. So we ignore
# the *.create.start notification for now and only listen the
# *.create.end to make sure the resource id is existed.
'%s.create.end' % (self.resource_name),
'%s.update.*' % (self.resource_name),
'%s.exists' % (self.resource_name),
'%s.create.end' % self.resource_name,
'%s.update.*' % self.resource_name,
'%s.exists' % self.resource_name,
# FIXME(dhellmann): Neutron delete notifications do
# not include the same metadata as the other messages,
# so we ignore them for now. This isn't ideal, since

View File

@ -136,16 +136,16 @@ class OpencontrailDriver(driver.Driver):
@staticmethod
def _switch_port_receive_packets(statistic, resource_id, resource_meta):
return (int(statistic['in_pkts']), resource_id, resource_meta)
return int(statistic['in_pkts']), resource_id, resource_meta
@staticmethod
def _switch_port_transmit_packets(statistic, resource_id, resource_meta):
return (int(statistic['out_pkts']), resource_id, resource_meta)
return int(statistic['out_pkts']), resource_id, resource_meta
@staticmethod
def _switch_port_receive_bytes(statistic, resource_id, resource_meta):
return (int(statistic['in_bytes']), resource_id, resource_meta)
return int(statistic['in_bytes']), resource_id, resource_meta
@staticmethod
def _switch_port_transmit_bytes(statistic, resource_id, resource_meta):
return (int(statistic['out_bytes']), resource_id, resource_meta)
return int(statistic['out_bytes']), resource_id, resource_meta

View File

@ -42,7 +42,7 @@ def _get_properties(properties, prefix='properties'):
def _get_int_sample(key, statistic, resource_id, resource_meta):
if key not in statistic:
return None
return (int(statistic[key]), resource_id, resource_meta)
return int(statistic[key]), resource_id, resource_meta
class OpenDayLightDriver(driver.Driver):
@ -234,7 +234,7 @@ class OpenDayLightDriver(driver.Driver):
resource_meta.update(_get_properties(statistic.get('properties')))
return (1, resource_id, resource_meta)
return 1, resource_id, resource_meta
@staticmethod
def _iter_port(extractor, data):
@ -307,7 +307,7 @@ class OpenDayLightDriver(driver.Driver):
break
return (1, resource_id, resource_meta)
return 1, resource_id, resource_meta
@staticmethod
def _switch_port_receive_packets(statistic, resource_id,
@ -392,7 +392,7 @@ class OpenDayLightDriver(driver.Driver):
@staticmethod
def _switch_table(statistic, resource_id, resource_meta):
return (1, resource_id, resource_meta)
return 1, resource_id, resource_meta
@staticmethod
def _switch_table_active_entries(statistic, resource_id,
@ -427,7 +427,7 @@ class OpenDayLightDriver(driver.Driver):
@staticmethod
def _switch_flow(statistic, resource_id, resource_meta):
return (1, resource_id, resource_meta)
return 1, resource_id, resource_meta
@staticmethod
def _switch_flow_duration_seconds(statistic, resource_id,

View File

@ -39,11 +39,11 @@ class StackCRUD(plugin.NotificationBase):
@property
def event_types(self):
return [
'%s.create.end' % (self.resource_name),
'%s.update.end' % (self.resource_name),
'%s.delete.end' % (self.resource_name),
'%s.resume.end' % (self.resource_name),
'%s.suspend.end' % (self.resource_name),
'%s.create.end' % self.resource_name,
'%s.update.end' % self.resource_name,
'%s.delete.end' % self.resource_name,
'%s.resume.end' % self.resource_name,
'%s.suspend.end' % self.resource_name,
]
@staticmethod

View File

@ -692,7 +692,7 @@ class Connection(base.Connection):
# Note: we don't flush here, explicitly (unless a new trait or event
# does it). Otherwise, just wait until all the Events are staged.
return (event, new_traits)
return event, new_traits
def record_events(self, event_models):
"""Write the events to SQL database via sqlalchemy.

View File

@ -151,7 +151,7 @@ class TestCoordinate(tests_base.BaseTestCase):
younger = self._younger_by(offset)
pid = uuid.uuid4()
self.partition_coordinator.presence(pid, younger)
return (pid, younger)
return pid, younger
def _check_assignments(self, others, alarm_ids, per_worker,
expect_uneffected=None):

View File

@ -202,14 +202,14 @@ def faux_getCmd(authData, transportTarget, oid):
try:
return GETCMD_MAP[oid]
except KeyError:
return ("faux_getCmd Error", None, 0, [])
return "faux_getCmd Error", None, 0, []
def faux_nextCmd(authData, transportTarget, oid):
try:
return NEXTCMD_MAP[oid]
except KeyError:
return ("faux_nextCmd Error", None, 0, [])
return "faux_nextCmd Error", None, 0, []
def faux_getCmd_new(authData, transportTarget, *oids, **kwargs):

View File

@ -156,7 +156,7 @@ class BinApiTestCase(base.BaseTestCase):
self.assertIsNone(self.subp.poll())
else:
return r, c
return (None, None)
return None, None
def test_v2(self):
response, content = self.get_response('v2/meters')

View File

@ -92,7 +92,7 @@ class ScalingTransformer(transformer.TransformerBase):
def handle_sample(self, context, s):
"""Handle a sample, converting if necessary."""
LOG.debug(_('handling sample %s'), (s,))
if (self.source.get('unit', s.unit) == s.unit):
if self.source.get('unit', s.unit) == s.unit:
s = self._convert(s)
LOG.debug(_('converted to: %s'), (s,))
return s