[Checkins] SVN: zc.recipe.deployment/branches/jspaans-fix-to-match-docs/src/zc/recipe/deployment/__init__.py Make code comply with documentation
Jasper Spaans
jspaans at thehealthagency.com
Tue Dec 23 10:55:06 EST 2008
Log message for revision 94288:
Make code comply with documentation
Changed:
U zc.recipe.deployment/branches/jspaans-fix-to-match-docs/src/zc/recipe/deployment/__init__.py
-=-
Modified: zc.recipe.deployment/branches/jspaans-fix-to-match-docs/src/zc/recipe/deployment/__init__.py
===================================================================
--- zc.recipe.deployment/branches/jspaans-fix-to-match-docs/src/zc/recipe/deployment/__init__.py 2008-12-23 15:54:35 UTC (rev 94287)
+++ zc.recipe.deployment/branches/jspaans-fix-to-match-docs/src/zc/recipe/deployment/__init__.py 2008-12-23 15:55:06 UTC (rev 94288)
@@ -29,14 +29,20 @@
options['name'] = name
name = options['name']
-
+
create = []
- options['run-directory'] = os.path.join(options.get('run', '/var/run'),
+ options['run-directory'] = os.path.join(options.get('run-directory',
+ options.get('run',
+ '/var/run')),
name)
- options['log-directory'] = os.path.join(options.get('log', '/var/log'),
+ options['log-directory'] = os.path.join(options.get('log-directory',
+ options.get('log',
+ '/var/log')),
name)
- options['etc-directory'] = os.path.join(options.get('etc', '/etc'),
+ options['etc-directory'] = os.path.join(options.get('etc-directory',
+ options.get('etc',
+ '/etc')),
name)
options['crontab-directory'] = options.get('crontab-directory',
'/etc/cron.d')
@@ -47,11 +53,11 @@
def install(self):
options = self.options
- user = options['user']
+ user = options.get('user', pwd.getpwuid(os.getuid())[0])
uid, gid = pwd.getpwnam(user)[2:4]
created = []
try:
- make_dir(options['etc-directory'], 0, 0, 0755, created)
+ make_dir(options['etc-directory'], uid, gid, 0755, created)
make_dir(options['log-directory'], uid, gid, 0755, created)
make_dir(options['run-directory'], uid, gid, 0750, created)
except Exception:
@@ -145,4 +151,3 @@
return options['location']
update = install
-
More information about the Checkins
mailing list