mirror of
https://github.com/grahampugh/macadmin-scripts.git
synced 2025-12-17 17:56:33 +00:00
Catch IOError exception when trying to read the SeedCatalogs.plist; print any errors around SeedCatalogs.plist access to stderr.
This commit is contained in:
parent
e27cd94c07
commit
9f9ec905e8
@ -98,7 +98,8 @@ def get_seeding_program(sucatalog_url):
|
|||||||
if sucatalog_url == value:
|
if sucatalog_url == value:
|
||||||
return key
|
return key
|
||||||
return ''
|
return ''
|
||||||
except (OSError, ExpatError, AttributeError, KeyError):
|
except (OSError, IOError, ExpatError, AttributeError, KeyError) as err:
|
||||||
|
print(err, file=sys.stderr)
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
||||||
@ -107,7 +108,8 @@ def get_seed_catalog(seedname='DeveloperSeed'):
|
|||||||
try:
|
try:
|
||||||
seed_catalogs = read_plist(SEED_CATALOGS_PLIST)
|
seed_catalogs = read_plist(SEED_CATALOGS_PLIST)
|
||||||
return seed_catalogs.get(seedname)
|
return seed_catalogs.get(seedname)
|
||||||
except (OSError, ExpatError, AttributeError, KeyError):
|
except (OSError, IOError, ExpatError, AttributeError, KeyError) as err:
|
||||||
|
print(err, file=sys.stderr)
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
||||||
@ -116,7 +118,8 @@ def get_seeding_programs():
|
|||||||
try:
|
try:
|
||||||
seed_catalogs = read_plist(SEED_CATALOGS_PLIST)
|
seed_catalogs = read_plist(SEED_CATALOGS_PLIST)
|
||||||
return list(seed_catalogs.keys())
|
return list(seed_catalogs.keys())
|
||||||
except (OSError, ExpatError, AttributeError, KeyError):
|
except (OSError, IOError, ExpatError, AttributeError, KeyError) as err:
|
||||||
|
print(err, file=sys.stderr)
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user