Skip to content

Commit

Permalink
Adding Lint tests, modifications to Marco Fragment output for correct…
Browse files Browse the repository at this point in the history
… types
  • Loading branch information
neoghostz committed Jan 10, 2019
1 parent 88089d4 commit ac679a2
Show file tree
Hide file tree
Showing 14 changed files with 6,425 additions and 2,452 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
kombustion.yaml
*.zip
*.pyc
*/*.pyc
*.__pycache__
__pycache__
.cache
*~
*.pyc
*.swp
.coverage
coverage*
Expand Down
4 changes: 3 additions & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ pycodestyle==2.2.0
coverage==4.3.4
pynt==0.8.1
pyyaml>=4.2b1
coveralls==1.5.1
coveralls==1.5.1
awscli>=1.16.85
cfn-lint>=0.11.1
Binary file removed src/__init__.pyc
Binary file not shown.
23 changes: 15 additions & 8 deletions src/macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ def isIPv6Route(cidr):
return "DestinationCidrBlock"


def str2bool(v):
if v.lower() in ("yes", "true", "t", "1"):
return True
else:
return False


def buildTransitGateways(properties, resources, outputs):
for transitgw, objects in properties["TransitGateways"].iteritems():
resources[transitgw + "TransitGWAttach"] = {
Expand Down Expand Up @@ -241,17 +248,17 @@ def buildNetworlACLs(properties, resources, outputs):
"Type": "AWS::EC2::NetworkAclEntry",
"Properties": {
isIPv6NetACL(splitset[4]): splitset[4],
"Egress": splitset[3],
"Egress": str2bool(splitset[3]),
"NetworkAclId": {
"Ref": networkacl
},
"PortRange": {
"From": splitset[5],
"To": splitset[6]
"From": int(splitset[5]),
"To": int(splitset[6])
},
"Protocol": splitset[1],
"Protocol": int(splitset[1]),
"RuleAction": splitset[2],
"RuleNumber": splitset[0]
"RuleNumber": int(splitset[0])
}
}

Expand Down Expand Up @@ -428,8 +435,8 @@ def buildBaseline(properties, resources, outputs):
"Type": "AWS::EC2::VPC",
"Properties": {
"CidrBlock": properties["CIDR"],
"EnableDnsHostnames": "true",
"EnableDnsSupport": "true",
"EnableDnsHostnames": True,
"EnableDnsSupport": True,
"InstanceTenancy": "default",
"Tags": [
{
Expand Down Expand Up @@ -460,7 +467,7 @@ def buildBaseline(properties, resources, outputs):
"VpcId": {
"Ref": properties["Details"]["VPCName"]
},
"AmazonProvidedIpv6CidrBlock": "true"
"AmazonProvidedIpv6CidrBlock": True
}
}

Expand Down
Binary file removed src/macro.pyc
Binary file not shown.
1 change: 0 additions & 1 deletion tests/.cache/v/cache/lastfailed

This file was deleted.

Binary file removed tests/__init__.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit ac679a2

Please sign in to comment.