Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

(WIP) Remove DNS tag in the event of rollback #253

Closed
wants to merge 1 commit into from
Closed

Conversation

mattpep
Copy link
Contributor

@mattpep mattpep commented Feb 23, 2017

Fixes #221

@@ -725,7 +731,15 @@ def cfn_create(test=False):
# So delete the SSL cert that we uploaded
if 'ssl' in cfn_config.data:
iam.delete_ssl_certificate(cfn_config.ssl(), stack_name)
abort('Failed to create stack: {0}'.format(stack))
# delete the DNS tag
for elb in get_public_elbs():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a get_all_elbs() is more appropriate here.

@@ -725,7 +731,15 @@ def cfn_create(test=False):
# So delete the SSL cert that we uploaded
if 'ssl' in cfn_config.data:
iam.delete_ssl_certificate(cfn_config.ssl(), stack_name)
abort('Failed to create stack: {0}'.format(stack))
# delete the DNS tag
for elb in get_all_elbs():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a PR to fix this chunk of code. basically if elb is empty, txt records won't be deleted. also txt record deletion is missing here. the PR has been merged. you could pull and have a look :p

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 59.786% when pulling 9f21a23 on dnstag_fix into 194ffb4 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 59.786% when pulling 09f29ad on dnstag_fix into 194ffb4 on master.

logger.info("Deleting DNS tag for '{stack} from '{zone}'...".format(stack=stack_id, zone=zone_name))
try:
print green("Removing tag stack from DNS...")
r53_conn.delete_txt_record(zone_name, zone_id, txt_tag_record)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r53_conn.delete_txt_record only removes txt record. we probably need to delete/check Alias record too?

r53_conn.delete_txt_record(zone_name, zone_id, txt_tag_record)
except boto.route53.exception.DNSServerError:
print red("Failed to remove DNS tag")
abort(red('Failed to create stack: {0}. You may want to delete it manually.'.format(stack)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, are we retaining the failed stack while removing the DNS records?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retaining the rolledback stack is current behaviour so I decided not to change it in this patch. I've a slight preference for not automatically deleting a rolledback stack but am open to discussion. But even if so, we should probably do it as a separate piece of work.

@lukaszraczylo
Copy link
Contributor

@mattpep & @yufangzhang any consensus on this or progress in merge?

@sevenmachines
Copy link
Contributor

@yufangzhang @mattpep @ltsampros Not quite sure why we're looking to delete records on rollback. We need them for cfn_delete the stack(?) Anyways, happy have my ignorance crushed by catching up and finding out :) But going to put in WIP for the moment

@sevenmachines sevenmachines changed the title Remove DNS tag in the event of rollback (WIP) Remove DNS tag in the event of rollback Mar 27, 2017
@filipposc5
Copy link
Contributor

A bit late to the party, but this PR is still open/pending. Niall's comment sounds right, if we are not dealing with a half created stack because we want to cfn_delete then we shouldn't need this PR altogether. So we should close this PR and document this expectation, perhaps under a workflow headline?

@mattpep
Copy link
Contributor Author

mattpep commented Apr 19, 2017

Invalid.

@mattpep mattpep closed this Apr 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants