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

View File

@@ -122,10 +122,11 @@ class AppleUpdates(object):
self._managed_install_dir = munkicommon.pref('ManagedInstallDir')
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):
munki_common.display_error(
'%s exists but is not a dir.', real_cache_dir)
elif not os.path.exists(real_cache_dir):
if os.path.exists(real_cache_dir):
if not os.path.isdir(real_cache_dir):
munki_common.display_error(
'%s exists but is not a dir.', real_cache_dir)
else:
os.mkdir(real_cache_dir)
# symlink to work around an issue with paths containing spaces