diff --git a/CHANGES.md b/CHANGES.md index 06bf04d..fd84f3e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ # Changelog +## 0.7.1 +- Release emergency bugfix, 0.7.0 broke recursive option parsing + ## 0.7.0 - Add support for SNS Notifcations to Cloudformation create and update operations - Refactored recursive handling of options withing stack groups diff --git a/cloudbender/__init__.py b/cloudbender/__init__.py index 74b9305..a1245bd 100644 --- a/cloudbender/__init__.py +++ b/cloudbender/__init__.py @@ -2,7 +2,7 @@ import logging __author__ = "Stefan Reimer" __email__ = "stefan@zero-downtimet.net" -__version__ = "0.7.0" +__version__ = "0.7.1" # Set up logging to ``/dev/null`` like a library is supposed to. diff --git a/cloudbender/stack.py b/cloudbender/stack.py index 0b19aa6..c191edf 100644 --- a/cloudbender/stack.py +++ b/cloudbender/stack.py @@ -4,6 +4,7 @@ import hashlib import oyaml as yaml import json import time +import pprint from datetime import datetime, timedelta from dateutil.tz import tzutc @@ -33,20 +34,31 @@ class StackStatus(object): class Stack(object): - def __init__(self, name, template, path, rel_path, sg_config={}, ctx={}): + def __init__(self, name, template, path, rel_path, sg_config, ctx): self.stackname = name self.template = template self.path = path self.rel_path = rel_path self.ctx = ctx - self.tags = sg_config.get('tags', {}) - self.parameters = sg_config.get('parameters', {}) - self.options = sg_config.get('options', {}) - self.region = sg_config.get('region', 'global') - self.profile = sg_config.get('profile', '') - self.onfailure = sg_config.get('onfailure', "DELETE") - self.notfication_sns = sg_config.get('notification_sns', []) + self.tags = {} + self.parameters = {} + self.options = {} + self.region = 'global' + self.profile = '' + self.onfailure = 'DELETE' + self.notfication_sns = [] + + self.tags.update(sg_config.get('tags')) + self.parameters.update(sg_config.get('parameters')) + self.options.update(sg_config.get('options')) + + if 'region' in sg_config: + self.region = sg_config['region'] + if 'profile' in sg_config: + self.profile = sg_config['profile'] + if 'notfication_sns' in sg_config: + self.notfication_sns = sg_config['notfication_sns'] self.id = (self.profile, self.region, self.stackname) @@ -63,7 +75,7 @@ class Stack(object): self.multi_delete = True def dump_config(self): - logger.debug("".format(self.id, vars(self))) + logger.debug("".format(self.id, pprint.pformat(vars(self)))) def read_config(self): _config = read_config_file(self.path) diff --git a/cloudbender/stackgroup.py b/cloudbender/stackgroup.py index 721c71b..5502c54 100644 --- a/cloudbender/stackgroup.py +++ b/cloudbender/stackgroup.py @@ -1,6 +1,7 @@ import os import glob import logging +import pprint from .utils import dict_merge from .jinja import read_config_file @@ -26,7 +27,7 @@ class StackGroup(object): for sg in self.sgs: sg.dump_config() - logger.debug("".format(self.name, self.config)) + logger.debug("StackGroup {}: {}".format(self.rel_path, pprint.pformat(self.config))) for s in self.stacks: s.dump_config()