diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2007-02-14 00:27:22 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2007-02-14 00:27:22 +0000 |
commit | f3cb6c68cdf481e1d559ec7304510ffa37d8c4cd (patch) | |
tree | b2d234b786a84b7d14232f1022c413ffff98bb7e /src/lib | |
parent | b43c488c96124ad07d4200860948a943cbf500cb (diff) | |
download | bcfg2-f3cb6c68cdf481e1d559ec7304510ffa37d8c4cd.tar.gz bcfg2-f3cb6c68cdf481e1d559ec7304510ffa37d8c4cd.tar.bz2 bcfg2-f3cb6c68cdf481e1d559ec7304510ffa37d8c4cd.zip |
Improve information for cases like Ticket #398
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2809 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Client/Tools/POSIX.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/Client/Tools/POSIX.py b/src/lib/Client/Tools/POSIX.py index 1d482f162..d7521e34d 100644 --- a/src/lib/Client/Tools/POSIX.py +++ b/src/lib/Client/Tools/POSIX.py @@ -244,19 +244,24 @@ class POSIX(Bcfg2.Client.Tools.Tool): try: os.lstat(parent) except: - self.logger.debug('Creating parent path for config file %s' % (entry.get('name'))) - for idx in xrange(len(parent.split('/')[:-1])): - current = '/'+'/'.join(parent.split('/')[1:2+idx]) + self.logger.debug('Creating parent path for config file %s' % \ + (entry.get('name'))) + current = '/' + for next in parent.split('/')[1:]: + current += next + '/' try: sloc = os.lstat(current) try: if not S_ISDIR(sloc[ST_MODE]): + self.logger.debug('%s is not a directory; recreating' \ + % (current)) os.unlink(current) os.mkdir(current) except OSError: return False except OSError: try: + self.logger.debug("Creating non-existent path %s" % current) os.mkdir(current) except OSError: return False |