(parser, options, zip_filename)
| 757 | |
| 758 | |
| 759 | def generate_upload_url(parser, options, zip_filename): |
| 760 | upload_url = None |
| 761 | if options.upload_host: |
| 762 | if not options.upload_customer: |
| 763 | parser.error("Need --customer when --upload-host is given") |
| 764 | |
| 765 | scheme, netloc, path = parse_host(options.upload_host) |
| 766 | |
| 767 | customer = urllib.parse.quote(options.upload_customer) |
| 768 | fname = urllib.parse.quote(os.path.basename(zip_filename)) |
| 769 | if options.upload_ticket: |
| 770 | full_path = "%s/%s/%d/%s" % (path, customer, options.upload_ticket, fname) |
| 771 | else: |
| 772 | full_path = "%s/%s/%s" % (path, customer, fname) |
| 773 | |
| 774 | upload_url = urllib.parse.urlunsplit((scheme, netloc, full_path, "", "")) |
| 775 | log("Will upload collected .zip file into %s" % upload_url) |
| 776 | return upload_url |
| 777 | |
| 778 | |
| 779 | def check_ticket(option, opt, value): |
no test coverage detected