From cf7ec1cea9bf8b3569347532206f1a160ce38684 Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Jan 01 2015 22:01:39 +0000 Subject: Merge branch 'master' of ssh://git.fedorahosted.org/git/fedora-infrastructure --- diff --git a/bfo/pxelinux.cfg/fedora_eol.conf b/bfo/pxelinux.cfg/fedora_eol.conf index 8a74bec..a987646 100644 --- a/bfo/pxelinux.cfg/fedora_eol.conf +++ b/bfo/pxelinux.cfg/fedora_eol.conf @@ -6,6 +6,22 @@ TEXT HELP Install end of life and no longer supported versions of Fedora ENDTEXT +label Fedora-18-i386 + MENU LABEL Fedora-18-i386 + kernel http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/i386/os/images/pxeboot/vmlinuz + initrd http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/i386/os/images/pxeboot/initrd.img + TEXT HELP + Selecting this will boot the Fedora 18 i386 installer. + ENDTEXT + +label Fedora-18-x86_64 + MENU LABEL Fedora-18-x86_64 + kernel http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/x86_64/os/images/pxeboot/vmlinuz + initrd http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/x86_64/os/images/pxeboot/initrd.img + TEXT HELP + Selecting this will boot the Fedora 18 x86_64 installer. + ENDTEXT + label Fedora-17-i386 MENU LABEL Fedora-17-i386 kernel http://download.fedoraproject.org/pub/fedora/linux/releases/17/Fedora/i386/os/images/pxeboot/vmlinuz diff --git a/bfo/pxelinux.cfg/fedora_install.conf b/bfo/pxelinux.cfg/fedora_install.conf index b5fab82..1adecd3 100644 --- a/bfo/pxelinux.cfg/fedora_install.conf +++ b/bfo/pxelinux.cfg/fedora_install.conf @@ -6,6 +6,24 @@ TEXT HELP Install currently supported Fedora releases ENDTEXT +label Fedora-21-x86_64 + MENU LABEL Fedora-21-x86_64 + kernel http://download.fedoraproject.org/pub/fedora/linux/releases/21/Server/x86_64/os/images/pxeboot/vmlinuz + initrd http://download.fedoraproject.org/pub/fedora/linux/releases/21/Server/x86_64/os/images/pxeboot/initrd.img + APPEND repo=http://download.fedoraproject.org/pub/fedora/linux/releases/21/Server/x86_64/os/ + TEXT HELP + Selecting this will boot the Fedora 21 x86_64 Server installer. + ENDTEXT + +label Fedora-21-i386 + MENU LABEL Fedora-21-i386 + kernel http://download.fedoraproject.org/pub/fedora/linux/releases/21/Server/i386/os/images/pxeboot/vmlinuz + initrd http://download.fedoraproject.org/pub/fedora/linux/releases/21/Server/i386/os/images/pxeboot/initrd.img + APPEND repo=http://download.fedoraproject.org/pub/fedora/linux/releases/21/Server/i386/os/ + TEXT HELP + Selecting this will boot the Fedora 21 i386 Server installer. + ENDTEXT + label Fedora-20-x86_64 MENU LABEL Fedora-20-x86_64 kernel http://download.fedoraproject.org/pub/fedora/linux/releases/20/Fedora/x86_64/os/images/pxeboot/vmlinuz @@ -42,24 +60,6 @@ label Fedora-19-i386 Selecting this will boot the Fedora 19 i386 installer. ENDTEXT -label Fedora-18-x86_64 - MENU LABEL Fedora-18-x86_64 - kernel http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/x86_64/os/images/pxeboot/vmlinuz - initrd http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/x86_64/os/images/pxeboot/initrd.img - APPEND repo=http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/x86_64/os/ - TEXT HELP - Selecting this will boot the Fedora 18 x86_64 installer. - ENDTEXT - -label Fedora-18-i386 - MENU LABEL Fedora-18-i386 - kernel http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/i386/os/images/pxeboot/vmlinuz - initrd http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/i386/os/images/pxeboot/initrd.img - APPEND repo=http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/i386/os/ - TEXT HELP - Selecting this will boot the Fedora 18 i386 installer. - ENDTEXT - label uplvl MENU LABEL Back MENU EXIT diff --git a/bfo/pxelinux.cfg/fedora_live.conf b/bfo/pxelinux.cfg/fedora_live.conf deleted file mode 100644 index c852b45..0000000 --- a/bfo/pxelinux.cfg/fedora_live.conf +++ /dev/null @@ -1,26 +0,0 @@ -PROMPT 0 -MENU TITLE Experimental -MENU LABEL ^Experimental - -TEXT HELP - Boot installable live media. -ENDTEXT - -label fedora_15_i686_live - MENU DEFAULT - MENU LABEL Fedora 15 TC1 i686 Live Desktop (memdisk) - TEXT HELP - Being tested - ENDTEXT - kernel memdisk - append iso initrd=http://serverbeach1.fedoraproject.org/pub/alt/stage/15.TC1/Live/i686/Fedora-15-i686-Live-Desktop.iso - IPAPPEND 3 - -label uplvl - IPAPPEND 3 - MENU LABEL Back - MENU EXIT - -label spacer - MENU LABEL - diff --git a/bfo/pxelinux.cfg/fedora_prerelease.conf b/bfo/pxelinux.cfg/fedora_prerelease.conf index 72021f7..f3da4aa 100644 --- a/bfo/pxelinux.cfg/fedora_prerelease.conf +++ b/bfo/pxelinux.cfg/fedora_prerelease.conf @@ -3,49 +3,9 @@ MENU TITLE Install Pre-release versions of Fedora MENU LABEL ^Install Pre-release versions of Fedora TEXT HELP - Install Pre-release versions of Fedora (Alpha, Beta). + Install Pre-release versions of Fedora (Alpha, Beta). (when available) ENDTEXT -label Fedora-20-Beta-x86_64 - MENU LABEL Fedora-20-Beta-x86_64 - kernel http://download.fedoraproject.org/pub/fedora/linux/releases/test/20-Beta/Fedora/x86_64/os/images/pxeboot/vmlinuz - initrd http://download.fedoraproject.org/pub/fedora/linux/releases/test/20-Beta/Fedora/x86_64/os/images/pxeboot/initrd.img - APPEND repo=http://download.fedoraproject.org/pub/fedora/linux/development/20/x86_64/os/ - TEXT HELP - Selecting this will boot the Fedora 20 Beta x86_64 installer. - Note that this is a PRE-RELEASE version. - ENDTEXT - -label Fedora-20-Beta-i386 - MENU LABEL Fedora-20-Beta-i386 - kernel http://download.fedoraproject.org/pub/fedora/linux/releases/test/20-Beta/Fedora/i386/os/images/pxeboot/vmlinuz-PAE - initrd http://download.fedoraproject.org/pub/fedora/linux/releases/test/20-Beta/Fedora/i386/os/images/pxeboot/initrd-PAE.img - APPEND repo=http://download.fedoraproject.org/pub/fedora/linux/development/20/i386/os/ - TEXT HELP - Selecting this will boot the Fedora 20 Beta i386 installer. - Note that this is a PRE-RELEASE version. - ENDTEXT - -label Fedora-20-Alpha-x86_64 - MENU LABEL Fedora-20-Alpha-x86_64 - kernel http://download.fedoraproject.org/pub/fedora/linux/releases/test/20-Alpha/Fedora/x86_64/os/images/pxeboot/vmlinuz - initrd http://download.fedoraproject.org/pub/fedora/linux/releases/test/20-Alpha/Fedora/x86_64/os/images/pxeboot/initrd.img - APPEND repo=http://download.fedoraproject.org/pub/fedora/linux/development/20/x86_64/os/ - TEXT HELP - Selecting this will boot the Fedora 20 Alpha x86_64 installer. - Note that this is a PRE-RELEASE version. - ENDTEXT - -label Fedora-20-Alpha-i386 - MENU LABEL Fedora-20-Alpha-i386 - kernel http://download.fedoraproject.org/pub/fedora/linux/releases/test/20-Alpha/Fedora/i386/os/images/pxeboot/vmlinuz-PAE - initrd http://download.fedoraproject.org/pub/fedora/linux/releases/test/20-Alpha/Fedora/i386/os/images/pxeboot/initrd-PAE.img - APPEND repo=http://download.fedoraproject.org/pub/fedora/linux/development/20/i386/os/ - TEXT HELP - Selecting this will boot the Fedora 20 Alpha i386 installer. - Note that this is a PRE-RELEASE version. - ENDTEXT - label uplvl IPAPPEND 3 MENU LABEL Back diff --git a/bfo/pxelinux.cfg/fedora_rescue.conf b/bfo/pxelinux.cfg/fedora_rescue.conf index f7d48cd..d68549a 100644 --- a/bfo/pxelinux.cfg/fedora_rescue.conf +++ b/bfo/pxelinux.cfg/fedora_rescue.conf @@ -43,24 +43,6 @@ label Fedora-19-x86_64-rescue Selecting this will boot the Fedora 19 x86_64 installer in rescue mode. ENDTEXT -label Fedora-18-i386-rescue - MENU LABEL Fedora-18-i386-rescue - kernel http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/i386/os/images/pxeboot/vmlinuz - initrd http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/i386/os/images/pxeboot/initrd.img - APPEND rescue - TEXT HELP - Selecting this will boot the Fedora 18 i386 installer in rescue mode - ENDTEXT - -label Fedora-18-x86_64-rescue - MENU LABEL Fedora-18-x86_64-rescue - kernel http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/x86_64/os/images/pxeboot/vmlinuz - initrd http://download.fedoraproject.org/pub/fedora/linux/releases/18/Fedora/x86_64/os/images/pxeboot/initrd.img - APPEND rescue - TEXT HELP - Selecting this will boot the Fedora 18 x86_64 installer in rescue mode. - ENDTEXT - label uplvl MENU LABEL Back MENU EXIT diff --git a/calendars/README b/calendars/README index 4ab3e56..d9d7166 100644 --- a/calendars/README +++ b/calendars/README @@ -1,7 +1,3 @@ -These ics files are ical feeds, which you can download and import into your -favorite calendar application. - -infrastructure-planned-outages.ics - Planned outages upcoming. -infrastructure-upcoming.ics - Other infrastructure events. Freezes, deployments, - vacations or other general events. - +Please see our calendars at https://apps.fedoraproject.org/calendar/list/infrastructure/ +and +https://apps.fedoraproject.org/calendar/list/infrastructure-outages/ diff --git a/calendars/infrastructure-planned-outages.ics b/calendars/infrastructure-planned-outages.ics deleted file mode 100644 index 0ce1be0..0000000 --- a/calendars/infrastructure-planned-outages.ics +++ /dev/null @@ -1,59 +0,0 @@ -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Xfce//Orage//EN -BEGIN:VEVENT -UID:Orage-20110513T200314Z2-500@ohm.scrye.com -CLASS:PUBLIC -DTSTAMP:20110513T200316Z -CREATED:20110513T200314Z -LAST-MODIFIED:20110513T200316Z -SUMMARY:OUTAGE: noc01 migration -CATEGORIES:outage -CATEGORIES:outage -DTSTART:20110530T200000Z -DURATION:PT30M -TRANSP:OPAQUE -BEGIN:VALARM -TRIGGER;VALUE=DURATION:-PT5M -ACTION:DISPLAY -DESCRIPTION:OUTAGE: noc01 migration -X-ORAGE-DISPLAY-ALARM:ORAGE -END:VALARM -BEGIN:VALARM -TRIGGER;VALUE=DURATION:-PT5M -ACTION:AUDIO -ATTACH:/usr/share/orage/sounds/Spo.wav -END:VALARM -END:VEVENT -BEGIN:VEVENT -UID:Orage-20110513T201628Z3-500@ohm.scrye.com -CLASS:PUBLIC -DTSTAMP:20110513T201652Z -CREATED:20110513T201628Z -LAST-MODIFIED:20110513T201652Z -SUMMARY:OUTAGE: serverbeach network maintinance -DESCRIPTION:affects the following infrastructure machines: - \nserverbeach1\nserverbeach2\n\tContains: collab1\, - ns1\nserverbeach3\n\tContains: collab2\n\nMachines will only have - possible short connectivity issues sometime in the window. -LOCATION:serverbeach servers -CATEGORIES:outage -DTSTART;TZID=America/New_York:20110531T000000 -DTEND;TZID=America/New_York:20110531T050000 -TRANSP:OPAQUE -BEGIN:VALARM -TRIGGER;VALUE=DURATION:-PT5M -ACTION:DISPLAY -DESCRIPTION:affects the following infrastructure machines: - \nserverbeach1\nserverbeach2\n\tContains: collab1\, - ns1\nserverbeach3\n\tContains: collab2\n\nMachines will only have - possible short connectivity issues sometime in the window. -X-ORAGE-DISPLAY-ALARM:ORAGE -END:VALARM -BEGIN:VALARM -TRIGGER;VALUE=DURATION:-PT5M -ACTION:AUDIO -ATTACH:/usr/share/orage/sounds/Spo.wav -END:VALARM -END:VEVENT -END:VCALENDAR diff --git a/calendars/infrastructure-upcoming.ics b/calendars/infrastructure-upcoming.ics deleted file mode 100644 index b75018a..0000000 --- a/calendars/infrastructure-upcoming.ics +++ /dev/null @@ -1,105 +0,0 @@ -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Xfce//Orage//EN -BEGIN:VEVENT -UID:Orage-20110513T195737Z0-500@ohm.scrye.com -CLASS:PUBLIC -DTSTAMP:20110513T195801Z -CREATED:20110513T195737Z -LAST-MODIFIED:20110513T195801Z -SUMMARY:Infrastructure Meeting -LOCATION:#fedora-meeting on irc.freenode.net -DTSTART:20110519T190000Z -DURATION:PT1H -TRANSP:OPAQUE -RRULE:FREQ=WEEKLY -BEGIN:VALARM -TRIGGER;VALUE=DURATION:-PT5M -ACTION:DISPLAY -DESCRIPTION:Infrastructure Meeting -X-ORAGE-DISPLAY-ALARM:ORAGE -END:VALARM -BEGIN:VALARM -TRIGGER;VALUE=DURATION:-PT5M -ACTION:AUDIO -ATTACH:/usr/share/orage/sounds/Spo.wav -END:VALARM -END:VEVENT -BEGIN:VEVENT -UID:Orage-20110513T200112Z1-500@ohm.scrye.com -CLASS:PUBLIC -DTSTAMP:20110513T200113Z -CREATED:20110513T200112Z -LAST-MODIFIED:20110513T200113Z -SUMMARY:Final infrastructre freeze -DTSTART;VALUE=DATE:20110510 -DTEND;VALUE=DATE:20110526 -TRANSP:OPAQUE -BEGIN:VALARM -TRIGGER;VALUE=DURATION:-PT5M -ACTION:DISPLAY -DESCRIPTION:Final infrastructre freeze -X-ORAGE-DISPLAY-ALARM:ORAGE -END:VALARM -BEGIN:VALARM -TRIGGER;VALUE=DURATION:-PT5M -ACTION:AUDIO -ATTACH:/usr/share/orage/sounds/Spo.wav -END:VALARM -END:VEVENT -BEGIN:VEVENT -UID:Orage-20110513T200314Z2-500@ohm.scrye.com -CLASS:PUBLIC -DTSTAMP:20110513T200316Z -CREATED:20110513T200314Z -LAST-MODIFIED:20110513T200316Z -SUMMARY:OUTAGE: noc01 migration -CATEGORIES:outage -CATEGORIES:outage -DTSTART:20110530T200000Z -DURATION:PT30M -TRANSP:OPAQUE -BEGIN:VALARM -TRIGGER;VALUE=DURATION:-PT5M -ACTION:DISPLAY -DESCRIPTION:OUTAGE: noc01 migration -X-ORAGE-DISPLAY-ALARM:ORAGE -END:VALARM -BEGIN:VALARM -TRIGGER;VALUE=DURATION:-PT5M -ACTION:AUDIO -ATTACH:/usr/share/orage/sounds/Spo.wav -END:VALARM -END:VEVENT -BEGIN:VEVENT -UID:Orage-20110513T201628Z3-500@ohm.scrye.com -CLASS:PUBLIC -DTSTAMP:20110513T201652Z -CREATED:20110513T201628Z -LAST-MODIFIED:20110513T201652Z -SUMMARY:OUTAGE: serverbeach network maintinance -DESCRIPTION:affects the following infrastructure machines: - \nserverbeach1\nserverbeach2\n\tContains: collab1\, - ns1\nserverbeach3\n\tContains: collab2\n\nMachines will only have - possible short connectivity issues sometime in the window. -LOCATION:serverbeach servers -CATEGORIES:outage -DTSTART;TZID=America/New_York:20110531T000000 -DTEND;TZID=America/New_York:20110531T050000 -TRANSP:OPAQUE -BEGIN:VALARM -TRIGGER;VALUE=DURATION:-PT5M -ACTION:DISPLAY -DESCRIPTION:affects the following infrastructure machines: - \nserverbeach1\nserverbeach2\n\tContains: collab1\, - ns1\nserverbeach3\n\tContains: collab2\n\nMachines will only have - possible short connectivity issues sometime in the window. -X-ORAGE-DISPLAY-ALARM:ORAGE -END:VALARM -BEGIN:VALARM -TRIGGER;VALUE=DURATION:-PT5M -ACTION:AUDIO -ATTACH:/usr/share/orage/sounds/Spo.wav -END:VALARM -END:VEVENT -END:VCALENDAR diff --git a/scripts/gather-diff-instances/gather-diff-instances.py b/scripts/gather-diff-instances/gather-diff-instances.py new file mode 100755 index 0000000..bf74e4d --- /dev/null +++ b/scripts/gather-diff-instances/gather-diff-instances.py @@ -0,0 +1,173 @@ +#!/usr/bin/python +# skvidal +# fedoraproject.org - +# run the json outputter +# output to /var/log/instance-lists/timestamp +# compare newest one to the last one +# mail results to mailto, if any +# ignore instances with a key_name in blacklist + + +destdir='/var/log/instance-lists/' +mailto='admin@fedoraproject.org' +blacklist=['buildsys'] + + +import sys +import time +import json +import glob +import os +import smtplib +from email.MIMEText import MIMEText + +from nova import context +from nova import db +from nova import flags + + + +def list_vms(host=None): + """ + make a list of vms and expand out their fixed_ip and floating ips sensibly + """ + flags.parse_args([]) + my_instances = [] + if host is None: + instances = db.instance_get_all(context.get_admin_context()) + else: + instances = db.instance_get_all_by_host( + context.get_admin_context(), host) + + for instance in instances: + my_inst = {} + my_inst = dict(instance).copy() + for (k,v) in my_inst.items(): + try: + json.encoder(v) + except TypeError, e: + v = str(v) + my_inst[k] = v + + ec2_id = db.get_ec2_instance_id_by_uuid(context.get_admin_context(), instance.uuid) + ec2_id = 'i-' + hex(int(ec2_id)).replace('0x', '').zfill(8) + my_inst['ec2_id'] = ec2_id + try: + fixed_ips = db.fixed_ip_get_by_instance(context.get_admin_context(), instance.uuid) + except: + pass + my_inst['fixed_ips'] = [ ip.address for ip in fixed_ips ] + my_inst['floating_ips'] = [] + for ip in fixed_ips: + my_inst['floating_ips'].extend([ f_ip.address for f_ip in db.floating_ip_get_by_fixed_address(context.get_admin_context(), ip.address)]) + + my_instances.append(my_inst) + return my_instances + + + +def diff_instances(old, new): + """ + Take 2 lists of instances @old, @new + diff them and return a list of strings citing changes. + """ + old_uuids = {} + new_uuids = {} + for vm in old: + old_uuids[vm['uuid']] = vm + + for vm in new: + new_uuids[vm['uuid']] = vm + + uuids = set(new_uuids.keys() + old_uuids.keys()) + ret = [] + ret_added = [] + ret_removed = [] + removed = [] + added = [] + for uuid in sorted(uuids): + if uuid not in new_uuids: + vm = old_uuids[uuid] + removed.append(vm) + + elif uuid not in old_uuids: + vm = new_uuids[uuid] + added.append(vm) + + + else: + old_vm = old_uuids[uuid] + new_vm = new_uuids[uuid] + changed = [] + for k,v in old_vm.items(): + if v != new_vm.get(k, 'NOT_A_MATCH'): + changed.append(k) + if changed: + ret.append('Changes to: %s' % uuid) + for k in changed: + ret.append(" %s changed from '%s' to '%s'" % (k, old_vm[k], new_vm[k])) + + for vm in added: + if vm['key_name'] not in blacklist: + ret_added.append(' %s %s %s %s' % (uuid, vm['display_name'], vm['floating_ips'][0], vm['key_name'])) + if ret_added: + ret_added[:0].append('Instance(s) Added:\n') + + for vm in removed: + if vm['floating_ips'][0] and (vm['key_name'] not in blacklist): + ret_removed.append(' %s %s %s %s' % (uuid, vm['display_name'], vm['floating_ips'][0], vm['key_name'])) + if ret_removed: + ret_removed[:0].append('Instance(s) Removed:\n') + + ret = ret + ret_added + ret_removed + return ret + + + +def email(to, subject, text): + """ + send email + """ + mail_from = 'cloudadmin@fedoraproject.org' + mail_to = '%s' % to + + output = text + + msg = MIMEText(output) + msg['Subject'] = subject + msg['From'] = mail_from + msg['To'] = mail_to + s = smtplib.SMTP() + s.connect() + s.sendmail(mail_from, [mail_to], msg.as_string()) + s.close() + + +def main(): + if not os.path.exists(destdir): + os.makedirs(destdir) + + + # get the instances list + new_instances = list_vms() + now=time.strftime('%Y-%m-%d-%H:%M.json') + f = open(destdir + '/' + now, 'w') + f.write(json.dumps(new_instances)) + f.close() + + # get the last one + fns = [fn for fn in glob.glob(destdir + '/*.json') ] + if len(fns) < 2: + return + + last = sorted(fns)[-2] + old_instances = json.load(open(last)) + res = diff_instances(old_instances, new_instances) + + if res: + email(mailto, "Changes to cloud instances", '\n'.join(res)) + + +if __name__ == "__main__": + main() + diff --git a/scripts/process-git-requests/README b/scripts/process-git-requests/README new file mode 100644 index 0000000..1a9a354 --- /dev/null +++ b/scripts/process-git-requests/README @@ -0,0 +1,3 @@ +processing scm is moving to be part of releng, as a result the home of this script is now +https://git.fedorahosted.org/cgit/releng/tree/scripts/process-git-requests + diff --git a/scripts/review-stats/review-stats.py b/scripts/review-stats/review-stats.py index 1e60d27..f1aa556 100755 --- a/scripts/review-stats/review-stats.py +++ b/scripts/review-stats/review-stats.py @@ -98,7 +98,7 @@ def parse_config(file): section_string = ','.join(section_list) if error == False: error = 'Missing value or section.' - print ','.join(section_list), '=', error + print(','.join(section_list), '=', error) sys.exit(1) return cfg['global'] @@ -297,7 +297,7 @@ def run_query(bz): return [bugs, bugdata, usermap] # Need to generate reports: - # "Accepted" and closed + # "Accepted" and closed # "Accepted" but still open # "Accepted" means either fedora-review+ or blocking FE-ACCEPT # fedora-review- and closed @@ -316,11 +316,15 @@ def write_html(loader, template, data, dir, fname): path = os.path.join(dir, fname) try: f = open(path, "w") - except IOError, (err, strerr): - print 'ERROR: %s: %s' % (strerr, path) + except: + print("Error opening %s" % (path)) sys.exit(1) - f.write(output.render()) + for line in output.render().splitlines(): + try: + f.write(line.encode('utf8')) + except UnicodeError as e: + print(e.encoding, e.reason, e.object) f.close() # Selection functions (should all be predicates)