Merge "Fix indentation errors found by Pep8 1.4.6+"

This commit is contained in:
Jenkins 2014-02-07 14:49:29 +00:00 committed by Gerrit Code Review
commit 5859c68bf0
13 changed files with 52 additions and 46 deletions

View File

@ -136,8 +136,9 @@ auth_password_opts = [
clients_opts = [
cfg.StrOpt('endpoint_type',
default='publicURL',
help=_('Type of endpoint in Identity service catalog to use '
'for communication with the OpenStack service.')),
help=_(
'Type of endpoint in Identity service catalog to use '
'for communication with the OpenStack service.')),
cfg.StrOpt('ca_file',
help=_('Optional CA cert file to use in SSL connections')),
cfg.StrOpt('cert_file',

View File

@ -258,8 +258,9 @@ class KeystoneClient(object):
project=self.context.tenant_id)
else:
logger.error(_("Failed to add user %(user)s to role %(role)s, "
"check role exists!") % {'user': username,
'role': self.conf.heat_stack_user_role})
"check role exists!") % {
'user': username,
'role': self.conf.heat_stack_user_role})
return user.id

View File

@ -384,8 +384,8 @@ def stack_update(context, stack_id, values):
if not stack:
raise exception.NotFound(_('Attempt to update a stack with id: '
'%(id)s %(msg)s') % {
'id': stack_id,
'msg': 'that does not exist'})
'id': stack_id,
'msg': 'that does not exist'})
stack.update(values)
stack.save(_session(context))
@ -396,8 +396,8 @@ def stack_delete(context, stack_id):
if not s:
raise exception.NotFound(_('Attempt to delete a stack with id: '
'%(id)s %(msg)s') % {
'id': stack_id,
'msg': 'that does not exist'})
'id': stack_id,
'msg': 'that does not exist'})
session = Session.object_session(s)
@ -581,8 +581,8 @@ def watch_rule_update(context, watch_id, values):
if not wr:
raise exception.NotFound(_('Attempt to update a watch with id: '
'%(id)s %(msg)s') % {
'id': watch_id,
'msg': 'that does not exist'})
'id': watch_id,
'msg': 'that does not exist'})
wr.update(values)
wr.save(_session(context))
@ -593,8 +593,8 @@ def watch_rule_delete(context, watch_id):
if not wr:
raise exception.NotFound(_('Attempt to delete watch_rule: '
'%(id)s %(msg)s') % {
'id': watch_id,
'msg': 'that does not exist'})
'id': watch_id,
'msg': 'that does not exist'})
session = Session.object_session(wr)
for d in wr.watch_data:

View File

@ -583,8 +583,8 @@ class AutoScalingGroup(InstanceGroup, CooldownMixin):
if self._cooldown_inprogress():
logger.info(_("%(name)s NOT performing scaling adjustment, "
"cooldown %(cooldown)s") % {
'name': self.name,
'cooldown': self.properties[self.COOLDOWN]})
'name': self.name,
'cooldown': self.properties[self.COOLDOWN]})
return
capacity = len(self.get_instances())
@ -865,8 +865,8 @@ class ScalingPolicy(signal_responder.SignalResponder, CooldownMixin):
if self._cooldown_inprogress():
logger.info(_("%(name)s NOT performing scaling action, "
"cooldown %(cooldown)s") % {
'name': self.name,
'cooldown': self.properties[self.COOLDOWN]})
'name': self.name,
'cooldown': self.properties[self.COOLDOWN]})
return
asgn_id = self.properties[self.AUTO_SCALING_GROUP_NAME]
@ -879,8 +879,9 @@ class ScalingPolicy(signal_responder.SignalResponder, CooldownMixin):
logger.info(_('%(name)s Alarm, adjusting Group %(group)s with id '
'%(asgn_id)s by %(filter)s') % {
'name': self.name, 'group': group.name, 'asgn_id': asgn_id,
'filter': self.properties[self.SCALING_ADJUSTMENT]})
'name': self.name, 'group': group.name,
'asgn_id': asgn_id,
'filter': self.properties[self.SCALING_ADJUSTMENT]})
group.adjust(int(self.properties[self.SCALING_ADJUSTMENT]),
self.properties[self.ADJUSTMENT_TYPE])

View File

@ -81,8 +81,9 @@ class Restarter(signal_responder.SignalResponder):
victim = self._find_resource(self.properties[self.INSTANCE_ID])
if victim is None:
logger.info(_('%(name)s Alarm, can not find instance '
'%(instance)s') % {'name': self.name,
'instance': self.properties[self.INSTANCE_ID]})
'%(instance)s') % {
'name': self.name,
'instance': self.properties[self.INSTANCE_ID]})
return
logger.info(_('%(name)s Alarm, restarting resource: %(victim)s') % {

View File

@ -113,7 +113,7 @@ class S3Bucket(resource.Resource):
headers = self.tags_to_headers()
logger.debug(_('S3Bucket create container %(container)s with headers '
'%(headers)s') % {
'container': container, 'headers': headers})
'container': container, 'headers': headers})
if self.properties[self.WEBSITE_CONFIGURATION] is not None:
sc = self.properties[self.WEBSITE_CONFIGURATION]
index_doc = sc[self.WEBSITE_CONFIGURATION_INDEX_DOCUMENT]

View File

@ -634,7 +634,7 @@ class Server(resource.Resource):
self._refresh_server(server)
logger.debug(_('%(name)s check_suspend_complete status '
'= %(status)s') % {
'name': self.name, 'status': server.status})
'name': self.name, 'status': server.status})
if server.status in list(nova_utils.deferred_server_statuses +
['ACTIVE']):
return server.status == 'SUSPENDED'

View File

@ -111,9 +111,9 @@ class SwiftContainer(resource.Resource):
logger.debug(_('SwiftContainer create container %(container)s with '
'container headers %(container_headers)s and '
'account headers %(account_headers)s') % {
'container': container,
'account_headers': account_headers,
'container_headers': container_headers})
'container': container,
'account_headers': account_headers,
'container_headers': container_headers})
self.swift().put_container(container, container_headers)

View File

@ -180,8 +180,8 @@ class TemplateResource(stack_resource.StackResource):
# Type mismatch
msg = (_("Property %(n)s type mismatch between facade %(type)s"
" (%(fs_type)s) and provider (%(ps_type)s)") % {
'n': n, 'type': self.type(),
'fs_type': fs.type, 'ps_type': ps.type})
'n': n, 'type': self.type(),
'fs_type': fs.type, 'ps_type': ps.type})
raise exception.StackValidationFailed(message=msg)
for n, ps in self.properties_schema.items():
@ -189,14 +189,14 @@ class TemplateResource(stack_resource.StackResource):
# Required property for template not present in facade
msg = (_("Provider requires property %(n)s "
"unknown in facade %(type)s") % {
'n': n, 'type': self.type()})
'n': n, 'type': self.type()})
raise exception.StackValidationFailed(message=msg)
for attr in facade_cls.attributes_schema:
if attr not in self.attributes_schema:
msg = (_("Attribute %(attr)s for facade %(type)s "
"missing in provider") % {
'attr': attr, 'type': self.type()})
'attr': attr, 'type': self.type()})
raise exception.StackValidationFailed(message=msg)
def validate(self):

View File

@ -89,7 +89,8 @@ class User(resource.Resource):
except KeyError:
logger.error(_("Policy %(policy)s does not exist in stack "
"%(stack)s") % {
'policy': policy, 'stack': self.stack.name})
'policy': policy,
'stack': self.stack.name})
return False
if not callable(getattr(policy_rsrc, 'access_allowed', None)):
@ -258,8 +259,8 @@ class AccessKey(resource.Resource):
if not self.resource_id:
logger.warn(_('could not get secret for %(username)s '
'Error:%(msg)s') % {
'username': self.properties[self.USER_NAME],
'msg': "resource_id not yet set"})
'username': self.properties[self.USER_NAME],
'msg': "resource_id not yet set"})
else:
# First try to retrieve the secret from resource_data, but
# for backwards compatibility, fall back to requesting from
@ -279,11 +280,11 @@ class AccessKey(resource.Resource):
db_api.resource_data_set(self, 'credential_id',
kp.id, redact=True)
except Exception as ex:
logger.warn(_('could not get secret for %(username)s '
'Error:%(msg)s') % {
'username':
self.properties[self.USER_NAME],
'msg': str(ex)})
logger.warn(
_('could not get secret for %(username)s '
'Error:%(msg)s') % {
'username': self.properties[self.USER_NAME],
'msg': str(ex)})
return self._secret or '000-000-000'

View File

@ -135,8 +135,8 @@ class StackUpdate(object):
else:
logger.info(_("Resource %(res_name)s for stack %(stack_name)s"
" updated") % {
'res_name': res_name,
'stack_name': self.existing_stack.name})
'res_name': res_name,
'stack_name': self.existing_stack.name})
return
yield self._create_resource(new_res)

View File

@ -78,7 +78,7 @@ class WatchRule(object):
except Exception as ex:
logger.warn(_('WatchRule.load (%(watch_name)s) db error '
'%(ex)s') % {
'watch_name': watch_name, 'ex': str(ex)})
'watch_name': watch_name, 'ex': str(ex)})
if watch is None:
raise exception.WatchRuleNotFound(watch_name=watch_name)
else:
@ -310,7 +310,7 @@ class WatchRule(object):
# so just ignore any data which doesn't contain MetricName
logger.debug(_('Ignoring metric data (only accept %(metric)s) '
': %(data)s') % {
'metric': self.rule['MetricName'], 'data': data})
'metric': self.rule['MetricName'], 'data': data})
return
watch_data = {
@ -346,12 +346,12 @@ class WatchRule(object):
if actions:
logger.debug(_("Overriding state %(self_state)s for watch "
"%(name)s with %(state)s") % {
'self_state': self.state, 'name': self.name,
'state': state})
'self_state': self.state, 'name': self.name,
'state': state})
else:
logger.warning(_("Unable to override state %(state)s for "
"watch %(name)s") % {
'state': self.state, 'name': self.name})
'state': self.state, 'name': self.name})
return actions

View File

@ -447,8 +447,9 @@ class PoolTest(HeatTestCase):
'protocol': u'HTTP', 'name': 'pool.vip',
'admin_state_up': True, 'subnet_id': u'sub123',
'pool_id': '5678', 'protocol_port': 80,
'session_persistence': {'type': 'APP_COOKIE',
'cookie_name': 'cookie'}}}
'session_persistence': {
'type': 'APP_COOKIE',
'cookie_name': 'cookie'}}}
).AndReturn({'vip': {'id': 'xyz'}})
neutronclient.Client.show_pool('5678').AndReturn(
{'pool': {'status': 'ACTIVE'}})