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

Update aws regions #183

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all 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
14 changes: 8 additions & 6 deletions glacier/GlacierWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
.. module:: GlacierWrapper
:platform: Unix, Windows
:synopsis: Wrapper for accessing Amazon Glacier, with Amazon SimpleDB
:synopsis: Wrapper for accessing Amazon Glacier, with Amazon SimpleDB
support and other features.
"""

Expand Down Expand Up @@ -113,20 +113,22 @@ class GlacierWrapper(object):
MAX_VAULT_NAME_LENGTH = 255
MAX_VAULT_DESCRIPTION_LENGTH = 1024
MAX_PARTS = 10000
AVAILABLE_REGIONS = ('us-east-1', 'us-west-2', 'us-west-1',
AVAILABLE_REGIONS = ('us-east-1', 'us-east-2', 'us-west-2', 'us-west-1',
'eu-west-1', 'eu-central-1', 'sa-east-1',
'ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2')
'ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2', 'ap-south-1')
AVAILABLE_REGIONS_MESSAGE = """\
Invalid region. Available regions for Amazon Glacier are:
us-east-1 (US - Virginia)
us-east-2 (US - Ohio)
us-west-1 (US - N. California)
us-west-2 (US - Oregon)
eu-west-1 (EU - Ireland)
eu-central-1 (EU - Frankfurt)
sa-east-1 (South America - Sao Paulo)
ap-northeast-1 (Asia-Pacific - Tokyo)
ap-southeast-1 (Asia Pacific (Singapore)
ap-southeast-2 (Asia-Pacific - Sydney)\
ap-southeast-2 (Asia-Pacific - Sydney)
ap-south-1 (Asia-Pacific - Mumbai)\
"""

def setuplogging(self, logfile, loglevel, logtostdout):
Expand Down Expand Up @@ -1854,7 +1856,7 @@ def sns_subscribe(self, protocol, endpoint, topic, sns_options, vault_names=None
if vault_names:
vaults = vault_names.split(",")
self._init_events_for_vaults(vaults, topic_arn)

topic_arns = [topic_arn]

if len(topic_arns):
Expand All @@ -1876,7 +1878,7 @@ def sns_subscribe(self, protocol, endpoint, topic, sns_options, vault_names=None
@sns_connect
def sns_list_topics(self, sns_options):
topics = self.sns_conn.get_all_topics()['ListTopicsResponse']['ListTopicsResult']['Topics']

results = []
for topic in topics:
results += [{"Topic":topic['TopicArn'].split(":")[-1], "Topic ARN":topic['TopicArn']}]
Expand Down