Also remove empty lines when removing comments from includes, fix debug logging
This commit is contained in:
parent
a92b56083b
commit
eea8bc6254
@ -56,10 +56,13 @@ def include_raw_gz(context, files=None, gz=True, remove_comments=False):
|
|||||||
|
|
||||||
if remove_comments:
|
if remove_comments:
|
||||||
# Remove full line comments but not shebang
|
# Remove full line comments but not shebang
|
||||||
_re = re.compile(r'^\s*#[^!]')
|
_re_comment = re.compile(r'^\s*#[^!]')
|
||||||
|
_re_blank = re.compile(r'^\s*$')
|
||||||
stripped_output = ''
|
stripped_output = ''
|
||||||
for curline in output.splitlines():
|
for curline in output.splitlines():
|
||||||
if re.match(_re, curline):
|
if re.match(_re_blank, curline):
|
||||||
|
continue
|
||||||
|
elif re.match(_re_comment, curline):
|
||||||
logger.debug("Removed {}".format(curline))
|
logger.debug("Removed {}".format(curline))
|
||||||
else:
|
else:
|
||||||
stripped_output = stripped_output + curline + '\n'
|
stripped_output = stripped_output + curline + '\n'
|
||||||
|
@ -37,7 +37,6 @@ def setup_logging(debug):
|
|||||||
if debug:
|
if debug:
|
||||||
our_level = logging.DEBUG
|
our_level = logging.DEBUG
|
||||||
logging.getLogger("botocore").setLevel(logging.INFO)
|
logging.getLogger("botocore").setLevel(logging.INFO)
|
||||||
boto3.set_stream_logger('')
|
|
||||||
|
|
||||||
formatter = logging.Formatter(
|
formatter = logging.Formatter(
|
||||||
fmt="[%(asctime)s] %(name)s %(message)s",
|
fmt="[%(asctime)s] %(name)s %(message)s",
|
||||||
|
Loading…
Reference in New Issue
Block a user