(args)
| 764 | |
| 765 | @staticmethod |
| 766 | def modify(args): |
| 767 | cf = CloudFront(Config()) |
| 768 | if len(args) > 1: |
| 769 | raise ParameterError("Too many parameters. Modify one Distribution at a time.") |
| 770 | try: |
| 771 | cfuri = Cmd._parse_args(args)[0] |
| 772 | except IndexError: |
| 773 | raise ParameterError("No valid Distribution URI found.") |
| 774 | response = cf.ModifyDistribution(cfuri, |
| 775 | cnames_add = Cmd.options.cf_cnames_add, |
| 776 | cnames_remove = Cmd.options.cf_cnames_remove, |
| 777 | comment = Cmd.options.cf_comment, |
| 778 | enabled = Cmd.options.cf_enable, |
| 779 | logging = Cmd.options.cf_logging, |
| 780 | default_root_object = Cmd.options.cf_default_root_object) |
| 781 | if response['status'] >= 400: |
| 782 | error("Distribution %s could not be modified: %s" % (cfuri, response['reason'])) |
| 783 | output("Distribution modified: %s" % cfuri) |
| 784 | response = cf.GetDistInfo(cfuri) |
| 785 | d = response['distribution'] |
| 786 | dc = d.info['DistributionConfig'] |
| 787 | pretty_output("Origin", S3UriS3.httpurl_to_s3uri(dc.info['S3Origin']['DNSName'])) |
| 788 | pretty_output("DistId", d.uri()) |
| 789 | pretty_output("DomainName", d.info['DomainName']) |
| 790 | pretty_output("Status", d.info['Status']) |
| 791 | pretty_output("CNAMEs", ", ".join(dc.info['CNAME'])) |
| 792 | pretty_output("Comment", dc.info['Comment']) |
| 793 | pretty_output("Enabled", dc.info['Enabled']) |
| 794 | pretty_output("DefaultRootObject", dc.info['DefaultRootObject']) |
| 795 | pretty_output("Etag", response['headers']['etag']) |
| 796 | |
| 797 | @staticmethod |
| 798 | def invalinfo(args): |
nothing calls this directly
no test coverage detected