Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import os, glob, shutil, sys, pwd, grp
import os, glob, shutil, sys
from setuptools import setup
from distutils.core import setup, Command


try:
import pwd, grp
except ImportError:
# e.g. under windows
pwd = grp = None


def read(fname):
"""Read file contents."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
Expand Down Expand Up @@ -97,10 +104,10 @@ def run(self):
shutil.copy(template, drqueue_etc)

# set to user-supplied user / group
if self.owner != None:
if self.owner != None and pwd is not None:
uid = pwd.getpwnam(self.owner)[2]
recursive_chown(drqueue_root, uid, -1)
if self.group != None:
if self.group != None and grp is not None:
gid = grp.getgrnam(self.group)[2]
recursive_chown(drqueue_root, -1, gid)

Expand Down