Show
Ignore:
Timestamp:
02/06/08 14:09:34 (4 years ago)
Author:
gperier
Message:

cleverbox :

  • Add Root Group definition to initenv method
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cleverbox/trunk/cleverbox/scripts/admin.py

    r213 r219  
    2727            self.env_set(os.path.abspath(envdir)) 
    2828        self.interactive = False 
    29          
     29 
    3030        # Setup logging 
    3131        screen = logging.StreamHandler(sys.stdout) 
     
    3939 
    4040    def env_set(self, env_path, check_upgrade=True): 
    41          
     41 
    4242        # Load environment 
    4343        self.env = Environment(env_path) 
     
    9494        logging.info("Environment initialisation in %(env_dir)s" % {'env_dir' : self.env.path}) 
    9595 
    96         # Collect local configuration info 
     96        #Collect local configuration info 
    9797        collected_infos = {'general' : {}, 'trac' : {}} 
    9898 
     
    113113        # root user & group 
    114114        # 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 
    116116        collected_infos['general']['ssh_user'] = 'root' 
    117117        collected_infos['general']['ssh_group'] = 'root' 
     
    119119        # Host server domain name 
    120120        collected_infos['general']['domain'] = raw_input('Domain name > ').strip() 
    121          
     121 
    122122        # Authentication backend password (if any) 
    123123        collected_infos['general']['authbackend_pass'] = raw_input('Authentication backend password (if any) []> ').strip() or '' 
     
    126126        dcp = 'default' 
    127127        collected_infos['general']['default_profile'] = raw_input('Default configuration profile [%s]> ' % dcp).strip() or dcp 
    128                  
     128 
    129129        d_lib_dir = '/usr/share/python-support/trac' 
    130130        collected_infos['trac']['lib_dir'] = raw_input('Trac libs directory [%s]> ' % d_lib_dir).strip() or d_lib_dir 
     
    133133        collected_infos['trac']['assets_dir'] = raw_input('Trac assets directory [%s]> ' % d_assets_dir).strip() or d_assets_dir 
    134134 
     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 
    135138        # Environment creation 
    136139        self.env.create(cleverbox.version, collected_infos) 
    137          
     140 
    138141        print 
    139142        print termcolors.colorize('', fg='green', opts=('noreset',)) 
     
    145148    _help_upgrade = [('upgrade', 'Executes necessary operation to make environment up to date')] 
    146149    def do_upgrade(self, line=None): 
    147         self.env.upgrade()             
     150        self.env.upgrade() 
    148151 
    149152    ## help 
     
    214217        Displays enabled and disabled clients. 
    215218        ''' 
    216          
     219 
    217220        all_clients = client.get(self.env) 
    218221        if len(all_clients): 
     
    220223            all_clients.sort() 
    221224            en_clients = client.get(self.env, 'enabled') 
    222             dis_clients = client.get(self.env, 'disabled')  
     225            dis_clients = client.get(self.env, 'disabled') 
    223226            for client_name in all_clients: 
    224227                if client_name in en_clients: 
     
    270273        clients = client.get(self.env) 
    271274        clients.sort() 
    272          
     275 
    273276        for client_name in clients: 
    274              
     277 
    275278            all_projects = project.get(self.env, client_name) 
    276279            if not len(all_projects): continue 
    277              
     280 
    278281            all_projects.sort() 
    279                          
     282 
    280283            print styles.style.H1("\n%s :" % client_name) 
    281              
     284 
    282285            enabled_projects = project.get(self.env, client_name, 'enabled') 
    283286            disabled_projects = project.get(self.env, client_name, 'disabled') 
    284287 
    285              
     288 
    286289            for project_name in all_projects: 
    287290                if project_name in enabled_projects: 
     
    291294 
    292295    def _do_project_disable(self, args): 
    293          
     296 
    294297        # Check syntax 
    295298        if not len(args) == 2: 
    296299            self.do_help('project') 
    297300            raise Exception, 'Invalid syntax' 
    298          
     301 
    299302        # Disable project 
    300303        (client_name, project_name) = args 
     
    306309            self.do_help('project') 
    307310            raise Exception, 'Invalid syntax' 
    308              
     311 
    309312        (client_name, project_name) = args 
    310313        project.enable(self.env, client_name, project_name) 
     
    317320        # Extract parameters from command parameters 
    318321        (client_name, project_name) = args 
    319          
     322 
    320323        # Create input specification 
    321324        input_spec = {'full_name' : ('Full name', 'This variable is not used anywhere !', project_name.capitalize()), 
     
    323326                      'enable'    : ('Enable project ?', 'This will make project available on the web.', 'n'), 
    324327                      'tracadmin' : ('Trac administrator', "This user will be granted full privileges on project's Trac instance", project_name + '-admin')} 
    325          
     328 
    326329        # Collect input 
    327330        collected_input = inputcollector.collect(input_spec) 
    328          
     331 
    329332        # Create project 
    330333        project.add(self.env, client_name, project_name, collected_input)