aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2002-05-31 03:34:28 +0000
committerFrederic Lepied <flepied@mandriva.com>2002-05-31 03:34:28 +0000
commit5acda20fb9deb8bef0476186b970cde5e213abd0 (patch)
tree4d5cd132b38898c3f8c82798874a710e612be46a /share
parent33757af4e91c5558b71e6e6a4a99689fb57da06e (diff)
downloadmsec-5acda20fb9deb8bef0476186b970cde5e213abd0.tar
msec-5acda20fb9deb8bef0476186b970cde5e213abd0.tar.gz
msec-5acda20fb9deb8bef0476186b970cde5e213abd0.tar.bz2
msec-5acda20fb9deb8bef0476186b970cde5e213abd0.tar.xz
msec-5acda20fb9deb8bef0476186b970cde5e213abd0.zip
report more complete error messages.
Diffstat (limited to 'share')
-rw-r--r--share/ConfigFile.py12
-rwxr-xr-xshare/Perms.py8
2 files changed, 10 insertions, 10 deletions
diff --git a/share/ConfigFile.py b/share/ConfigFile.py
index 98b32a6..40ee8f6 100644
--- a/share/ConfigFile.py
+++ b/share/ConfigFile.py
@@ -62,7 +62,7 @@ def move(old, new):
try:
os.rename(old, new)
except:
- error('rename %s %s: %s' % (old, new, sys.exc_value[0]))
+ error('rename %s %s: %s' % (old, new, str(sys.exc_value)))
class ConfigFile:
def __init__(self, path, suffix=None, meta=all_files):
@@ -137,7 +137,7 @@ class ConfigFile:
try:
os.unlink(self.path)
except:
- error('unlink %s: %s' % (self.path, sys.exc_value[0]))
+ error('unlink %s: %s' % (self.path, str(sys.exc_value)))
log(_('deleted %s') % (self.path,))
elif self.is_modified:
content = string.join(self.lines, "\n")
@@ -150,13 +150,13 @@ class ConfigFile:
try:
os.utime(self.path, None)
except:
- error('utime %s: %s' % (self.path, sys.exc_value[0]))
+ error('utime %s: %s' % (self.path, str(sys.exc_value)))
elif self.suffix and os.path.exists(self.path + self.suffix):
move(self.path + self.suffix, self.path)
try:
os.utime(self.path, None)
except:
- error('utime %s: %s' % (self.path, sys.exc_value[0]))
+ error('utime %s: %s' % (self.path, str(sys.exc_value)))
else:
self.lines = []
self.is_modified = 1
@@ -175,13 +175,13 @@ class ConfigFile:
try:
os.unlink(self.path)
except:
- error('unlink %s: %s' % (self.path, sys.exc_value[0]))
+ error('unlink %s: %s' % (self.path, str(sys.exc_value)))
log(_('deleted %s') % (self.path,))
if not done:
try:
os.symlink(self.sym_link, self.path)
except:
- error('symlink %s %s: %s' % (self.sym_link, self.path, sys.exc_value[0]))
+ error('symlink %s %s: %s' % (self.sym_link, self.path, str(sys.exc_value)))
log(_('made symbolic link from %s to %s') % (self.sym_link, self.path))
if self.is_moved:
diff --git a/share/Perms.py b/share/Perms.py
index 7069831..2f7216d 100755
--- a/share/Perms.py
+++ b/share/Perms.py
@@ -145,19 +145,19 @@ def act():
try:
os.chmod(f, newperm)
except:
- error('chmod %s %o: %s' % (f, newperm, sys.exc_value[0]))
+ error('chmod %s %o: %s' % (f, newperm, str(sys.exc_value)))
if user != -1 and user != uid:
log(_('changed owner of %s from %s to %s') % (f, get_user_name(uid), user_str))
try:
os.chown(f, user, -1)
except:
- error('chown %s %s: %s' % (f, user, sys.exc_value[0]))
+ error('chown %s %s: %s' % (f, user, str(sys.exc_value)))
if group != -1 and group != gid:
log(_('changed group of %s from %s to %s') % (f, get_group_name(gid), group_str))
try:
os.chown(f, -1, group)
except:
- error('chgrp %s %s: %s' % (f, group, sys.exc_value[0]))
+ error('chgrp %s %s: %s' % (f, group, str(sys.exc_value)))
def chmod(f, newperm):
try:
@@ -177,7 +177,7 @@ def chmod(f, newperm):
try:
os.chmod(f, newperm)
except:
- error('chmod %s %o: %s' % (f, newperm, sys.exc_value[0]))
+ error('chmod %s %o: %s' % (f, newperm, str(sys.exc_value)))
return 1
if __name__ == '__main__':