String substitution lint fixes

This commit is contained in:
Ryan Lane 2014-08-11 12:39:06 -07:00 committed by Colton Myers
parent 925dfee9c0
commit e4a47d460b
2 changed files with 5 additions and 5 deletions

View File

@ -81,7 +81,7 @@ def get_alarm(name, region=None, key=None, keyid=None, profile=None):
if len(alarms) == 0:
return None
if len(alarms) > 1:
log.error("multiple alarms matched name '%s'" % name)
log.error("multiple alarms matched name '{0}'".format(name))
return _metric_alarm_to_dict(alarms[0])
@ -210,7 +210,7 @@ def create_or_update_alarm(
if isinstance(dimensions, string_types):
dimensions = json.decodestring(dimensions)
if not isinstance(dimensions, dict):
log.error("could not parse dimensions argument: must be json encoding of a dict: '%s'" % dimensions)
log.error("could not parse dimensions argument: must be json encoding of a dict: '{0}'".format(dimensions))
return False
if isinstance(alarm_actions, string_types):
alarm_actions = alarm_actions.split(",")
@ -266,7 +266,7 @@ def convert_to_arn(arns, region=None, key=None, keyid=None, profile=None):
if policy_arn:
results.append(policy_arn)
else:
log.error('Could not convert: %s' % arn)
log.error('Could not convert: {0}'.format(arn))
else:
results.append(arn)
return results

View File

@ -111,7 +111,7 @@ def present(
if alarm_details:
for k, v in attributes.items():
if k not in alarm_details:
difference.append("%s=%s (new)" % (k, v))
difference.append("{0}={1} (new)".format(k, v))
continue
v2 = alarm_details[k]
if v == v2:
@ -122,7 +122,7 @@ def present(
continue
if isinstance(v, int) and v == int(v2):
continue
difference.append("%s='%s' was: '%s'" % (k, v, v2))
difference.append("{0}='{1}' was: '{2}'".format(k, v, v2))
else:
difference.append("new alarm")
create_or_update_alarm_args = {