def buildKickstart(self): print 'Installing XML Kickstart profiles' build = self.dist.getBuildPath() for rpm in self.dist.getRPMS(): tok = rpm.getBaseName().split('-') if tok[0] != 'roll': continue try: k = tok.index('kickstart') rollname = '-'.join(tok[1:k]) except ValueError: continue print '\tusing %s' % rpm.getBaseName() self.applyRPM(rpm.getBaseName(), build) # Copy local profiles into the distribution. if self.withSiteProfiles: print ' installing "site" profiles...' tree = self.dist.getSiteProfilesTree() for dir in tree.getDirs(): for file in tree.getFiles(dir): path = os.path.join(build, dir) if not os.path.isdir(path): os.makedirs(path) shutil.copy(file.getFullName(), os.path.join(path, file.getName())) # make sure apache can read site XML file.chmod(0664)
def buildKickstart(self): print('Installing XML Kickstart profiles') build = self.dist.getBuildPath() for rpm in self.dist.getRPMS(): tok = rpm.getBaseName().split('-') if tok[0] != 'roll': continue try: k = tok.index('kickstart') rollname = '-'.join(tok[1:k]) except ValueError: continue print('\tinstalling %s' % rpm.getBaseName()) self.applyRPM(rpm.getBaseName(), build) # Copy local profiles into the distribution. if self.withSiteProfiles: print('\tinstalling site-profiles') tree = self.dist.getSiteProfilesTree() for dir in tree.getDirs(): for file in tree.getFiles(dir): path = os.path.join(build, dir) if not os.path.isdir(path): os.makedirs(path) shutil.copy(file.getFullName(), os.path.join(path, file.getName())) # make sure apache can read site XML file.chmod(0o664) # Copy cart profiles into the distribution. for cart in self.carts: print('\tinstalling %s cart' % cart) tree = stack.file.Tree(os.path.join('/export/stack/carts', cart)) for file in tree.getFiles('graph'): shutil.copy(file.getFullName(), os.path.join(build, 'graphs', 'default', file.getName())) for file in tree.getFiles('nodes'): shutil.copy(file.getFullName(), os.path.join(build, 'nodes', file.getName()))