Remove duplicate os.path.exists() calls when checking for real_cache_dir existence.

This commit is contained in:
ogle
2012-11-07 17:23:24 +00:00
parent 5ae3ad5f1a
commit e22995c5c4
+5 -4
View File
@@ -122,10 +122,11 @@ class AppleUpdates(object):
self._managed_install_dir = munkicommon.pref('ManagedInstallDir') self._managed_install_dir = munkicommon.pref('ManagedInstallDir')
real_cache_dir = os.path.join(self._managed_install_dir, 'swupd') real_cache_dir = os.path.join(self._managed_install_dir, 'swupd')
if os.path.exists(real_cache_dir) and not os.path.isdir(real_cache_dir): if os.path.exists(real_cache_dir):
munki_common.display_error( if not os.path.isdir(real_cache_dir):
'%s exists but is not a dir.', real_cache_dir) munki_common.display_error(
elif not os.path.exists(real_cache_dir): '%s exists but is not a dir.', real_cache_dir)
else:
os.mkdir(real_cache_dir) os.mkdir(real_cache_dir)
# symlink to work around an issue with paths containing spaces # symlink to work around an issue with paths containing spaces