Skip to content
This repository was archived by the owner on Jul 7, 2021. It is now read-only.

Commit 365bf05

Browse files
authored
Merge pull request #148 from remind101/fix_dependencies
Fixes troposphere dependency conflicts w/ stacker
2 parents a5806c7 + b6c8738 commit 365bf05

File tree

7 files changed

+26
-19
lines changed

7 files changed

+26
-19
lines changed

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
src_dir = os.path.dirname(__file__)
55

66
install_requires = [
7-
"stacker~=1.0.1",
8-
"troposphere~=1.9.5",
7+
"stacker>=1.0.1",
8+
"troposphere>=1.9.5",
9+
"awacs>=0.6.0",
910
]
1011

1112
tests_require = [
12-
"nose~=1.0",
13+
"nose",
1314
"mock~=2.0.0",
15+
"stacker>=1.1.1",
1416
]
1517

1618

stacker_blueprints/rds/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ def validate_db_instance_identifier(value, allow_empty=True):
3333
if not value and allow_empty:
3434
# Empty value will pick up default from stackname
3535
return value
36-
l = len(value)
3736
pattern = r"^[a-zA-Z][a-zA-Z0-9-]*$"
38-
if not (0 < l < 64):
37+
if not (0 < len(value) < 64):
3938
raise ValueError("Must be between 1 and 63 characters in length.")
4039
if not re.match(pattern, value):
4140
raise ValueError("Must match pattern: %s" % pattern)

tests/test_aws_lambda.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from types import MethodType
22

33
from stacker.context import Context
4+
from stacker.config import Config
45
from stacker.variables import Variable
56
from stacker_blueprints.aws_lambda import Function, FunctionScheduler
67
from stacker.blueprints.testutil import BlueprintTestCase
@@ -25,7 +26,7 @@ def setUp(self):
2526
"Runtime": "python2.7",
2627
"Timeout": 3,
2728
}
28-
self.ctx = Context({'namespace': 'test', 'environment': 'test'})
29+
self.ctx = Context(config=Config({'namespace': 'test'}))
2930

3031
def create_blueprint(self, name):
3132
return Function(name, self.ctx)

tests/test_cloudwatch_logs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from stacker.blueprints.testutil import BlueprintTestCase
44
from stacker.context import Context
5+
from stacker.config import Config
56
from stacker.variables import Variable
67

78
from stacker_blueprints.cloudwatch_logs import SubscriptionFilters
@@ -11,7 +12,7 @@
1112

1213
class TestSubscriptionFilters(BlueprintTestCase):
1314
def setUp(self):
14-
self.ctx = Context({'namespace': 'test'})
15+
self.ctx = Context(config=Config({'namespace': 'test'}))
1516

1617
def test_create_template(self):
1718
blueprint = SubscriptionFilters(

tests/test_generic.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@
22

33
from stacker.blueprints.testutil import BlueprintTestCase
44
from stacker.context import Context
5+
from stacker.config import Config
56
from stacker.variables import Variable
67

78
from stacker_blueprints.generic import GenericResourceCreator
89

910

1011
class TestGenericResourceCreator(BlueprintTestCase):
1112
def setUp(self):
12-
self.ctx = Context({'namespace': 'test'})
13+
self.ctx = Context(config=Config({'namespace': 'test'}))
1314

1415
def test_create_template(self):
15-
blueprint = GenericResourceCreator('test_generic_GenericResourceCreator', self.ctx)
16+
blueprint = GenericResourceCreator(
17+
'test_generic_GenericResourceCreator', self.ctx
18+
)
1619
blueprint.resolve_variables(
1720
[
1821
Variable('Class', 'ec2.Volume'),

tests/test_kms.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from stacker.context import Context
2+
from stacker.config import Config
23
from stacker.variables import Variable
34

45
from stacker_blueprints.kms import Key
@@ -8,7 +9,7 @@
89

910
class TestKmsKey(BlueprintTestCase):
1011
def setUp(self):
11-
self.ctx = Context({'namespace': 'test'})
12+
self.ctx = Context(config=Config({'namespace': 'test'}))
1213

1314
def test_kms_key(self):
1415
blueprint = Key('kms_key_a', self.ctx)
@@ -31,7 +32,7 @@ def test_kms_key_alias_not_in_keyalias(self):
3132
)
3233
blueprint.create_template()
3334
self.assertRenderedBlueprint(blueprint)
34-
35+
3536
def test_kms_key_without_properties(self):
3637
blueprint = Key('kms_key_c', self.ctx)
3738
blueprint.resolve_variables(
@@ -52,7 +53,3 @@ def test_kms_key_attributes_is_deprecated(self):
5253
)
5354
with self.assertRaises(DeprecationWarning):
5455
blueprint.create_template()
55-
56-
57-
if __name__ == '__main__':
58-
unittest.main()

tests/test_route53.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from stacker.context import Context
2+
from stacker.config import Config
23
from stacker.variables import Variable
34

45
from stacker_blueprints.route53 import (
@@ -8,9 +9,10 @@
89

910
from stacker.blueprints.testutil import BlueprintTestCase
1011

12+
1113
class TestRoute53(BlueprintTestCase):
1214
def setUp(self):
13-
self.ctx = Context({'namespace': 'test'})
15+
self.ctx = Context(config=Config({'namespace': 'test'}))
1416

1517
def test_create_template_hosted_zone_id(self):
1618
blueprint = DNSRecords('route53_dnsrecords', self.ctx)
@@ -92,10 +94,12 @@ def test_cloudfront_alias_adds_hosted_zone_id(self):
9294
]
9395
)
9496
record_sets = blueprint.create_template()
95-
self.assertEqual(record_sets[0].AliasTarget.HostedZoneId, "Z2FDTNDATAQYW2")
97+
self.assertEqual(record_sets[0].AliasTarget.HostedZoneId,
98+
"Z2FDTNDATAQYW2")
9699

97100
def test_elb_alias_proper_hosted_zone_id(self):
98-
blueprint = DNSRecords('test_route53_elb_alias_hosted_zone_id', self.ctx)
101+
blueprint = DNSRecords('test_route53_elb_alias_hosted_zone_id',
102+
self.ctx)
99103
blueprint.resolve_variables(
100104
[
101105
Variable(
@@ -105,7 +109,7 @@ def test_elb_alias_proper_hosted_zone_id(self):
105109
"Name": "host.testdomain.com.",
106110
"Type": "A",
107111
"AliasTarget": {
108-
"DNSName": "myelb-1234567890-abcdef.us-east-2.elb.amazonaws.com.",
112+
"DNSName": "myelb-1234567890-abcdef.us-east-2.elb.amazonaws.com.", # noqa
109113
},
110114
},
111115
]

0 commit comments

Comments
 (0)