-
Notifications
You must be signed in to change notification settings - Fork 9
Conversation
yufangzhang
commented
Jul 4, 2016
•
edited
Loading
edited
- Modify fab task cfn_create, cfn_delete to mange multiple stacks.
- Create task set_active_stack(tag) to switch among stacks
- Add unit tests for new methods
934d86c
to
aeacbc9
Compare
aeacbc9
to
59d15be
Compare
""" | ||
r53_conn = get_connection(R53) | ||
zone_id = get_zone_id() | ||
record = "{}".format(get_tag_record_name(stack_tag)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could probably be simply:
record = get_tag_record_name(stack_tag)
i.e. without the call to format
.
@yufangzhang happy to merge after those couple of minor things @mattpep mentioned are fixedup! |
@mattpep I've done the changes. can you have a look ~? |
@mattpep @yufangzhang we happy to merge? |
LGTM. Ideally we should squash the fixup commit into the one it updates. Then it's good to merge. |
Args: | ||
stack_tag: the tag of stack | ||
Returns: | ||
True if stack exists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this accurate? To be specific does it return "True" if stack exists?
5136661
to
28db73d
Compare
@mattpep yeup, updated! |
The first bullet point of this PR makes reference to changing the task |
28db73d
to
c084386
Compare
@mattpep we generate |
1d167ad
to
7d5479e
Compare
Changes Unknown when pulling 7d5479e on create_multiple_stacks into * on master*. |
03d1037
to
b3bc543
Compare
Changes Unknown when pulling b3bc543 on create_multiple_stacks into * on master*. |
dcd5228
to
f34f0f4
Compare
Changes Unknown when pulling f34f0f4 on create_multiple_stacks into * on master*. |
r53_conn = get_connection(R53) | ||
zone_name = cfn_config.data.get('master_zone', None) | ||
record = "{}.{}".format(get_tag_record_name(stack_tag), zone_name) | ||
logger.info("fab_tasks::set_stack_name: " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
format
is better than using %s
in formatting a string, however, in logging
, %s
is actually preferred, so you would do:
logger.info("Creating stack suffix '%s' for record '%s'... %s...", stack_suffix, record, zone_id)
Changes Unknown when pulling 1df9b52 on create_multiple_stacks into * on master*. |
1df9b52
to
b88af34
Compare
Changes Unknown when pulling b88af34 on create_multiple_stacks into * on master*. |
@cliffxuan Thanks for the advice Cliff! I've made some changes to make it more pythonic 👻 |
Test starts failing with the error below, which is fixed in 2a595f1 (aka version 0.9 unreleased): ``` Traceback (most recent call last): File "/Users/yufang/.virtualenvs/test/bin/flake8", line 11, in <module> sys.exit(main()) File "/Users/yufang/.virtualenvs/test/lib/python2.7/site-packages/flake8/main/cli.py", line 16, in main app.run(argv) File "/Users/yufang/.virtualenvs/test/lib/python2.7/site-packages/flake8/main/application.py", line 316, in run self._run(argv) File "/Users/yufang/.virtualenvs/test/lib/python2.7/site-packages/flake8/main/application.py", line 299, in _run self.initialize(argv) File "/Users/yufang/.virtualenvs/test/lib/python2.7/site-packages/flake8/main/application.py", line 290, in initialize self.register_plugin_options() File "/Users/yufang/.virtualenvs/test/lib/python2.7/site-packages/flake8/main/application.py", line 150, in register_plugin_options self.check_plugins.register_options(self.option_manager) File "/Users/yufang/.virtualenvs/test/lib/python2.7/site-packages/flake8/plugins/manager.py", line 451, in register_options list(self.manager.map(register_and_enable)) File "/Users/yufang/.virtualenvs/test/lib/python2.7/site-packages/flake8/plugins/manager.py", line 261, in map yield func(self.plugins[name], *args, **kwargs) File "/Users/yufang/.virtualenvs/test/lib/python2.7/site-packages/flake8/plugins/manager.py", line 447, in register_and_enable call_register_options(plugin) File "/Users/yufang/.virtualenvs/test/lib/python2.7/site-packages/flake8/plugins/manager.py", line 357, in generated_function return method(optmanager, *args, **kwargs) File "/Users/yufang/.virtualenvs/test/lib/python2.7/site-packages/flake8/plugins/manager.py", line 207, in register_options add_options(optmanager) File "/Users/yufang/.virtualenvs/test/lib/python2.7/site-packages/flake8_import_order/flake8_linter.py", line 32, in add_options parser.config_options.append("application-import-names") AttributeError: 'OptionManager' object has no attribute 'config_options' ```
update cfn_create + cfn_delete with multiple stacks support add set_active_stack fab task
Add unittest on newly added methods.
b88af34
to
e920fc1
Compare
Changes Unknown when pulling e920fc1 on create_multiple_stacks into * on master*. |