Add warning for additional parameters
This commit is contained in:
parent
eea8bc6254
commit
3c4044cdb8
@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.9.3
|
||||||
|
- Improved bash minify for user-data
|
||||||
|
- Unused additional parameters are now printed as a warning to catch potential typos early
|
||||||
|
|
||||||
## 0.9.2
|
## 0.9.2
|
||||||
- Bug fix release only
|
- Bug fix release only
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import logging
|
|||||||
|
|
||||||
__author__ = "Stefan Reimer"
|
__author__ = "Stefan Reimer"
|
||||||
__email__ = "stefan@zero-downtimet.net"
|
__email__ = "stefan@zero-downtimet.net"
|
||||||
__version__ = "0.9.2"
|
__version__ = "0.9.3"
|
||||||
|
|
||||||
|
|
||||||
# Set up logging to ``/dev/null`` like a library is supposed to.
|
# Set up logging to ``/dev/null`` like a library is supposed to.
|
||||||
|
@ -51,6 +51,9 @@ def option(context, attribute, default_value=u'', source='options'):
|
|||||||
def include_raw_gz(context, files=None, gz=True, remove_comments=False):
|
def include_raw_gz(context, files=None, gz=True, remove_comments=False):
|
||||||
jenv = context.environment
|
jenv = context.environment
|
||||||
output = ''
|
output = ''
|
||||||
|
|
||||||
|
# For shell script we can even remove whitespaces so treat them individually
|
||||||
|
# sed -e '2,$ {/^ *$/d ; /^ *#/d ; /^[ \t] *#/d ; /*^/d ; s/^[ \t]*// ; s/*[ \t]$// ; s/ $//}'
|
||||||
for name in files:
|
for name in files:
|
||||||
output = output + jinja2.Markup(jenv.loader.get_source(jenv, name)[0])
|
output = output + jinja2.Markup(jenv.loader.get_source(jenv, name)[0])
|
||||||
|
|
||||||
|
@ -452,8 +452,17 @@ class Stack(object):
|
|||||||
if _errors:
|
if _errors:
|
||||||
raise ParameterNotFound('Cannot find value for parameters: {0}'.format(_errors))
|
raise ParameterNotFound('Cannot find value for parameters: {0}'.format(_errors))
|
||||||
|
|
||||||
|
# Warning of excessive parameters, might be useful to spot typos early
|
||||||
|
_warnings = []
|
||||||
|
for p in self.parameters.keys():
|
||||||
|
if p not in self.cfn_data['Parameters']:
|
||||||
|
_warnings.append(p)
|
||||||
|
|
||||||
logger.info('{} {} set parameters:\n{}'.format(self.region, self.stackname, pprint.pformat(_found, indent=2)))
|
logger.info('{} {} set parameters:\n{}'.format(self.region, self.stackname, pprint.pformat(_found, indent=2)))
|
||||||
|
|
||||||
|
if _warnings:
|
||||||
|
logger.warning('Ignored additional parameters: {}.'.format(_warnings))
|
||||||
|
|
||||||
# Return dict of explicitly set parameters
|
# Return dict of explicitly set parameters
|
||||||
return _found
|
return _found
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import copy
|
import copy
|
||||||
import logging
|
import logging
|
||||||
import boto3
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user