This is currently only applied to YAML templates.
'''
# if version is missing, implicitly use the lastest one
- if not version_param in tpl:
+ if version_param not in tpl:
tpl[version_param] = versions[-1]
# create empty placeholders for any of the main dict sections
for param in (u'Parameters', u'Mappings', u'Resources', u'Outputs'):
- if not param in tpl:
+ if param not in tpl:
tpl[param] = {}
def get_bind_addr(conf, default_port=None):
"""Return the host and port to bind to."""
for opt in bind_opts:
- if not opt.name in conf:
+ if opt.name not in conf:
conf.register_opt(opt)
return (conf.bind_host, conf.bind_port or default_port)
def get_content_type(self, allowed_content_types):
"""Determine content type of the request body."""
- if not "Content-Type" in self.headers:
+ if "Content-Type" not in self.headers:
raise exception.InvalidContentType(content_type=None)
content_type = self.content_type
try:
# First delete any resources which are not in newstack
for res in reversed(self):
- if not res.name in newstack.keys():
+ if res.name not in newstack.keys():
logger.debug("resource %s not found in updated stack"
% res.name + " definition, deleting")
try:
# Then create any which are defined in newstack but not self
for res in newstack:
- if not res.name in self.keys():
+ if res.name not in self.keys():
logger.debug("resource %s not found in current stack"
% res.name + " definition, adding")
res.stack = self
'SourceSecurityGroupName',
'SourceSecurityGroupOwnerAlias')
- if not key in allow:
+ if key not in allow:
raise exception.InvalidTemplateAttribute(resource=self.name,
key=key)
logger.info('WATCH: stack:%s, watch_name:%s %s',
self.stack_id, self.name, new_state)
actions = []
- if not self.ACTION_MAP[new_state] in self.rule:
+ if self.ACTION_MAP[new_state] not in self.rule:
logger.info('no action for new state %s',
new_state)
else:
return actions
def create_watch_data(self, data):
- if not self.rule['MetricName'] in data:
+ if self.rule['MetricName'] not in data:
# Our simplified cloudwatch implementation only expects a single
# Metric associated with each alarm, but some cfn-push-stats
# options, e.g --haproxy try to push multiple metrics when we
python setup.py testr --coverage
[flake8]
-ignore = H302,H303,H304,H403,H404,F403,F841,H306,H902,H201,H101,H703,H702
+ignore = H302,H303,H304,H403,H404,F403,F841,H306,H201,H101,H703,H702
show-source = true
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools,build