Skip to content

Commit

Permalink
fix autoscaling topic
Browse files Browse the repository at this point in the history
  • Loading branch information
hjacobs committed Apr 15, 2015
1 parent 664ea98 commit 0f33c7f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion senza/__init__.py
@@ -1 +1 @@
__version__ = '0.21'
__version__ = '0.22'
4 changes: 2 additions & 2 deletions senza/components.py
Expand Up @@ -5,7 +5,7 @@
import click
import yaml

from .aws import get_security_group, find_ssl_certificate_arn
from .aws import get_security_group, find_ssl_certificate_arn, resolve_topic_arn
from .utils import named_value, ensure_keys


Expand Down Expand Up @@ -225,7 +225,7 @@ def component_auto_scaling_group(definition, configuration, args, info):
"autoscaling:EC2_INSTANCE_TERMINATE",
"autoscaling:EC2_INSTANCE_TERMINATE_ERROR"
],
"TopicARN": info["OperatorTopicId"]
"TopicARN": resolve_topic_arn(args.region, info["OperatorTopicId"])
}

if "ElasticLoadBalancer" in configuration:
Expand Down
5 changes: 5 additions & 0 deletions tests/test_cli.py
Expand Up @@ -69,6 +69,11 @@ def test_print_auto(monkeypatch):
monkeypatch.setattr('boto.ec2.connect_to_region', lambda x: MagicMock(get_all_images=lambda filters: images,
get_all_security_groups=lambda: [sg]))

sns = MagicMock()
topic = {'TopicArn': 'arn:123:mytopic'}
sns.get_all_topics.return_value = {'ListTopicsResponse': {'ListTopicsResult': {'Topics': [topic]}}}
monkeypatch.setattr('boto.sns.connect_to_region', MagicMock(return_value=sns))

data = {'SenzaInfo': {'StackName': 'test',
'OperatorTopicId': 'mytopic'},
'SenzaComponents': [{'Configuration': {'Type': 'Senza::StupsAutoConfiguration'}},
Expand Down

0 comments on commit 0f33c7f

Please sign in to comment.