From e22995c5c49e39ea989a2d0109aa9a030388fab3 Mon Sep 17 00:00:00 2001 From: ogle Date: Wed, 7 Nov 2012 17:23:24 +0000 Subject: [PATCH] Remove duplicate os.path.exists() calls when checking for real_cache_dir existence. --- code/client/munkilib/appleupdates.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/client/munkilib/appleupdates.py b/code/client/munkilib/appleupdates.py index dfd0ae58..edade9eb 100644 --- a/code/client/munkilib/appleupdates.py +++ b/code/client/munkilib/appleupdates.py @@ -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