From 00794268a2c9acdea4b814fe8c8a2b7e9d870f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D0=BC=D0=BE=D1=83=D0=BA=D0=B8=D0=BD=20=D0=90?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Wed, 2 Jun 2010 11:56:44 +0400 Subject: [PATCH] Added isMount() method --- pym/cl_utils.py | 8 ++++++++ pym/encrypt.py | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pym/cl_utils.py b/pym/cl_utils.py index f1c094e..322e068 100644 --- a/pym/cl_utils.py +++ b/pym/cl_utils.py @@ -391,3 +391,11 @@ def removeDir(rmDir): """Рекурсивное удаление директории""" rmtree(rmDir) return True + +def isMount(path): + """В случае монтирования директории выдает другой примонтированный путь""" + absPath = os.path.abspath(path) + return filter(lambda x: x!=absPath, + reduce(lambda x,y: y, filter(lambda x: absPath in x, + map(lambda x: [x[0], x[1]], map(lambda x: x.split(" "), + open("/etc/mtab")))),[""]))[0] diff --git a/pym/encrypt.py b/pym/encrypt.py index 464763a..23ad60b 100644 --- a/pym/encrypt.py +++ b/pym/encrypt.py @@ -174,13 +174,13 @@ nsCertType = %s if os.path.exists(keyFile): os.chown(keyFile, uid,gid) os.chmod(keyFile, keyFileMode) - if textLine == False: + if textLine is False: self.printERROR(_("Can not create certificate %s")%certFile) return False # Проверка сертификата textLine = execProg("%s x509 -subject -fingerprint -noout -in %s"\ %(sslFile, certFile)) - if textLine == False: + if textLine is False: self.printERROR(_("Can not create certificate %s")%certFile) return False return True