Changeset 219 for cleverbox/trunk/cleverbox/scripts/admin.py
- Timestamp:
- 02/06/08 14:09:34 (4 years ago)
- Files:
-
- 1 modified
-
cleverbox/trunk/cleverbox/scripts/admin.py (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cleverbox/trunk/cleverbox/scripts/admin.py
r213 r219 27 27 self.env_set(os.path.abspath(envdir)) 28 28 self.interactive = False 29 29 30 30 # Setup logging 31 31 screen = logging.StreamHandler(sys.stdout) … … 39 39 40 40 def env_set(self, env_path, check_upgrade=True): 41 41 42 42 # Load environment 43 43 self.env = Environment(env_path) … … 94 94 logging.info("Environment initialisation in %(env_dir)s" % {'env_dir' : self.env.path}) 95 95 96 # Collect local configuration info96 #Collect local configuration info 97 97 collected_infos = {'general' : {}, 'trac' : {}} 98 98 … … 113 113 # root user & group 114 114 # we keep the ssh_user notion for backward compatibility. 115 # this will have to disappear in a future release 115 # this will have to disappear in a future release 116 116 collected_infos['general']['ssh_user'] = 'root' 117 117 collected_infos['general']['ssh_group'] = 'root' … … 119 119 # Host server domain name 120 120 collected_infos['general']['domain'] = raw_input('Domain name > ').strip() 121 121 122 122 # Authentication backend password (if any) 123 123 collected_infos['general']['authbackend_pass'] = raw_input('Authentication backend password (if any) []> ').strip() or '' … … 126 126 dcp = 'default' 127 127 collected_infos['general']['default_profile'] = raw_input('Default configuration profile [%s]> ' % dcp).strip() or dcp 128 128 129 129 d_lib_dir = '/usr/share/python-support/trac' 130 130 collected_infos['trac']['lib_dir'] = raw_input('Trac libs directory [%s]> ' % d_lib_dir).strip() or d_lib_dir … … 133 133 collected_infos['trac']['assets_dir'] = raw_input('Trac assets directory [%s]> ' % d_assets_dir).strip() or d_assets_dir 134 134 135 d_root_gid = 'www-data' 136 collected_infos['general']['root_group'] = raw_input('Root group [%s]> ' % d_root_gid).strip() or d_root_gid 137 135 138 # Environment creation 136 139 self.env.create(cleverbox.version, collected_infos) 137 140 138 141 print 139 142 print termcolors.colorize('', fg='green', opts=('noreset',)) … … 145 148 _help_upgrade = [('upgrade', 'Executes necessary operation to make environment up to date')] 146 149 def do_upgrade(self, line=None): 147 self.env.upgrade() 150 self.env.upgrade() 148 151 149 152 ## help … … 214 217 Displays enabled and disabled clients. 215 218 ''' 216 219 217 220 all_clients = client.get(self.env) 218 221 if len(all_clients): … … 220 223 all_clients.sort() 221 224 en_clients = client.get(self.env, 'enabled') 222 dis_clients = client.get(self.env, 'disabled') 225 dis_clients = client.get(self.env, 'disabled') 223 226 for client_name in all_clients: 224 227 if client_name in en_clients: … … 270 273 clients = client.get(self.env) 271 274 clients.sort() 272 275 273 276 for client_name in clients: 274 277 275 278 all_projects = project.get(self.env, client_name) 276 279 if not len(all_projects): continue 277 280 278 281 all_projects.sort() 279 282 280 283 print styles.style.H1("\n%s :" % client_name) 281 284 282 285 enabled_projects = project.get(self.env, client_name, 'enabled') 283 286 disabled_projects = project.get(self.env, client_name, 'disabled') 284 287 285 288 286 289 for project_name in all_projects: 287 290 if project_name in enabled_projects: … … 291 294 292 295 def _do_project_disable(self, args): 293 296 294 297 # Check syntax 295 298 if not len(args) == 2: 296 299 self.do_help('project') 297 300 raise Exception, 'Invalid syntax' 298 301 299 302 # Disable project 300 303 (client_name, project_name) = args … … 306 309 self.do_help('project') 307 310 raise Exception, 'Invalid syntax' 308 311 309 312 (client_name, project_name) = args 310 313 project.enable(self.env, client_name, project_name) … … 317 320 # Extract parameters from command parameters 318 321 (client_name, project_name) = args 319 322 320 323 # Create input specification 321 324 input_spec = {'full_name' : ('Full name', 'This variable is not used anywhere !', project_name.capitalize()), … … 323 326 'enable' : ('Enable project ?', 'This will make project available on the web.', 'n'), 324 327 'tracadmin' : ('Trac administrator', "This user will be granted full privileges on project's Trac instance", project_name + '-admin')} 325 328 326 329 # Collect input 327 330 collected_input = inputcollector.collect(input_spec) 328 331 329 332 # Create project 330 333 project.add(self.env, client_name, project_name, collected_input)
