summaryrefslogtreecommitdiffstats
path: root/pykolab/utils.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-07-11 15:45:45 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-07-11 15:45:45 +0100
commit6201e52c7701891b2f3a1ba91d51d338ef74cec4 (patch)
treefddf1cc5d5be0c09fc570ae957c89ad995ce5db7 /pykolab/utils.py
parent2ab8963285e34959005fbbc26a218443ed60c1a1 (diff)
downloadpykolab-6201e52c7701891b2f3a1ba91d51d338ef74cec4.tar.gz
Import modules used,
Avoid using log (not available), Avoid printing out information when it's irrelevant
Diffstat (limited to 'pykolab/utils.py')
-rw-r--r--pykolab/utils.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/pykolab/utils.py b/pykolab/utils.py
index 33fc3ca..3fb7e34 100644
--- a/pykolab/utils.py
+++ b/pykolab/utils.py
@@ -18,7 +18,9 @@
#
import getpass
+import grp
import os
+import pwd
import sys
from pykolab import constants
@@ -154,13 +156,6 @@ def ensure_directory(_dir, _user='root', _group='root'):
# Set real and effective group if not the same as current.
if not group_gid == rgid:
- log.debug(
- _("Switching real and effective group id to %d") % (
- group_gid
- ),
- level=8
- )
-
os.chown(_dir, -1, group_gid)
if ruid == 0:
@@ -184,11 +179,6 @@ def ensure_directory(_dir, _user='root', _group='root'):
# Set real and effective user if not the same as current.
if not user_uid == ruid:
- print >> sys.stderr, \
- _("Switching real and effective user id to %d") % (
- user_uid
- )
-
os.chown(_dir, user_uid, -1)
except: