Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed fix for issue #5 #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Proposed fix for issue #5 #6

wants to merge 3 commits into from

Conversation

nonspecialist
Copy link

  • Determine whether an RDS resource is a cluster prior to snapshotting
  • use the appropriate snapshot method

- missing `self` call
- removed exception for flow control.
Copy link
Contributor

@stevemac007 stevemac007 left a comment

Choose a reason for hiding this comment

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

Pushed updates and additional tests to cover the new code.

I'm happy with it now, hopefully @wobeng will be able to validate this works as expected once its merged.


def is_cluster(self, resource):
try:
return resource['DBClusterIdentifier'] is not None
Copy link
Contributor

Choose a reason for hiding this comment

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

Can do this as

return 'DBClusterIdentifier' in resource

And not need the try except.

current_snap = self.conn.create_db_snapshot(DBInstanceIdentifier=self.resolve_backupable_id(resource),
DBSnapshotIdentifier=snapshot_id,
Tags=aws_tagset)
if is_cluster(resource):
Copy link
Contributor

@stevemac007 stevemac007 Aug 23, 2017

Choose a reason for hiding this comment

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

if self.is_cluster(resource):

@stevemac007
Copy link
Contributor

Looking further into the API I think this is a bit more complex than the current approach supports. I might have to actually build a cluster and see what responses come back from AWS to make it work.

@wobeng
Copy link
Contributor

wobeng commented Aug 23, 2017

Take a look at #8 . It has db cluster support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants