def install(self): """ Method used to install, link, update puppet client. """ c = Common() c.banner() c.client_hosts() hostname = Hostname() hostname.check() l = Logger(c.client_name()) reader = open(self.logfile) startline = len(reader.readlines()) l.event_counter(startline) try: operatingSystem = run("/bin/cat /etc/issue | /usr/bin/awk '{print $1}'") if(operatingSystem=='Debian'): run('aptitude -y update && aptitude -y install puppet') else: print '--->\tOS not supported' sys.exit(0) puppetthread = AddCert() puppetthread.start() puppetthread.join() except Exception, e: print 'error :', e
def update_host(self): """ Method used to apply/noop updates on a specific host. """ c = Common() l = Logger(c.client_name()) try: if self.__noop!='apply': self.noop_puppet() else: updatePuppet = AddCert() updatePuppet.start() updatePuppet.join() print '\n' + '-'*60 + '\n' return 0 except Exception, e: print 'error :', e