From 377cd3ddc2085e326fef895a28eed842c9346e25 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Fri, 31 Jul 2009 14:24:39 +0000 Subject: [PATCH] Fix for http://code.google.com/p/munki/issues/detail?id=2, "UnboundLocalError: local variable 'manifest' referenced before assignment" git-svn-id: http://munki.googlecode.com/svn/trunk@145 a4e17f2e-e282-11dd-95e1-755cbddbdd66 --- code/client/munkilib/updatecheck.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/code/client/munkilib/updatecheck.py b/code/client/munkilib/updatecheck.py index c84d8d15..853a6808 100644 --- a/code/client/munkilib/updatecheck.py +++ b/code/client/munkilib/updatecheck.py @@ -1357,6 +1357,7 @@ def getPrimaryManifest(alternate_id): Gets the client manifest from the server """ global errors + manifest = "" managedinstallprefs = munkicommon.prefs() manifesturl = managedinstallprefs['ManifestURL'] clientidentifier = managedinstallprefs.get('ClientIdentifier','') @@ -1545,7 +1546,7 @@ def getHTTPfileIfNewerAtomically(url,destinationpath, message=None): Replaces pre-existing file only on success. (thus 'Atomically') """ err = None - mytemppath = os.path.join(mytmpdir,"TempDownload") + mytemppath = os.path.join(munkicommon.tmpdir,"TempDownload") if os.path.exists(destinationpath): modtime = os.stat(destinationpath).st_mtime else: @@ -1583,7 +1584,6 @@ def getMachineFacts(): # some globals -mytmpdir = '' machine = {} def check(id=''): @@ -1591,8 +1591,6 @@ def check(id=''): if needed. Returns 1 if there are available updates, 0 if there are no available updates, and -1 if there were errors.''' - global mytmpdir - mytmpdir = tempfile.mkdtemp() getMachineFacts() ManagedInstallDir = munkicommon.ManagedInstallDir() @@ -1671,12 +1669,6 @@ def check(id=''): except: installinfo = {} - try: - # clean up our tmp dir - os.rmdir(mytmpdir) - except: - # not fatal if it fails - pass installcount = getInstallCount(installinfo) removalcount = getRemovalCount(installinfo)