Changeset 177 for cleverbox/trunk
- Timestamp:
- 08/13/07 17:26:50 (5 years ago)
- Location:
- cleverbox/trunk
- Files:
-
- 10 added
- 2 modified
-
cleverbox/environment.py (added)
-
cleverbox/scripts/admin.py (modified) (32 diffs)
-
cleverbox/tests (added)
-
cleverbox/tests/__init__.py (added)
-
cleverbox/tests/client.py (added)
-
cleverbox/tests/environment.py (added)
-
cleverbox/tests/project.py (added)
-
cleverbox/tests/upgrade.py (added)
-
cleverbox/utils (added)
-
cleverbox/utils/__init__.py (added)
-
cleverbox/utils/termcolors.py (added)
-
setup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cleverbox/trunk/cleverbox/scripts/admin.py
r173 r177 1 1 # -*- coding: utf-8 -*- 2 2 3 import shutil 4 import cmd 5 import os 6 import shlex 7 import sys 8 import traceback 9 import re 3 import shutil, cmd, os, shlex, sys, traceback, re, ConfigParser, posix 4 from pkg_resources import parse_version 10 5 from trac import util 11 6 from trac.scripts.admin import TracAdmin 12 import ConfigParser 13 from pkg_resources import parse_version7 from cleverbox.utils import termcolors 8 from cleverbox.environment import Environment 14 9 15 10 _defaults = { … … 22 17 } 23 18 24 _version = '0.5.dev' 19 _version = '0.5dev' 20 21 # Set up the terminal color scheme. 22 class dummy: pass 23 style = dummy() 24 style.ERROR = termcolors.make_style(fg='red', opts=('bold',)) 25 del dummy 26 27 def disable_termcolors(): 28 class dummy: 29 def __getattr__(self, attr): 30 return lambda x: x 31 global style 32 style = dummy() 33 34 # Disable terminal coloring on Windows, Pocket PC, or if somebody's piping the output. 35 if sys.platform == 'win32' or sys.platform == 'Pocket PC' or not sys.stdout.isatty(): 36 disable_termcolors() 25 37 26 38 class CleverboxAdmin(cmd.Cmd): … … 31 43 ruler = '' 32 44 prompt = "Cleverbox > " 33 envname = None34 __env = None35 45 _date_format = '%Y-%m-%d' 36 46 _datetime_format = '%Y-%m-%d %H:%M:%S' … … 49 59 ## 50 60 51 def env_set(self, envname, env=None): 52 self.envname = envname 53 self.prompt = "Cleverbox [%s] > " % self.envname 61 def env_set(self, env_path): 62 63 # Load environment 64 self.env = Environment(env_path) 54 65 55 66 # Check if environment needs an upgrade 56 # - open VERSION57 67 try: 58 env_version = open(os.path.join(self.envname, 'VERSION')).read().strip() 59 60 # - compare with self._version 61 # - if VERSION < self._version : 62 if parse_version(env_version) < parse_version(_version): 68 if self.env.needs_upgrade(_version): 63 69 print "\nCleverbox environment needs to be upgraded. Please run :" 64 print " cleverbox-admin %s upgrade\n" % self.env name70 print " cleverbox-admin %s upgrade\n" % self.env.path 65 71 sys.exit(1) 66 72 except IOError, e: 67 73 # no VERSION file means user wants to create an environment 68 74 pass 75 76 # Set shell prompt 77 self.prompt = "Cleverbox [%s] > " % self.env.path 69 78 70 if env is not None:71 self.__env = env72 73 79 # Read configuration 80 # TODO : move to environment.py ? 74 81 self._config = ConfigParser.SafeConfigParser() 75 self._config.read(os.path.join(self.envname, 'cleverbox.ini')) 76 77 78 def env_check(self): 79 try: 80 pass 81 #self.__env = Environment(self.envname) 82 except: 83 return 0 84 return 1 85 86 def env_open(self): 87 try: 88 if not self.__env: 89 #self.__env = Environment(self.envname) 90 return self.__env 91 except Exception, e: 92 print 'Failed to open environment.', e 93 traceback.print_exc() 94 sys.exit(1) 82 self._config.read(self.env.get_file_path('cleverbox.ini')) 95 83 96 84 def emptyline(self): … … 115 103 self.cmdloop() 116 104 117 #118 # Configuration related methods119 #120 def getConfig(self, directive, section):121 try:122 val = self._config.get(section, directive)123 except ConfigParser.NoOptionError, exception:124 val = ''125 return val126 127 #128 # Commands129 #130 131 105 ## Environment 132 106 _help_initenv = [('initenv', 'Environment initialisation')] 133 107 def do_initenv(self, line=None): 134 print "Environment initialisation in %(env_dir)s" % {'env_dir' : self.env name}108 print "Environment initialisation in %(env_dir)s" % {'env_dir' : self.env.path} 135 109 136 110 # Collect local configuration info 137 collected_infos = { }111 collected_infos = {'general' : {}, 'trac' : {}} 138 112 139 113 # Path to client dir 140 114 default_root = '/var/cleverbox' 141 collected_infos[' clients_root'] = raw_input('Projects directory [%s]> ' % default_root).strip() or default_root115 collected_infos['general']['clients_root'] = raw_input('Projects directory [%s]> ' % default_root).strip() or default_root 142 116 143 117 # Path to cleverbox assets 144 118 default_assets_dir = '/usr/share/cleverbox' 145 collected_infos[' assets_dir'] = raw_input('Cleverbox assets directory [%s]> ' % default_assets_dir).strip() or default_assets_dir119 collected_infos['general']['assets_dir'] = raw_input('Cleverbox assets directory [%s]> ' % default_assets_dir).strip() or default_assets_dir 146 120 147 121 try : 148 os.makedirs(collected_infos[' clients_root'], 0775)122 os.makedirs(collected_infos['general']['clients_root'], 0775) 149 123 except IOError, ioexception : 150 124 print ioexception … … 152 126 153 127 # Apache user & group 154 d_uid = 33155 d_gid = 33156 collected_infos[' apache_user'] = raw_input('Webserver user id [%d]> ' % d_uid).strip() or d_uid157 collected_infos[' apache_group'] = raw_input('Webserver group id [%d]> ' % d_gid).strip() or d_gid128 d_uid = 'www-data' 129 d_gid = 'www-data' 130 collected_infos['general']['apache_user'] = raw_input('Webserver user [%s]> ' % d_uid).strip() or d_uid 131 collected_infos['general']['apache_group'] = raw_input('Webserver group [%s]> ' % d_gid).strip() or d_gid 158 132 159 133 # root user & group 160 134 # we keep the ssh_user notion for backward compatibility. 161 135 # this will have to disappear in a future release 162 collected_infos[' ssh_user'] = 0163 collected_infos[' ssh_group'] = 0136 collected_infos['general']['ssh_user'] = 'root' 137 collected_infos['general']['ssh_group'] = 'root' 164 138 165 139 # Host server domain name 166 collected_infos[' domain'] = raw_input('Domain name > ').strip()140 collected_infos['general']['domain'] = raw_input('Domain name > ').strip() 167 141 168 142 # Authentication backend password (if any) 169 collected_infos[' authbackend_pass'] = raw_input('Authentication backend password (if any) []> ').strip() or ''143 collected_infos['general']['authbackend_pass'] = raw_input('Authentication backend password (if any) []> ').strip() or '' 170 144 171 145 # Default configuration profile 172 146 dcp = 'default' 173 collected_infos[' default_profile'] = raw_input('Default configuration profile [%s]> ' % dcp).strip() or dcp147 collected_infos['general']['default_profile'] = raw_input('Default configuration profile [%s]> ' % dcp).strip() or dcp 174 148 175 # Write ini file176 self._config.add_section('general')177 for directive, value in collected_infos.items() :178 self._config.set('general', directive, str(value))179 180 trac_infos = {}181 149 d_lib_dir = '/usr/share/python-support/trac' 182 trac_infos['lib_dir'] = raw_input('Trac libs directory [%s]> ' % d_lib_dir).strip() or d_lib_dir150 collected_infos['trac']['lib_dir'] = raw_input('Trac libs directory [%s]> ' % d_lib_dir).strip() or d_lib_dir 183 151 184 152 d_assets_dir = '/usr/share/trac' 185 trac_infos['assets_dir'] = raw_input('Trac assets directory [%s]> ' % d_assets_dir).strip() or d_assets_dir 186 187 self._config.add_section('trac') 188 for directive, value in trac_infos.items() : 189 self._config.set('trac', directive, str(value)) 153 collected_infos['trac']['assets_dir'] = raw_input('Trac assets directory [%s]> ' % d_assets_dir).strip() or d_assets_dir 154 155 # Environment creation 156 self.env.create(_version, collected_infos) 190 157 191 fh_config = open(os.path.join(self.envname, 'cleverbox.ini'), 'w+')192 self._config.write(fh_config)193 194 # Create directory structure195 try:196 print "\n\tCreating directory layout\n"197 env_dirs = []198 for dirname in _defaults['env_dir_layout']:199 env_dirs.append( os.path.join(self.envname, dirname) )200 map( os.makedirs, env_dirs )201 except IOError, ioexception :202 print ioexception203 print "** Environment couldn't be initialized in %(env_dir)s\n" % {'env_dir' : self.envname}204 205 # Create VERSION file206 try:207 print "\n\tCreating VERSION file\n"208 fd = open( os.path.join(self.envname, 'VERSION'), 'w' )209 fd.write(_version)210 finally:211 fd.close()212 213 # Default configuration profile214 print "\n\tCreating default configuration profile\n"215 for filename in _defaults['profile_files']:216 shutil.copy(collected_infos['assets_dir'] + '/' + filename, os.path.join(self.envname, 'profiles', 'default'))217 218 219 158 print 220 159 print "Environment successfully initialized\n" 221 160 print "You need to add this statement to your apache configuration : \n" \ 222 "\t'Include %(env_dir)s/clients-enabled/*'\n" % {'env_dir' : self.env name}161 "\t'Include %(env_dir)s/clients-enabled/*'\n" % {'env_dir' : self.env.path} 223 162 224 163 _help_upgrade = [('upgrade', 'Executes necessary operation to make environment up to date')] 225 164 def do_upgrade(self, line=None): 226 env_version = open(os.path.join(self.envname, 'VERSION')).read() 227 if parse_version(env_version) < parse_version(_version): 228 from cleverbox.upgrades import upgrades 229 i = 1 230 while i: 231 try: 232 upgrade_func = getattr(upgrades, 'do_upgrade_' + str(i)) 233 upgrade_func.__call__(self.envname, env_version) 234 except AttributeError, e: 235 break 236 i = i + 1 237 165 self.env.upgrade() 238 166 239 167 ## help … … 334 262 'ftp_password' : None } 335 263 336 collected_infos['home_dir'] = os.path.join(self. getConfig('clients_root', 'general'), client_name)264 collected_infos['home_dir'] = os.path.join(self.env.config.get('general', 'clients_root'), client_name) 337 265 338 266 # A few checks before effectively creating client … … 376 304 """ % { 'client_name' : client_name, 377 305 'home_dir' : collected_infos['home_dir'], 378 'env_dir' : self.env name}306 'env_dir' : self.env.path } 379 307 380 308 # -- Write conf to filesystem 381 apache_conf_filepath = os.path.join( self.env name, 'clients-available', client_name )309 apache_conf_filepath = os.path.join( self.env.path, 'clients-available', client_name ) 382 310 f = file(apache_conf_filepath, 'w+') 383 311 f.write(apache_conf) … … 394 322 chmod g+w /$CLIENTSROOT/$CLIENTNAME/uploads 395 323 """ 396 self._rchown( collected_infos['home_dir'], 397 int(self.getConfig('ssh_user', 'general')), 398 int(self.getConfig('ssh_group', 'general')) ) 399 os.chown( os.path.join(collected_infos['home_dir'], 'logs'), 400 int(self.getConfig('ssh_user', 'general')), int(self.getConfig('apache_group', 'general')) ) 401 os.chmod( os.path.join(collected_infos['home_dir'], 'logs'), 0775 ) 402 os.chown( os.path.join(collected_infos['home_dir'], 'uploads'), 403 int(self.getConfig('ssh_user', 'general')), int(self.getConfig('apache_group', 'general')) ) 404 os.chmod( os.path.join(collected_infos['home_dir'], 'uploads'), 0775 ) 324 self._rchown(collected_infos['home_dir'], 325 self.get_uid_from_name(username)(self.env.config.get('general', 'ssh_user')), 326 self.get_gid_from_name(self.env.config.get('general', 'ssh_group'))) 327 328 os.chown(os.path.join(collected_infos['home_dir'], 'logs'), 329 get_uid_from_name(self.env.config.get('general', 'ssh_user')), 330 get_gid_from_name(self.env.config.get('general', 'apache_group')) ) 331 332 os.chmod(os.path.join(collected_infos['home_dir'], 'logs'), 0775) 333 334 os.chown(os.path.join(collected_infos['home_dir'], 'uploads'), 335 get_uid_from_name(self.env.config.get('general', 'ssh_user')), 336 get_gid_from_name(self.env.config.get('general', 'apache_group'))) 337 338 os.chmod(os.path.join(collected_infos['home_dir'], 'uploads'), 0775) 405 339 406 340 print " Fixed permissions in %s\n" % collected_infos['home_dir'] … … 458 392 459 393 # Disable client 460 client_apacheconf = os.path.join( self.env name, 'clients-available', client_name )394 client_apacheconf = os.path.join( self.env.path, 'clients-available', client_name ) 461 395 os.unlink(client_apacheconf) 462 396 print "Client '%s' has been removed." % client_name … … 476 410 477 411 if enable_client: 478 target = os.path.join( self.env name, 'clients-available', client_name )479 linkname = os.path.join( self.env name, 'clients-enabled', client_name )412 target = os.path.join( self.env.path, 'clients-available', client_name ) 413 linkname = os.path.join( self.env.path, 'clients-enabled', client_name ) 480 414 os.symlink( target, linkname ) 481 415 print "Client '%s' has been enabled" % client_name … … 499 433 500 434 if disable_client: 501 linkname = os.path.join( self.env name, 'clients-enabled', client_name )435 linkname = os.path.join( self.env.path, 'clients-enabled', client_name ) 502 436 os.unlink( linkname ) 503 437 print "Client '%s' has been disabled" % client_name … … 534 468 # Each client 535 469 if not only: 536 list_clients = os.listdir(os.path.join(self.env name, 'clients-available'))470 list_clients = os.listdir(os.path.join(self.env.path, 'clients-available')) 537 471 538 472 # Only enabled clients 539 473 elif only == 'enabled': 540 list_clients = os.listdir(os.path.join(self.env name, 'clients-enabled'))474 list_clients = os.listdir(os.path.join(self.env.path, 'clients-enabled')) 541 475 542 476 # Only disabled clients (ie. not enabled) … … 544 478 545 479 disabled_clients = [] 546 available_clients = os.listdir(os.path.join(self.env name, 'clients-available'))547 enabled_clients = os.listdir(os.path.join(self.env name, 'clients-enabled'))480 available_clients = os.listdir(os.path.join(self.env.path, 'clients-available')) 481 enabled_clients = os.listdir(os.path.join(self.env.path, 'clients-enabled')) 548 482 549 483 # Expect poor performances for this intersection algorithm … … 611 545 all_projects_dir = 'projects-available' 612 546 613 list_enabled_projects = os.listdir(os.path.join(self.env name, enabled_projects_dir))614 list_all_projects = os.listdir(os.path.join(self.env name, all_projects_dir))547 list_enabled_projects = os.listdir(os.path.join(self.env.path, enabled_projects_dir)) 548 list_all_projects = os.listdir(os.path.join(self.env.path, all_projects_dir)) 615 549 616 550 list_projects = [] … … 641 575 if (self._project_exists(client_name, project_name)): 642 576 try: 643 os.unlink( os.path.join(self.env name, 'projects-enabled', '%s-%s' % (client_name, project_name)) )577 os.unlink( os.path.join(self.env.path, 'projects-enabled', '%s-%s' % (client_name, project_name)) ) 644 578 print "Project '%s' has been disabled. Apache needs to be reloaded." % project_name 645 579 except (IOError, os.error), exception: … … 657 591 if self._project_exists(client_name, project_name): 658 592 try: 659 target = os.path.join( self.env name,593 target = os.path.join( self.env.path, 660 594 'projects-available', 661 595 '%s-%s' % (client_name, project_name) ) 662 linkname = os.path.join( self.env name,596 linkname = os.path.join( self.env.path, 663 597 'projects-enabled', 664 598 '%s-%s' % (client_name, project_name) ) … … 697 631 # Delete apache config file 698 632 try: 699 linkname = os.path.join( self.env name, 'projects-available', '%s-%s'% (client_name, project_name) )633 linkname = os.path.join( self.env.path, 'projects-available', '%s-%s'% (client_name, project_name) ) 700 634 os.unlink( linkname ) 701 635 print "Project '%s' has been removed" % project_name … … 739 673 print 740 674 print " What configuration profile should be used ?" 741 print " Those reside in %s/profiles/" % self.env name742 print 743 744 dp = self. getConfig('default_profile', 'general')675 print " Those reside in %s/profiles/" % self.env.path 676 print 677 678 dp = self.env.config.get('general', 'default_profile') 745 679 collected_infos['profile'] = raw_input('Configuration profile [%s]> ' % dp).strip() or dp 746 680 … … 790 724 791 725 def _project_create_dirs(self, infos): 792 os.makedirs(os.path.join(self. getConfig('clients_root', 'general'),726 os.makedirs(os.path.join(self.self.env.config.get('general', 'clients_root'), 793 727 infos['client'], 794 728 'htdocs', … … 801 735 TODO : clients may not be stored in 'clients_root', be careful with that. 802 736 """ 803 conf_template = open(os.path.join(self.env name, 'profiles', infos['profile'], 'project.apache.conf'))737 conf_template = open(os.path.join(self.env.path, 'profiles', infos['profile'], 'project.apache.conf')) 804 738 conf_data = conf_template.read() % {'client_name' : infos['client'], 805 739 'project_name' : infos['short_name'], 806 'clients_root' : self. getConfig('clients_root', 'general'),807 'authbackend_pass' : self. getConfig('authbackend_pass', 'general'),808 'trac_install_dir' : self. getConfig('lib_dir', 'trac'),809 'domain_name' : self. getConfig('domain', 'general')}810 811 apache_conf_filepath = os.path.join( self.env name, 'projects-available', '%s-%s' % (infos['client'], infos['short_name']) )740 'clients_root' : self.env.config.get('general', 'clients_root'), 741 'authbackend_pass' : self.env.config.get('general', 'authbackend_pass'), 742 'trac_install_dir' : self.env.config.get('trac', 'lib_dir'), 743 'domain_name' : self.env.config.get('general', 'domain')} 744 745 apache_conf_filepath = os.path.join( self.env.path, 'projects-available', '%s-%s' % (infos['client'], infos['short_name']) ) 812 746 f = file(apache_conf_filepath, 'w+') 813 747 f.write(conf_data) … … 817 751 818 752 def _project_create_svn_repos(self, infos): 819 repos_path = os.path.join( self. getConfig('clients_root', 'general'), infos['client'], 'var/svn', infos['short_name'] )753 repos_path = os.path.join( self.env.config.get('general', 'clients_root'), infos['client'], 'var/svn', infos['short_name'] ) 820 754 create_cmd = 'svnadmin create %s' % repos_path 821 755 (stdin, stdout, stderr) = os.popen3( create_cmd ) … … 829 763 def _project_trac_initenv(self, infos): 830 764 831 trac_env_path = os.path.join( self. getConfig('clients_root', 'general'),765 trac_env_path = os.path.join( self.env.config.get('general', 'clients_root'), 832 766 infos['client'], 833 767 'var/trac', 834 768 infos['short_name'] ) 835 769 836 svn_path = os.path.join( self. getConfig('clients_root', 'general'),770 svn_path = os.path.join( self.env.config.get('general', 'clients_root'), 837 771 infos['client'], 838 772 'var/svn', … … 843 777 'db_dsn' : 'sqlite:db/trac.db', 844 778 'svn_path' : svn_path, 845 'templates_path' : '%s/templates' % self. getConfig('assets_dir', 'trac'),846 'trac_install_dir' : self. getConfig('lib_dir', 'trac')}779 'templates_path' : '%s/templates' % self.env.config.get('trac', 'assets_dir'), 780 'trac_install_dir' : self.env.config.get('trac', 'lib_dir')} 847 781 848 782 trac_cmd = '/usr/bin/trac-admin %(env_path)s initenv %(title)s %(db_dsn)s svn %(svn_path)s %(templates_path)s' % cmd_data … … 858 792 859 793 def _project_trac_setperms(self, infos): 860 trac_env_path = os.path.join( self. getConfig('clients_root', 'general'),794 trac_env_path = os.path.join( self.env.config.get('general', 'clients_root'), 861 795 infos['client'], 862 796 'var/trac', … … 891 825 # Grant default permissions 892 826 perms_config = ConfigParser.SafeConfigParser() 893 perms_config.read(os.path.join(self.env name, 'profiles', infos['profile'], 'permissions.ini'))827 perms_config.read(os.path.join(self.env.path, 'profiles', infos['profile'], 'permissions.ini')) 894 828 for profile in perms_config.options('trac'): 895 829 os.system( trac_perms_cmd % {'env_path' : trac_env_path, … … 923 857 924 858 # Trac DB 925 trac_db_path = os.path.join( self.getConfig('clients_root', 'general'),859 trac_db_path = os.path.join(self.env.config.get('general', 'clients_root'), 926 860 infos['client'], 927 861 'var/trac', 928 862 infos['short_name'], 929 'db' ) 930 self._rchown( trac_db_path , int(self.getConfig('apache_user', 'general')), int(self.getConfig('ssh_group', 'general')) ) 863 'db') 864 self._rchown(trac_db_path, 865 get_uid_from_name(self.env.config.get('general', 'apache_user')), 866 get_gid_from_name(self.env.config.get('general', 'ssh_group'))) 931 867 932 868 # Trac attachments 933 trac_attachments_path = os.path.join( self. getConfig('clients_root', 'general'),869 trac_attachments_path = os.path.join( self.env.config.get('general', 'clients_root'), 934 870 infos['client'], 935 871 'var/trac', … … 937 873 'attachments' ) 938 874 939 self._rchown( trac_attachments_path , int(self.getConfig('apache_user', 'general')), int(self.getConfig('ssh_group', 'general')) ) 875 self._rchown(trac_attachments_path , 876 get_uid_from_name(self.env.config.get('general', 'apache_user')), 877 get_gid_from_name(self.env.config.get('general', 'ssh_group'))) 940 878 941 879 # Trac conf 942 trac_ini_path = os.path.join( self. getConfig('clients_root', 'general'),880 trac_ini_path = os.path.join( self.env.config.get('general', 'clients_root'), 943 881 infos['client'], 944 882 'var','trac', … … 948 886 949 887 # Subversion repository 950 svn_repos_path = os.path.join( self. getConfig('clients_root', 'general'),888 svn_repos_path = os.path.join( self.env.config.get('general', 'clients_root'), 951 889 infos['client'], 952 890 'var/svn', 953 891 infos['short_name'] ) 954 892 955 self._rchown( svn_repos_path, int(self.getConfig('apache_user', 'general')), int(self.getConfig('ssh_group', 'general')) ) 893 self._rchown(svn_repos_path, 894 get_uid_from_name(self.env.config.get('general', 'apache_user')), 895 get_gid_from_name(self.env.config.get('general', 'ssh_group'))) 896 956 897 os.chmod( svn_repos_path, 0775 ) 957 898 … … 965 906 # New defaults 966 907 tracdefaults_config = ConfigParser.SafeConfigParser() 967 tracdefaults_config.read(os.path.join(self.env name, 'profiles', infos['profile'], 'trac-defaults.ini'))908 tracdefaults_config.read(os.path.join(self.env.path, 'profiles', infos['profile'], 'trac-defaults.ini')) 968 909 969 910 # Trac base config file 970 project_config_path = os.path.join(self. getConfig('clients_root', 'general', infos['client'], 'var', 'trac', infos['short_name'], 'conf', 'trac.ini'))911 project_config_path = os.path.join(self.env.config.get('general', 'clients_root', infos['client'], 'var', 'trac', infos['short_name'], 'conf', 'trac.ini')) 971 912 tracproject_config = ConfigParser.SafeConfigParser() 972 913 tracproject_config.read(project_config_path) … … 981 922 default_option = tracdefaults_config.get(section, option) % {'client_name' : infos['client'], 982 923 'project_name' : infos['short_name'], 983 'clients_root' : self. getConfig('clients_root', 'general'),984 'authbackend_pass' : self. getConfig('authbackend_pass', 'general'),985 'trac_install_dir' : self. getConfig('lib_dir', 'trac'),986 'domain_name' : self. getConfig('domain', 'general')}924 'clients_root' : self.env.config.get('general', 'clients_root'), 925 'authbackend_pass' : self.env.config.get('general', 'authbackend_pass'), 926 'trac_install_dir' : self.env.config.get('trac', 'lib_dir'), 927 'domain_name' : self.env.config.get('general', 'domain')} 987 928 tracproject_config.set(section, option, default_option) 988 929 … … 1095 1036 argstr = util.to_utf8(argstr, sys.stdin.encoding) 1096 1037 return shlex.split(argstr) or [''] 1038 1039 def get_uid_from_name(self, username): 1040 return posix.pwd.getpwnam(username)['pw_uid'] 1041 1042 def get_gid_from_name(self, groupname): 1043 return posix.grp.getgrnam(groupname)['gr_gid'] 1097 1044 1098 1045 def run(args): -
cleverbox/trunk/setup.py
r176 r177 34 34 # Project identity 35 35 name='Cleverbox', 36 version='0.5 .dev',36 version='0.5dev', 37 37 description='Script for automating multiple trac instances deployment and maintenance.', 38 38 author='Tristan Rivoallan',
