percolate / ec2-security-groups-dumper

Dump your EC2 Security Groups as a CSV or JSON file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: class StringIO has no attribute 'StringIO'

opened this issue · comments

i was orignally getting this error with python 2:

AttributeError: class StringIO has no attribute 'StringIO'

i saw others had related issue and followed

changing
output = StringIO.StringIO()

to

output = StringIO()

now i get this error for both python 2 and python3 👍
Traceback (most recent call last):
File "/usr/local/bin/ec2-security-groups-dumper", line 10, in
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/ec2_security_groups_dumper/main.py", line 376, in main
print(firewall.csv)
File "/usr/local/lib/python3.7/site-packages/ec2_security_groups_dumper/main.py", line 269, in csv
for fr in self.rules:
File "/usr/local/lib/python3.7/site-packages/ec2_security_groups_dumper/main.py", line 197, in rules
rules_description=grant_row['description'])
File "/usr/local/lib/python3.7/site-packages/ec2_security_groups_dumper/main.py", line 66, in init
u'tcp', u'udp', u'icmp', u'icmpv6', "-1", None)
AssertionError

also i have done this:

Removing https://github.com/percolate/ec2-security-groups-dumper/blob/master/ec2_security_groups_dumper/main.py#L62-L63 from the code allows non tcp/udp protocols to come through as their IP protocol number, which is useful