Skip to content

Commit

Permalink
Merge pull request #83 from Guslington/develop
Browse files Browse the repository at this point in the history
fix up ignore config bug, ignore message, send ignore sns message
  • Loading branch information
Guslington committed Mar 25, 2019
2 parents e7ac12d + 7680893 commit b5bf934
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,4 +416,4 @@ shelvery_sqs_queue_wait_period=300
2. Run the `deploy-sam-template.sh` script with the options to deploy the template in the target account.

- `-b` [required] source bucket to deploy the sam package to
- `-v` [optional] shelvery version to deploy, defaults to `0.8.4`
- `-v` [optional] shelvery version to deploy, defaults to `0.8.5`
2 changes: 1 addition & 1 deletion deploy-sam-template.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e

SHELVERY_VERSION=0.8.4
SHELVERY_VERSION=0.8.5

while getopts ":b:v:a:" opt; do
case $opt in
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup

setup(name='shelvery', version='0.8.4', author='Base2Services R&D',
setup(name='shelvery', version='0.8.5', author='Base2Services R&D',
author_email='itsupport@base2services.com',
url='http://github.com/base2Services/shelvery-aws-backups',
classifiers=[
Expand Down
2 changes: 1 addition & 1 deletion shelvery/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.8.4'
__version__ = '0.8.5'
LAMBDA_WAIT_ITERATION = 'lambda_wait_iteration'
S3_DATA_PREFIX = 'backups'
SHELVERY_DO_BACKUP_TAGS = ['True', 'true', '1', 'TRUE']
13 changes: 11 additions & 2 deletions shelvery/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,17 @@ def create_backups(self) -> List[BackupResource]:
})
except ClientError as e:
if e.response['Error']['Code'] == 'InvalidDBInstanceState':
if RuntimeConfig.ignore_invalid_resource_state():
self.logger.warn(f"{backup_resource.name} of type {resource_type} is not in a state a backup can be taken")
if RuntimeConfig.ignore_invalid_resource_state(self):
ignore_message = f"{resource_type} {backup_resource.entity_id} is not in a state a backup can be taken. Skipping backup {backup_resource.name}"
self.snspublisher.notify({
'Operation': 'CreateBackup',
'Status': 'IGNORE',
'Message': ignore_message,
'BackupType': self.get_engine_type(),
'BackupName': backup_resource.name,
'EntityId': backup_resource.entity_id
})
self.logger.warn(ignore_message)
else:
self.snspublisher_error.notify({
'Operation': 'CreateBackup',
Expand Down
2 changes: 1 addition & 1 deletion template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Resources:
Tags:
Name: Shelvery
CreatedBy: Shelvery
ShelveryVersion: 0.8.4
ShelveryVersion: 0.8.5

Environment:
Variables:
Expand Down

0 comments on commit b5bf934

Please sign in to comment.