summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Toolset.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2005-12-09 03:06:18 +0000
committerNarayan Desai <desai@mcs.anl.gov>2005-12-09 03:06:18 +0000
commit6bb9fc6357377882076bfcb135a6d56c47f60bb2 (patch)
tree7d9dc30d7dff335a2ef2fe438d9eeb35fa556c5c /src/lib/Client/Toolset.py
parentfde7e7c7d8a3f98ab9b7025a87dd60c22b194ea0 (diff)
downloadbcfg2-6bb9fc6357377882076bfcb135a6d56c47f60bb2.tar.gz
bcfg2-6bb9fc6357377882076bfcb135a6d56c47f60bb2.tar.bz2
bcfg2-6bb9fc6357377882076bfcb135a6d56c47f60bb2.zip
begin client hardening
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1617 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Toolset.py')
-rw-r--r--src/lib/Client/Toolset.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/Client/Toolset.py b/src/lib/Client/Toolset.py
index dd1c17be4..32deea99b 100644
--- a/src/lib/Client/Toolset.py
+++ b/src/lib/Client/Toolset.py
@@ -366,7 +366,10 @@ class Toolset(object):
except OSError:
return False
except OSError:
- mkdir(current)
+ try:
+ mkdir(current)
+ except OSError:
+ return False
# If we get here, then the parent directory should exist
try:
@@ -386,8 +389,11 @@ class Toolset(object):
system("cp %s /var/cache/bcfg2/%s" % (entry.get('name')))
rename(newfile.name, entry.get('name'))
return True
- except (OSError, IOError), errmsg:
- print errmsg
+ except (OSError, IOError), err:
+ if err.errno == 13:
+ self.CondPrint('verbose', "Failed to open %s for writing" % (entry.get('name')))
+ else:
+ print err
return False
def VerifyPackage(self, entry, modlist):