try if super is installed

This commit is contained in:
age 2006-08-23 16:44:14 +00:00
parent 84028f4a92
commit 4f053af83a

View file

@ -139,14 +139,17 @@ class CryptoBox:
except IOError: except IOError:
self.log.error("Could not open %s for writing!" % os.devnull) self.log.error("Could not open %s for writing!" % os.devnull)
sys.exit(1) sys.exit(1)
proc = subprocess.Popen( try:
shell = False, proc = subprocess.Popen(
stdout = devnull, shell = False,
stderr = devnull, stdout = devnull,
args = [ stderr = devnull,
self.cbxPrefs["Programs"]["super"], args = [ self.cbxPrefs["Programs"]["super"],
self.cbxPrefs["Programs"]["CryptoBoxRootActions"], self.cbxPrefs["Programs"]["CryptoBoxRootActions"],
"check"]) "check"])
except OSError:
self.log.error("could not find: %s" % self.cbxPrefs["Programs"]["super"])
sys.exit(1)
proc.wait() proc.wait()
if proc.returncode != 0: if proc.returncode != 0:
self.log.error("Could not call CryptoBoxRootActions by 'super' - maybe you did not add the appropriate line to /etc/super.tab?") self.log.error("Could not call CryptoBoxRootActions by 'super' - maybe you did not add the appropriate line to /etc/super.tab?")