mirror of
https://github.com/munki/munki.git
synced 2026-05-03 02:40:32 -05:00
Remove more cases of premature str() conversion for munkicommon.display_*() functions. Addresses potential unicode issues.
This commit is contained in:
@@ -202,7 +202,7 @@ def runScript(script, display_name, runtype):
|
||||
except utils.ScriptNotFoundError:
|
||||
pass # script is not required, so pass
|
||||
except utils.RunExternalScriptError, err:
|
||||
munkicommon.display_warning(str(err))
|
||||
munkicommon.display_warning(err)
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@@ -483,7 +483,7 @@ def debug_output():
|
||||
munkicommon.display_debug1(
|
||||
security('show-keychain-info', keychainfile))
|
||||
except SecurityError, err:
|
||||
munkicommon.display_error(str(err))
|
||||
munkicommon.display_error(err)
|
||||
|
||||
|
||||
class SecurityError(Exception):
|
||||
|
||||
@@ -1253,7 +1253,7 @@ def installedState(item_pl):
|
||||
foundnewer = True
|
||||
except munkicommon.Error, errmsg:
|
||||
# some problem with the installs data
|
||||
munkicommon.display_error(str(errmsg))
|
||||
munkicommon.display_error(errmsg)
|
||||
# return 1 so we're marked as not needing to be installed
|
||||
return 1
|
||||
|
||||
@@ -1271,7 +1271,7 @@ def installedState(item_pl):
|
||||
foundnewer = True
|
||||
except munkicommon.Error, errmsg:
|
||||
# some problem with the receipts data
|
||||
munkicommon.display_error(str(errmsg))
|
||||
munkicommon.display_error(errmsg)
|
||||
# return 1 so we're marked as not needing to be installed
|
||||
return 1
|
||||
|
||||
@@ -1327,7 +1327,7 @@ def someVersionInstalled(item_pl):
|
||||
return False
|
||||
except munkicommon.Error, errmsg:
|
||||
# some problem with the installs data
|
||||
munkicommon.display_error(str(errmsg))
|
||||
munkicommon.display_error(errmsg)
|
||||
return False
|
||||
|
||||
# if there is no 'installs' key, then we'll use receipt info
|
||||
@@ -1341,7 +1341,7 @@ def someVersionInstalled(item_pl):
|
||||
return False
|
||||
except munkicommon.Error, errmsg:
|
||||
# some problem with the installs data
|
||||
munkicommon.display_error(str(errmsg))
|
||||
munkicommon.display_error(errmsg)
|
||||
return False
|
||||
|
||||
# if we got this far, we passed all the tests, so the item
|
||||
@@ -2469,8 +2469,8 @@ def getManifestData(manifestpath):
|
||||
if os.path.exists(manifestpath):
|
||||
try:
|
||||
os.unlink(manifestpath)
|
||||
except OSError, e:
|
||||
munkicommon.display_error('Failed to delete plist: %s', str(e))
|
||||
except OSError, err:
|
||||
munkicommon.display_error('Failed to delete plist: %s', err)
|
||||
else:
|
||||
munkicommon.display_error('plist does not exist.')
|
||||
return plist
|
||||
@@ -2481,11 +2481,11 @@ def getManifestValueForKey(manifestpath, keyname):
|
||||
plist = getManifestData(manifestpath)
|
||||
try:
|
||||
return plist.get(keyname, None)
|
||||
except AttributeError, e:
|
||||
except AttributeError, err:
|
||||
munkicommon.display_error(
|
||||
'Failed to get manifest value for key: %s (%s)',
|
||||
manifestpath, keyname)
|
||||
munkicommon.display_error('Manifest is likely corrupt: %s', str(e))
|
||||
munkicommon.display_error('Manifest is likely corrupt: %s', err)
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user