Logo Search packages:      
Sourcecode: bcfg2 version File versions  Download package

def lib::Client::Frame::Frame::Decide (   self  ) 

Set self.whitelist based on user interaction

Definition at line 82 of file Frame.py.

00082                     :
        '''Set self.whitelist based on user interaction'''
        prompt = "Would you like to install %s: %s? (y/N): "
        rprompt = "Would you like to remove %s: %s? (y/N): "
        if self.setup['dryrun']:
            self.logger.info("In dryrun mode: suppressing entry installation for:")
            self.logger.info(["%s:%s" % (entry.tag, entry.get('name')) for entry \
                              in self.states if not self.states[entry]])
            return
        elif self.setup['interactive']:
            self.whitelist = promptFilter(prompt, [entry for entry in self.states \
                                                   if not self.states[entry]])
            self.removal = promptFilter(rprompt, self.extra)
        elif self.setup['bundle']:
            # only install entries in specified bundle
            mbs = [bund for bund in self.config.findall('./Bundle') \
                   if bund.get('name') == self.setup['bundle']]
            if not mbs:
                self.logger.error("Could not find bundle %s" % (self.setup['bundle']))
                return
            self.whitelist = [entry for entry in self.states if not self.states[entry] \
                              and entry in mbs[0].getchildren()]
        else:
            # all systems are go
            self.whitelist = [entry for entry in self.states if not self.states[entry]]
            if self.setup['remove']:
                if self.setup['remove'] == 'all':
                    self.removal = self.extra
                elif self.setup['remove'] == 'services':
                    self.removal = [entry for entry in self.extra if entry.tag == 'Service']
                elif self.setup['remove'] == 'packages':
                    self.removal = [entry for entry in self.extra if entry.tag == 'Package']

    def DispatchInstallCalls(self, entries):


Generated by  Doxygen 1.6.0   Back to index