Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from botocore.exceptions import ClientError
import pg8000.native
import os
import time

try:
db_instance_identifier = os.environ['SOURCE_DATABASE_IDENTIFIER']
Expand Down Expand Up @@ -112,14 +113,19 @@
SourceRegion=aws_region
)

waiters = source.get_waiter('db_snapshot_completed')
waiters.wait(
DBSnapshotIdentifier=shared_snapshot_identifier,
WaiterConfig={
'Delay': 15,
'MaxAttempts': 100
}
)
attempt = 0
while attempt < 300:
response = source.describe_db_snapshots(DBSnapshotIdentifier=shared_snapshot_identifier)
snapshot_status = response['DBSnapshots'][0]['Status']

if snapshot_status == 'available':
print(f"Snapshot {shared_snapshot_identifier} is now available.")
break
else:
print(f"Snapshot {shared_snapshot_identifier} status: {snapshot_status}. Waiting...")

time.sleep(60)
attempt += 1

print("Share snapshot " + shared_snapshot_identifier + " with " + destination_aws_account + " AWS account")
source.modify_db_snapshot_attribute(
Expand Down
1 change: 1 addition & 0 deletions doc/release/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ to modify moderation event `status`.
* The RDS instance for `production` has been upgraded to `db.m6in.4xlarge` and configured to operate in a single Availability Zone.

### Bugfix
* [OSDEV-1388](https://opensupplyhub.atlassian.net/browse/OSDEV-1388) - The waiter from boto3 cannot wait more than half an hour so we replaced it with our own.
* [OSDEV-1335](https://opensupplyhub.atlassian.net/browse/OSDEV-1335) - Fixed the assertion in the test for the `country.rb` filter of the "production locations" Logstash pipeline. The main issue was with the evaluation of statements in the Ruby block. Since only the last statement is evaluated in a Ruby block, all the checks were grouped into one chain of logical statements and returned as a `result` variable at the end.

### What's new
Expand Down