~tribaal/txaws/xss-hardening

« back to all changes in this revision

Viewing changes to txaws/ec2/client.py

  • Committer: kapil.thangavelu at canonical
  • Date: 2011-09-22 20:17:22 UTC
  • mfrom: (91.2.10 fix-s3-port)
  • mto: This revision was merged to the branch mainline in revision 99.
  • Revision ID: kapil.thangavelu@canonical.com-20110922201722-l4plcnk5wrr7eten
merge fix-s3-port-and-bucket-op [a=hazmat,jimbaker,spampas][r=therve][f=829609,824403]

Openstack compatibiity fixes.

 - S3 bucket operations use a trailing slash.
 - S3 Host and port are now configurable.
 - Security group parsing is now more forgiving.

Show diffs side-by-side

added added

removed removed

Lines of Context:
658
658
            if ip_permissions is None:
659
659
                ip_permissions = ()
660
660
            for ip_permission in ip_permissions:
 
661
 
 
662
                # openstack doesn't handle self authorized groups properly
 
663
                # XXX this is an upstream problem and should be addressed there
 
664
                # lp bug #829609
661
665
                ip_protocol = ip_permission.findtext("ipProtocol")
662
 
                from_port = int(ip_permission.findtext("fromPort"))
663
 
                to_port = int(ip_permission.findtext("toPort"))
 
666
                from_port = ip_permission.findtext("fromPort")
 
667
                to_port = ip_permission.findtext("toPort")
 
668
 
 
669
                if from_port:
 
670
                    from_port = int(from_port)
 
671
 
 
672
                if to_port:
 
673
                    to_port = int(to_port)
 
674
 
664
675
                for groups in ip_permission.findall("groups/item") or ():
665
676
                    user_id = groups.findtext("userId")
666
677
                    group_name = groups.findtext("groupName")