rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
for imapflag in imapflaglist: if flagmap.has_key(imapflag): retval.append(flagmap[imapflag]) | for imapflag, maildirflag in flagmap: if imapflag.lower() in imapflaglist: retval.append(maildirflag) | def flagsimap2maildir(flagstring): flagmap = {'\\seen': 'S', '\\answered': 'R', '\\flagged': 'F', '\\deleted': 'T', '\\draft': 'D'} retval = [] imapflaglist = [x.lower() for x in flagstring[1:-1].split()] for imapflag in imapflaglist: if flagmap.has_key(imapflag): retval.append(flagmap[imapflag]) retval.sort() return r... | b8aaf4cf43b5bf28054852d5b8a52707fda24895 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5335/b8aaf4cf43b5bf28054852d5b8a52707fda24895/imaputil.py |
def flagsmaildir2imap(list): flagmap = {'S': '\\Seen', 'R': '\\Answered', 'F': '\\Flagged', 'T': '\\Deleted', 'D': '\\Draft'} retval = [] for mdflag in list: if flagmap.has_key(mdflag): retval.append(flagmap[mdflag]) | def flagsmaildir2imap(maildirflaglist): retval = [] for imapflag, maildirflag in flagmap: if maildirflag in maildirflaglist: retval.append(imapflag) | def flagsmaildir2imap(list): flagmap = {'S': '\\Seen', 'R': '\\Answered', 'F': '\\Flagged', 'T': '\\Deleted', 'D': '\\Draft'} retval = [] for mdflag in list: if flagmap.has_key(mdflag): retval.append(flagmap[mdflag]) retval.sort() return '(' + ' '.join(retval) + ')' | b8aaf4cf43b5bf28054852d5b8a52707fda24895 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5335/b8aaf4cf43b5bf28054852d5b8a52707fda24895/imaputil.py |
import profile | try: import cProfile as profile except ImportError: import profile | def run(self): global exitthreads, profiledir self.threadid = thread.get_ident() try: if not profiledir: # normal case Thread.run(self) else: import profile prof = profile.Profile() try: prof = prof.runctx("Thread.run(self)", globals(), locals()) except SystemExit: pass prof.dump_stats( \ profiledir + "/" + st... | 1b32d374b5033243c154a471893557c60c50d9c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5335/1b32d374b5033243c154a471893557c60c50d9c2/threadutil.py |
repo = setup['repo'] | self.datastore = setup['repo'] | def __call__(self, args): Bcfg2.Server.Admin.MetadataCore.__call__(self, args) # Get Bcfg2 repo directory opts = {'repo': Bcfg2.Options.SERVER_REPOSITORY} setup = Bcfg2.Options.OptionParser(opts) setup.parse(sys.argv[1:]) repo = setup['repo'] | 1d8a9780d38b095ac2e67e3aeb5e436c756b719a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/1d8a9780d38b095ac2e67e3aeb5e436c756b719a/Backup.py |
out = tarfile.open(filename, mode=mode) content = os.listdir(os.getcwd()) | out = tarfile.open(self.datastore + '/' + filename, mode=mode) content = os.listdir(self.datastore) | def __call__(self, args): Bcfg2.Server.Admin.MetadataCore.__call__(self, args) # Get Bcfg2 repo directory opts = {'repo': Bcfg2.Options.SERVER_REPOSITORY} setup = Bcfg2.Options.OptionParser(opts) setup.parse(sys.argv[1:]) repo = setup['repo'] | 1d8a9780d38b095ac2e67e3aeb5e436c756b719a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/1d8a9780d38b095ac2e67e3aeb5e436c756b719a/Backup.py |
print "Archive %s was stored.\nLocation: %s" % (filename, datastore) | print "Archive %s was stored.\nLocation: %s" % (filename, self.datastore) | def __call__(self, args): Bcfg2.Server.Admin.MetadataCore.__call__(self, args) # Get Bcfg2 repo directory opts = {'repo': Bcfg2.Options.SERVER_REPOSITORY} setup = Bcfg2.Options.OptionParser(opts) setup.parse(sys.argv[1:]) repo = setup['repo'] | 1d8a9780d38b095ac2e67e3aeb5e436c756b719a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/1d8a9780d38b095ac2e67e3aeb5e436c756b719a/Backup.py |
data = raw_input("What is the server's hostname: [%s]" % socket.getfqdn()) | data = raw_input("What is the server's hostname: [%s]: " % socket.getfqdn()) | def _prompt_hostname(self): """Ask for the server hostname.""" data = raw_input("What is the server's hostname: [%s]" % socket.getfqdn()) if data != '': self.shostname = data else: self.shostname = socket.getfqdn() | 1e7074270141f16d0a22d18deb06ac25507c1276 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/1e7074270141f16d0a22d18deb06ac25507c1276/Init.py |
os.makedirs(path) self._init_plugins() print "Repository created successfuly in %s" % (self.repopath) | try: os.makedirs(path) self._init_plugins() print "Repository created successfuly in %s" % (self.repopath) except OSError: print("Failed to create %s." % path) | def init_repo(self): """Setup a new repo and create the content of the configuration file.""" keypath = os.path.dirname(os.path.abspath(self.configfile)) confdata = config % ( self.repopath, ','.join(self.opts['plugins']), self.opts['sendmail'], self.opts['proto'], self.password, keypath, 'bcfg2.crt', keypath, 'bcfg2.k... | 1e7074270141f16d0a22d18deb06ac25507c1276 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/1e7074270141f16d0a22d18deb06ac25507c1276/Init.py |
data = raw_input("What is the server's hostname: [%s]: " % socket.getfqdn()) | data = raw_input("What is the server's hostname [%s]: " % socket.getfqdn()) | def _prompt_hostname(self): """Ask for the server hostname.""" data = raw_input("What is the server's hostname: [%s]: " % socket.getfqdn()) if data != '': self.shostname = data else: self.shostname = socket.getfqdn() | 891ece863b97d854dda859accc8ce3dbe45fac0b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/891ece863b97d854dda859accc8ce3dbe45fac0b/Init.py |
if resolved == client: | if resolved.lower() == client.lower(): | def validate_client_address(self, client, addresspair): '''Check address against client''' address = addresspair[0] if client in self.floating: self.debug_log("Client %s is floating" % client) return True if address in self.addresses: if client in self.addresses[address]: self.debug_log("Client %s matches address %s" %... | 6c151b83eb58d2ebba9542e3c465f94143ccf504 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/6c151b83eb58d2ebba9542e3c465f94143ccf504/Metadata.py |
try: os.stat('/etc/init.d/%s' % entry.get('name')) except OSError: self.logger.debug("Init script for service %s does not exist" % entry.get('name')) return False | def VerifyService(self, entry, _): ''' Verify Service status for entry. Assumes we run in the "default" runlevel. ''' # check if init script exists try: os.stat('/etc/init.d/%s' % entry.get('name')) except OSError: self.logger.debug("Init script for service %s does not exist" % entry.get('name')) return False # check ... | 9eebc33df4cd5034d99f611b333949a2a1b7f04d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/9eebc33df4cd5034d99f611b333949a2a1b7f04d/RcUpdate.py | |
cmd = '/etc/init.d/%s status | grep started' | cmd = '/sbin/rc-update show default | grep %s' | def VerifyService(self, entry, _): ''' Verify Service status for entry. Assumes we run in the "default" runlevel. ''' # check if init script exists try: os.stat('/etc/init.d/%s' % entry.get('name')) except OSError: self.logger.debug("Init script for service %s does not exist" % entry.get('name')) return False # check ... | 9eebc33df4cd5034d99f611b333949a2a1b7f04d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/9eebc33df4cd5034d99f611b333949a2a1b7f04d/RcUpdate.py |
cmd = '/bin/rc-status -s | grep %s | grep started' | cmd = '/etc/init.d/%s status | grep started' | def VerifyService(self, entry, _): ''' Verify Service status for entry. Assumes we run in the "default" runlevel. ''' # check if init script exists try: os.stat('/etc/init.d/%s' % entry.get('name')) except OSError: self.logger.debug("Init script for service %s does not exist" % entry.get('name')) return False # check ... | 9eebc33df4cd5034d99f611b333949a2a1b7f04d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/9eebc33df4cd5034d99f611b333949a2a1b7f04d/RcUpdate.py |
self.logger.info("Installing Service %s" % entry.get('name')) | self.logger.info('Installing Service %s' % entry.get('name')) | def InstallService(self, entry): ''' Install Service entry In supervised mode we also take care it's (not) running ''' # check if init script exists try: os.stat('/etc/init.d/%s' % entry.get('name')) except OSError: self.logger.debug('Init script for service %s does not exist' % entry.get('name')) return False | 9eebc33df4cd5034d99f611b333949a2a1b7f04d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/9eebc33df4cd5034d99f611b333949a2a1b7f04d/RcUpdate.py |
self.__important__ = [e.get('name') for struct in config for entry in struct \ | self.__important__ = [entry.get('name') for struct in config for entry in struct \ | def __init__(self, logger, setup, config): Bcfg2.Client.Tools.RPMng.RPMng.__init__(self, logger, setup, config) self.__important__ = [e.get('name') for struct in config for entry in struct \ if entry.tag in ['Path', 'ConfigFile'] and \ e.get('name').startswith('/etc/yum.d') or e.get('name') == '/etc/yum.conf'] self.yum... | 8e7eceeed4add8f98222036a3f8bd00c4d9691dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/8e7eceeed4add8f98222036a3f8bd00c4d9691dc/YUMng.py |
e.get('name').startswith('/etc/yum.d') or e.get('name') == '/etc/yum.conf'] | entry.get('name').startswith('/etc/yum.d') or entry.get('name') == '/etc/yum.conf'] | def __init__(self, logger, setup, config): Bcfg2.Client.Tools.RPMng.RPMng.__init__(self, logger, setup, config) self.__important__ = [e.get('name') for struct in config for entry in struct \ if entry.tag in ['Path', 'ConfigFile'] and \ e.get('name').startswith('/etc/yum.d') or e.get('name') == '/etc/yum.conf'] self.yum... | 8e7eceeed4add8f98222036a3f8bd00c4d9691dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/8e7eceeed4add8f98222036a3f8bd00c4d9691dc/YUMng.py |
status = (len(onlevels) > 0 ) | status = (len(onlevels) > 0) command = 'start' | def VerifyService(self, entry, _): '''Verify Service status for entry''' try: cmd = "/sbin/chkconfig --list %s " % (entry.get('name')) raw = self.cmd.run(cmd)[1] patterns = ["error reading information", "unknown service"] srvdata = [line.split() for line in raw for pattern in patterns \ if pattern not in line][0] excep... | 80c61484c8b2c3529ba85ac5cf77974f49b90baa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/80c61484c8b2c3529ba85ac5cf77974f49b90baa/Chkconfig.py |
pstatus, pout = self.cmd.run('/sbin/service %s status' % \ entry.get('name')) if pstatus: self.cmd.run('/sbin/service %s start' % (entry.get('name'))) pstatus, pout = self.cmd.run('/sbin/service %s status' % \ entry.get('name')) | pstatus = self.cmd.run('/sbin/service %s status' % \ entry.get('name'))[0] needs_modification = ((command == 'start' and pstatus) or \ (command == 'stop' and not pstatus)) if not(self.setup.get('dryrun')) and needs_modification: self.cmd.run('/sbin/service %s %s' % (entry.get('name'), command)) pstatus = self.cmd.run(... | def VerifyService(self, entry, _): '''Verify Service status for entry''' try: cmd = "/sbin/chkconfig --list %s " % (entry.get('name')) raw = self.cmd.run(cmd)[1] patterns = ["error reading information", "unknown service"] srvdata = [line.split() for line in raw for pattern in patterns \ if pattern not in line][0] excep... | 80c61484c8b2c3529ba85ac5cf77974f49b90baa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/80c61484c8b2c3529ba85ac5cf77974f49b90baa/Chkconfig.py |
files.append(item.split()[5]) | if item.split()[5] not in self.nonexistent: files.append(item.split()[5]) | def VerifyDebsums(self, entry, modlist): output = self.cmd.run("%s -as %s" % (DEBSUMS, entry.get('name')))[1] if len(output) == 1 and "no md5sums for" in output[0]: self.logger.info("Package %s has no md5sums. Cannot verify" % \ entry.get('name')) entry.set('qtext', "Reinstall Package %s-%s to setup md5sums? (y/N) " \ ... | 2b0ea7df179353442712c830fb5c3a5164632d51 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/2b0ea7df179353442712c830fb5c3a5164632d51/APT.py |
start_sequence = int(entry.get('sequence')) kill_sequence = 100 - start_sequence | if (deb_version in DEBIAN_OLD_STYLE_BOOT_SEQUENCE): start_sequence = int(entry.get('sequence')) kill_sequence = 100 - start_sequence else: self.logger.warning("Your debian version boot sequence is dependency based \"sequence\" attribute wil be ignored.") | def VerifyService(self, entry, _): """Verify Service status for entry.""" rawfiles = glob.glob("/etc/rc*.d/[SK]*%s" % (entry.get('name'))) files = [] if entry.get('sequence'): start_sequence = int(entry.get('sequence')) kill_sequence = 100 - start_sequence else: start_sequence = None | 87c2bf31e1f2992a1733f5ce368e7336aa782663 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/87c2bf31e1f2992a1733f5ce368e7336aa782663/DebInit.py |
-- %s <%s> %s | -- %s <%s> %s | def run(command): return Popen(command, shell=True, stdout=PIPE).communicate() | b75a7980f11cb1cd5ce8570c17ddbbd2245a43ae /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/b75a7980f11cb1cd5ce8570c17ddbbd2245a43ae/export.py |
source.setup_data(force_update) | if not self.disableMetaData: source.setup_data(force_update) | def _load_config(self, force_update=False): ''' Load the configuration data and setup sources | 9ae740ec11040a07d3ebf5556955cb815c0d7826 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/9ae740ec11040a07d3ebf5556955cb815c0d7826/Packages.py |
repo = setup['repo'] | self.datastore = setup['repo'] | def __call__(self, args): Bcfg2.Server.Admin.MetadataCore.__call__(self, args) # Get Bcfg2 repo directory opts = {'repo': Bcfg2.Options.SERVER_REPOSITORY} setup = Bcfg2.Options.OptionParser(opts) setup.parse(sys.argv[1:]) repo = setup['repo'] | c9eec98340168b1e9e3f4877b15b681855ee696b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/c9eec98340168b1e9e3f4877b15b681855ee696b/Backup.py |
out = tarfile.open(filename, mode=mode) content = os.listdir(os.getcwd()) | out = tarfile.open(self.datastore + '/' + filename, mode=mode) content = os.listdir(self.datastore) | def __call__(self, args): Bcfg2.Server.Admin.MetadataCore.__call__(self, args) # Get Bcfg2 repo directory opts = {'repo': Bcfg2.Options.SERVER_REPOSITORY} setup = Bcfg2.Options.OptionParser(opts) setup.parse(sys.argv[1:]) repo = setup['repo'] | c9eec98340168b1e9e3f4877b15b681855ee696b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/c9eec98340168b1e9e3f4877b15b681855ee696b/Backup.py |
print "Archive %s was stored.\nLocation: %s" % (filename, datastore) | print "Archive %s was stored.\nLocation: %s" % (filename, self.datastore) | def __call__(self, args): Bcfg2.Server.Admin.MetadataCore.__call__(self, args) # Get Bcfg2 repo directory opts = {'repo': Bcfg2.Options.SERVER_REPOSITORY} setup = Bcfg2.Options.OptionParser(opts) setup.parse(sys.argv[1:]) repo = setup['repo'] | c9eec98340168b1e9e3f4877b15b681855ee696b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/c9eec98340168b1e9e3f4877b15b681855ee696b/Backup.py |
pass | deps = set() | def resolve_requirement(self, metadata, requirement, packages, debug=False): '''Resolve requirement to packages and or additional requirements | cdf7af00b772d774a88ed0fe23ccb9f369b2e039 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/cdf7af00b772d774a88ed0fe23ccb9f369b2e039/Packages.py |
def WriteBack(self, force=0): '''Write statistics changes back to persistent store''' # FIXME switch to a thread writer if (self.dirty and (self.lastwrite + self.__min_write_delay__ <= time())) \ or force: try: fout = open(self.filename + '.new', 'w') except IOError, ioerr: self.logger.error("Failed to open %s for writ... | b359ebe3f6d70e2d3beceb6210c2681092637c81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/b359ebe3f6d70e2d3beceb6210c2681092637c81/Statistics.py | ||
node.append(newstat) | node.append(copy.deepcopy(newstat)) | def updateStats(self, xml, client): '''Updates the statistics of a current node with new data''' | b359ebe3f6d70e2d3beceb6210c2681092637c81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/b359ebe3f6d70e2d3beceb6210c2681092637c81/Statistics.py |
fpath = "%s/etc/statistics.xml" % datastore self.data_file = StatisticsStore(fpath) | self.fpath = "%s/etc/statistics.xml" % datastore self.terminate = core.terminate self.work_queue = Queue.Queue() self.worker = threading.Thread(target=self.process_statistics_loop) self.worker.start() def process_statistics_loop(self): self.data_file = StatisticsStore(self.fpath) while not (self.terminate.isSet() and... | def __init__(self, core, datastore): Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore) Bcfg2.Server.Plugin.Statistics.__init__(self) Bcfg2.Server.Plugin.PullSource.__init__(self) fpath = "%s/etc/statistics.xml" % datastore self.data_file = StatisticsStore(fpath) | b359ebe3f6d70e2d3beceb6210c2681092637c81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/b359ebe3f6d70e2d3beceb6210c2681092637c81/Statistics.py |
self.data_file.updateStats(copy.deepcopy(xdata), client.hostname) | self.work_queue.put((copy.deepcopy(xdata), client.hostname)) | def process_statistics(self, client, xdata): self.data_file.updateStats(copy.deepcopy(xdata), client.hostname) | b359ebe3f6d70e2d3beceb6210c2681092637c81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/b359ebe3f6d70e2d3beceb6210c2681092637c81/Statistics.py |
chksum = md5.new() | if py24compat: chksum = md5.new() else: chksum = hashlib.md5() | def prelink_md5_check(filename): """ Checks if a file is prelinked. If it is run it through prelink -y to get the unprelinked md5 and file size. Return 0 if the file was not prelinked, otherwise return the file size. Always return the md5. """ prelink = False try: plf = open(filename, "rb") except IOError: return Fa... | 618425388b594baea6c40f6b6fbac60eddc6efde /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/618425388b594baea6c40f6b6fbac60eddc6efde/rpmtools.py |
if source.is_pkg(meta, current): | if source.is_package(meta, current): | def complete(self, meta, input_requirements, debug=False): '''Build the transitive closure of all package dependencies | 4a35e5a80787b550258992089b7e128de59be1b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/4a35e5a80787b550258992089b7e128de59be1b5/Packages.py |
if xsource.find('Recommended').text == 'true': | if xsource.find('Recommended').text in ['True', 'true']: | def source_from_xml(xsource): ret = dict([('rawurl', False), ('url', False)]) for key, tag in [('groups', 'Group'), ('components', 'Component'), ('arches', 'Arch'), ('blacklist', 'Blacklist')]: ret[key] = [item.text for item in xsource.findall(tag)] # version and component need to both contain data for sources to work ... | c688c4592be717cb28dabd13d6441c4c7c5bca06 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/c688c4592be717cb28dabd13d6441c4c7c5bca06/Packages.py |
cmd = "git archive --format=tar --prefix=%s-%s v%s | gzip > %s" % \ | cmd = "git archive --format=tar --prefix=%s-%s/ v%s | gzip > %s" % \ | def run(command): return Popen(command, shell=True, stdout=PIPE).communicate() | 5abb142f341b51fb03f5c57434b977beecb4b27a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/5abb142f341b51fb03f5c57434b977beecb4b27a/export.py |
('arches', 'Arch'), ('blacklist', 'Blacklist')]: | ('arches', 'Arch'), ('blacklist', 'Blacklist'), ('whitelist', 'Whitelist')]: | def source_from_xml(xsource): ret = dict([('rawurl', False), ('url', False)]) for key, tag in [('groups', 'Group'), ('components', 'Component'), ('arches', 'Arch'), ('blacklist', 'Blacklist')]: ret[key] = [item.text for item in xsource.findall(tag)] # version and component need to both contain data for sources to work ... | 0e9daba224deee78a25e9ec8d2f7096d2d76c3c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/0e9daba224deee78a25e9ec8d2f7096d2d76c3c4/Packages.py |
blacklist, recommended): | blacklist, whitelist, recommended): | def __init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, recommended): self.basepath = basepath self.version = version self.components = components self.url = url self.rawurl = rawurl self.groups = groups self.arches = arches self.deps = dict() self.provides = dict() self.blacklist = se... | 0e9daba224deee78a25e9ec8d2f7096d2d76c3c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/0e9daba224deee78a25e9ec8d2f7096d2d76c3c4/Packages.py |
if requirement in self.blacklist: | if requirement in self.blacklist or \ (len(self.whitelist) > 0 and requirement not in self.whitelist): | def resolve_requirement(self, metadata, requirement, packages, debug=False): '''Resolve requirement to packages and or additional requirements | 0e9daba224deee78a25e9ec8d2f7096d2d76c3c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/0e9daba224deee78a25e9ec8d2f7096d2d76c3c4/Packages.py |
rawurl, blacklist, recommended): | rawurl, blacklist, whitelist, recommended): | def __init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, recommended): Source.__init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, recommended) if not self.rawurl: self.baseurl = self.url + '%(version)s/%(component)s/%(arch)s/' else: self.baseurl = self.... | 0e9daba224deee78a25e9ec8d2f7096d2d76c3c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/0e9daba224deee78a25e9ec8d2f7096d2d76c3c4/Packages.py |
groups, rawurl, blacklist, recommended) | groups, rawurl, blacklist, whitelist, recommended) | def __init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, recommended): Source.__init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, recommended) if not self.rawurl: self.baseurl = self.url + '%(version)s/%(component)s/%(arch)s/' else: self.baseurl = self.... | 0e9daba224deee78a25e9ec8d2f7096d2d76c3c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/0e9daba224deee78a25e9ec8d2f7096d2d76c3c4/Packages.py |
rawurl, blacklist, recommended): | rawurl, blacklist, whitelist, recommended): | def __init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, recommended): Source.__init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, recommended) if not self.rawurl: self.cachefile = self.escape_url(self.url + '@' + self.version) + '.data' else: self.cache... | 0e9daba224deee78a25e9ec8d2f7096d2d76c3c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/0e9daba224deee78a25e9ec8d2f7096d2d76c3c4/Packages.py |
rawurl, blacklist, recommended) | rawurl, blacklist, whitelist, recommended) | def __init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, recommended): Source.__init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, recommended) if not self.rawurl: self.cachefile = self.escape_url(self.url + '@' + self.version) + '.data' else: self.cache... | 0e9daba224deee78a25e9ec8d2f7096d2d76c3c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/0e9daba224deee78a25e9ec8d2f7096d2d76c3c4/Packages.py |
path = context['request'].path | path = context['request'].META['PATH_INFO'] | def page_navigator(context): """ Creates paginated links. Expects the context to be a RequestContext and views.prepare_paginated_list() to have populated page information. """ fragment = dict() try: path = context['request'].path total_pages = int(context['total_pages']) records_per_page = int(context['records_per_pag... | 966aa56675a92a7bb3a7f09daded03069ee4c1e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/966aa56675a92a7bb3a7f09daded03069ee4c1e8/bcfg2_tags.py |
path = context['request'].path | path = context['request'].META['PATH_INFO'] | def filter_navigator(context): try: path = context['request'].path view, args, kwargs = resolve(path) # Strip any page limits and numbers if 'page_number' in kwargs: del kwargs['page_number'] if 'page_limit' in kwargs: del kwargs['page_limit'] filters = [] for filter in filter_list: if filter in kwargs: myargs = kwar... | 966aa56675a92a7bb3a7f09daded03069ee4c1e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/966aa56675a92a7bb3a7f09daded03069ee4c1e8/bcfg2_tags.py |
path = context['request'].path | path = context['request'].META['PATH_INFO'] | def render(self, context): link = '#' try: path = context['request'].path view, args, kwargs = resolve(path) filter_value = self.filter_value.resolve(context, True) if filter_value: filter_name = smart_str(self.filter_name) filter_value = smart_unicode(filter_value) kwargs[filter_name] = filter_value # These two don't ... | 966aa56675a92a7bb3a7f09daded03069ee4c1e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/966aa56675a92a7bb3a7f09daded03069ee4c1e8/bcfg2_tags.py |
if res == cert + ": OK\n" | if res == cert + ": OK\n": | def verify_cert(self, filename, entry): """ check that a certificate validates against the ca cert, and that it has not expired. """ chaincert = self.CAs[self.cert_specs[entry.get('name')]['ca']].get('chaincert') cert = self.data + filename cmd = "openssl verify -CAfile %s %s" % (chaincert, cert) res = Popen(cmd, shell... | a1a0321602585314375d0577516fb012e27f2c59 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/a1a0321602585314375d0577516fb012e27f2c59/SSLCA.py |
for alias in metadata.aliases: cp.set('alt_names', 'DNS.'+str(x), alias) | altnames = list(metadata.aliases) altnames.append(metadata.hostname) for altname in altnames: cp.set('alt_names', 'DNS.'+str(x), altname) | def build_req_config(self, entry, metadata): """ generates a temporary openssl configuration file that is used to generate the required certificate request """ # create temp request config file conffile = open(tempfile.mkstemp()[1], 'w') cp = ConfigParser({}) cp.optionxform = str defaults = { 'req': { 'default_md': 'sh... | a1a0321602585314375d0577516fb012e27f2c59 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/a1a0321602585314375d0577516fb012e27f2c59/SSLCA.py |
except Exception as e: | except Exception, e: | def Install(self, packages, states): ''' Pacman Install ''' pkgline = "" for pkg in packages: pkgline += " " + pkg.get('name') | b93a686ac42e56b6d7c27d1dd15b162cf3a56886 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/b93a686ac42e56b6d7c27d1dd15b162cf3a56886/Pacman.py |
cache = self.cmd.run("equery -q list")[1] | ret, cache = self.cmd.run("equery -q list") if ret == 2: cache = self.cmd.run("equery -q list '*'")[1] | def RefreshPackages(self): '''Refresh memory hashes of packages''' cache = self.cmd.run("equery -q list")[1] pattern = re.compile('(.*)-(\d.*)') self.installed = {} for pkg in cache: if pattern.match(pkg): name = pattern.match(pkg).group(1) version = pattern.match(pkg).group(2) self.installed[name] = version else: self... | 884d6343e625212257b7c1a87188891924d32021 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/884d6343e625212257b7c1a87188891924d32021/Portage.py |
if arch not in metadata.groups + ['global']: | if arch not in metadata.groups + set(['global']): | def get_vpkgs(self, metadata): rv = Source.get_vpkgs(self, metadata) for arch, fmdata in self.filemap.iteritems(): if arch not in metadata.groups + ['global']: continue for filename, pkgs in fmdata.iteritems(): rv[filename] = pkgs return rv | afc68748a022ae304cdb0869789763e17d50e23e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/afc68748a022ae304cdb0869789763e17d50e23e/Packages.py |
except Exception as e: | except Exception, e: | def Install(self, packages, states): ''' Pacman Install ''' pkgline = "" for pkg in packages: pkgline += " " + pkg.get('name') | ed7386814afdf3ca70bb9454ab7fb09a664e1657 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/ed7386814afdf3ca70bb9454ab7fb09a664e1657/Pacman.py |
ypname = pkgname | d = {} d['name'] = pkgname | def build_yname(pkgname, inst): """Build yum appropriate package name.""" ypname = pkgname if inst.get('version') != 'any': ypname += '-' if inst.get('epoch', False): ypname += "%s:" % inst.get('epoch') if inst.get('version', False) and inst.get('version') != 'any': ypname += "%s" % (inst.get('version')) if inst.get('r... | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py |
ypname += '-' | d['version'] = inst.get('version') | def build_yname(pkgname, inst): """Build yum appropriate package name.""" ypname = pkgname if inst.get('version') != 'any': ypname += '-' if inst.get('epoch', False): ypname += "%s:" % inst.get('epoch') if inst.get('version', False) and inst.get('version') != 'any': ypname += "%s" % (inst.get('version')) if inst.get('r... | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py |
ypname += "%s:" % inst.get('epoch') if inst.get('version', False) and inst.get('version') != 'any': ypname += "%s" % (inst.get('version')) | d['epoch'] = inst.get('epoch') | def build_yname(pkgname, inst): """Build yum appropriate package name.""" ypname = pkgname if inst.get('version') != 'any': ypname += '-' if inst.get('epoch', False): ypname += "%s:" % inst.get('epoch') if inst.get('version', False) and inst.get('version') != 'any': ypname += "%s" % (inst.get('version')) if inst.get('r... | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py |
ypname += "-%s" % (inst.get('release')) | d['release'] = inst.get('release') | def build_yname(pkgname, inst): """Build yum appropriate package name.""" ypname = pkgname if inst.get('version') != 'any': ypname += '-' if inst.get('epoch', False): ypname += "%s:" % inst.get('epoch') if inst.get('version', False) and inst.get('version') != 'any': ypname += "%s" % (inst.get('version')) if inst.get('r... | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py |
ypname += ".%s" % (inst.get('arch')) return ypname | d['arch'] = inst.get('arch') return d | def build_yname(pkgname, inst): """Build yum appropriate package name.""" ypname = pkgname if inst.get('version') != 'any': ypname += '-' if inst.get('epoch', False): ypname += "%s:" % inst.get('epoch') if inst.get('version', False) and inst.get('version') != 'any': ypname += "%s" % (inst.get('version')) if inst.get('r... | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py |
self.logger.info("Installing GPG keys.") | def Install(self, packages, states): """ Try and fix everything that RPMng.VerifyPackages() found wrong for each Package Entry. This can result in individual RPMs being installed (for the first time), deleted, downgraded or upgraded. | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py | |
key_arg = os.path.join(self.instance_status[inst].get('pkg').get('uri'), \ | key_file = os.path.join(self.instance_status[inst].get('pkg').get('uri'), \ | def Install(self, packages, states): """ Try and fix everything that RPMng.VerifyPackages() found wrong for each Package Entry. This can result in individual RPMs being installed (for the first time), deleted, downgraded or upgraded. | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py |
cmdrc, output = self.cmd.run("rpm --import %s" % key_arg) if cmdrc != 0: self.logger.debug("Unable to install %s-%s" % \ (self.instance_status[inst].get('pkg').get('name'), \ self.str_evra(inst))) else: self.logger.debug("Installed %s-%s-%s" % \ (self.instance_status[inst].get('pkg').get('name'), \ inst.get('version'),... | self._installGPGKey(inst, key_file) | def Install(self, packages, states): """ Try and fix everything that RPMng.VerifyPackages() found wrong for each Package Entry. This can result in individual RPMs being installed (for the first time), deleted, downgraded or upgraded. | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py |
if YAD: pkgtool = "/usr/bin/yum -d0 -y install %s" else: pkgtool = "/usr/bin/yum -d0 install %s" install_args = [] | def Install(self, packages, states): """ Try and fix everything that RPMng.VerifyPackages() found wrong for each Package Entry. This can result in individual RPMs being installed (for the first time), deleted, downgraded or upgraded. | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py | |
install_args.append(build_yname(pkg_arg, inst)) cmdrc, output = self.cmd.run(pkgtool % " ".join(install_args)) if cmdrc == 0: self.logger.info("Single Pass for Install Succeeded") self.RefreshPackages() else: self.logger.error("Single Pass Install of Packages Failed") installed_instances = [] for inst in install_pk... | self.yb.install(**build_yname(pkg_arg, inst)) | def Install(self, packages, states): """ Try and fix everything that RPMng.VerifyPackages() found wrong for each Package Entry. This can result in individual RPMs being installed (for the first time), deleted, downgraded or upgraded. | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py |
if YAD: pkgtool = "/usr/bin/yum -d0 -y update %s" else: pkgtool = "/usr/bin/yum -d0 update %s" upgrade_args = [] | def Install(self, packages, states): """ Try and fix everything that RPMng.VerifyPackages() found wrong for each Package Entry. This can result in individual RPMs being installed (for the first time), deleted, downgraded or upgraded. | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py | |
pkg_arg = build_yname(self.instance_status[inst].get('pkg').get('name'), inst) upgrade_args.append(pkg_arg) cmdrc, output = self.cmd.run(pkgtool % " ".join(upgrade_args)) if cmdrc == 0: self.logger.info("Single Pass for Install Succeeded") self.RefreshPackages() else: self.logger.error("Single Pass Install of Packa... | pkg_arg = self.instance_status[inst].get('pkg').get('name') self.yb.update(**build_yname(pkg_arg, inst)) self._runYumTransaction() | def Install(self, packages, states): """ Try and fix everything that RPMng.VerifyPackages() found wrong for each Package Entry. This can result in individual RPMs being installed (for the first time), deleted, downgraded or upgraded. | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py |
self.modlists.get(pkg_entry, [])) | self.modlists.get(pkg_entry, [])) | def Install(self, packages, states): """ Try and fix everything that RPMng.VerifyPackages() found wrong for each Package Entry. This can result in individual RPMs being installed (for the first time), deleted, downgraded or upgraded. | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py |
if YAD: pkgtool = "/usr/bin/yum -d0 -y erase %s" else: pkgtool = "/usr/bin/yum -d0 erase %s" | def RemovePackages(self, packages): """ Remove specified entries. | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py | |
pkg_arg = pkg.get('name') + '-' if inst.get('epoch', False): pkg_arg = pkg_arg + inst.get('epoch') + ':' pkg_arg = pkg_arg + inst.get('version') + '-' + inst.get('release') if inst.get('arch', False): pkg_arg = pkg_arg + '.' + inst.get('arch') erase_args.append(pkg_arg) | self.yb.remove(**nevra) self.modified.append(pkg) | def RemovePackages(self, packages): """ Remove specified entries. | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py |
pkgspec = { 'name':pkg.get('name'), 'version':inst.get('version'), 'release':inst.get('release')} self.logger.info("WARNING: gpg-pubkey package not in configuration %s %s"\ % (pkgspec.get('name'), self.str_evra(pkgspec))) self.logger.info(" This package will be deleted in a future version of the RPMng driver.")... | self.logger.info("WARNING: gpg-pubkey package not in configuration %s %s-%s"\ % (nevra['name'], nevra['version'], nevra['release'])) self.logger.info(" This package will be deleted in a future version of the YUMng driver.") self._runYumTransaction() | def RemovePackages(self, packages): """ Remove specified entries. | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py |
request.shutdown(2) | def close_request(self, request): request.unwrap() request.shutdown(2) request.close() | 18ec3026423c509fdffdde302676088798405082 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/18ec3026423c509fdffdde302676088798405082/SSLServer.py | |
if arch not in metadata.groups + set(['global']): | if arch not in metadata.groups and arch != 'global': | def get_vpkgs(self, metadata): rv = Source.get_vpkgs(self, metadata) for arch, fmdata in self.filemap.iteritems(): if arch not in metadata.groups + set(['global']): continue for filename, pkgs in fmdata.iteritems(): rv[filename] = pkgs return rv | 01e48ff98e5436d4e50a1c783044aac44c9d54c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/01e48ff98e5436d4e50a1c783044aac44c9d54c0/Packages.py |
output = self.cmd.run('/usr/sbin/service %s status' % \ entry.get('name'))[1][0] | try: output = self.cmd.run('/usr/sbin/service %s status' % \ entry.get('name'))[1][0] except IndexError: self.logger.error("Service %s not an Upstart service" % \ entry.get('name')) return False | def VerifyService(self, entry, _): '''Verify Service status for entry | 258025085e8d4a0e4129bf1d2dd36ed7ac8786b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/258025085e8d4a0e4129bf1d2dd36ed7ac8786b2/Upstart.py |
__req__ = {'Package': ['name', 'version'], | __req__ = {'Package': ['name'], | def __init__(self, logger): self.logger = logger | 46d0a9670763f6c8673adad35be3e110c05ec7af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/46d0a9670763f6c8673adad35be3e110c05ec7af/YUMng.py |
__new_req__ = {'Package': ['name'], 'Instance': ['version', 'release', 'arch']} __new_ireq__ = {'Package': ['name'], \ 'Instance': []} __gpg_req__ = {'Package': ['name', 'version']} __gpg_ireq__ = {'Package': ['name', 'version']} __new_gpg_req__ = {'Package': ['name'], 'Instance': ['version', 'release']} __new_gp... | def __init__(self, logger): self.logger = logger | 46d0a9670763f6c8673adad35be3e110c05ec7af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/46d0a9670763f6c8673adad35be3e110c05ec7af/YUMng.py | |
if entry.get('mode', 'default') == 'supervised': pstatus, pout = self.cmd.run('/usr/sbin/service %s status' % \ entry.get('name')) if pstatus: self.cmd.run('/usr/sbin/service %s start' % (entry.get('name'))) return True | if entry.get('status') == 'on': pstatus = self.cmd.run(self.get_svc_command(entry, 'start'))[0] elif entry.get('status') == 'off': pstatus = self.cmd.run(self.get_svc_command(entry, 'stop'))[0] return not pstatus | def InstallService(self, entry): """Install Service for entry.""" if entry.get('mode', 'default') == 'supervised': pstatus, pout = self.cmd.run('/usr/sbin/service %s status' % \ entry.get('name')) if pstatus: self.cmd.run('/usr/sbin/service %s start' % (entry.get('name'))) return True | 841b9201412aaf00d0c74a60ec21544e5c2c6c10 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/841b9201412aaf00d0c74a60ec21544e5c2c6c10/Upstart.py |
opts, args = getopt(argv[1:], "hvudc:s:", ["help", "verbose", "updates" , | opts, args = getopt(argv[1:], "hvudc:s:C", ["help", "verbose", "updates" , | def load_stats(cdata, sdata, vlevel, quick=False, location=''): cursor = connection.cursor() clients = {} cursor.execute("SELECT name, id from reports_client;") [clients.__setitem__(a, b) for a, b in cursor.fetchall()] for node in sdata.findall('Node'): name = node.get('name') if not name in clients: cursor.execute(\ ... | b4a76883d4971a46970aebb4ee617f3677125fc6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/b4a76883d4971a46970aebb4ee617f3677125fc6/importscript.py |
self.__important__ = [entry.get('name') for struct in config for entry in struct \ if entry.tag in ['Path', 'ConfigFile'] and \ entry.get('name').startswith('/etc/yum.d') or entry.get('name') == '/etc/yum.conf'] | self.__important__ = [entry.get('name') for struct in config \ for entry in struct \ if entry.tag in ['Path', 'ConfigFile'] and \ entry.get('name').startswith('/etc/yum.d') \ or entry.get('name') == '/etc/yum.conf'] | def __init__(self, logger, setup, config): Bcfg2.Client.Tools.RPMng.RPMng.__init__(self, logger, setup, config) self.__important__ = [entry.get('name') for struct in config for entry in struct \ if entry.tag in ['Path', 'ConfigFile'] and \ entry.get('name').startswith('/etc/yum.d') or entry.get('name') == '/etc/yum.con... | 09fcf23f499c3743f2e5634510cc9d2d8b9949e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/09fcf23f499c3743f2e5634510cc9d2d8b9949e9/YUMng.py |
x= Bcfg2.Client.XML.SubElement(entry, "Instance", name=entry.get('name'), version=vers, arch=arch, release=rel, epoch=epoch) | x = Bcfg2.Client.XML.SubElement(entry, "Instance", name=entry.get('name'), version=vers, arch=arch, release=rel, epoch=epoch) | def VerifyPackage(self, entry, modlist): pinned_version = None if entry.get('version', False) == 'auto': # old style entry; synthesize Instances from current installed if entry.get('name') not in self.yum_installed and \ entry.get('name') not in self.yum_avail: # new entry; fall back to default entry.set('version', 'an... | 09fcf23f499c3743f2e5634510cc9d2d8b9949e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/09fcf23f499c3743f2e5634510cc9d2d8b9949e9/YUMng.py |
view, args, kw = resolve(request.path) | view, args, kw = resolve(request.META['PATH_INFO']) | def _handle_timeview(request, **kwargs): """Send any posts back.""" if request.method == 'POST': cal_date = request.POST['cal_date'] try: fmt = "%Y/%m/%d" if cal_date.find(' ') > -1: fmt += " %H:%M" timestamp = datetime(*strptime(cal_date, fmt)[0:6]) view, args, kw = resolve(request.path) kw['year'] = "%0.4d" % timesta... | 9e9edecaee3e0cdddd3d386c9fe5246b057aa0a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/9e9edecaee3e0cdddd3d386c9fe5246b057aa0a6/views.py |
def resolve_client(self, addresspair): '''Lookup address locally or in DNS to get a hostname''' #print self.session_cache if addresspair in self.session_cache: (stamp, uuid) = self.session_cache[addresspair] if time.time() - stamp < 90: return self.session_cache[addresspair][1] address = addresspair[0] if address in se... | 80f8da0cb96466e108963c88645b99bd32ce5f0f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/80f8da0cb96466e108963c88645b99bd32ce5f0f/Metadata.py | ||
self.session_cache[address] = (time.time(), user) | self.session_cache[address] = (time.time(), client) | def AuthenticateConnection(self, cert, user, password, address): '''This function checks auth creds''' if cert: id_method = 'cert' certinfo = dict([x[0] for x in cert['subject']]) # look at cert.cN client = certinfo['commonName'] self.debug_log("Got cN %s; using as client name" % client) auth_type = self.auth.get(clien... | 80f8da0cb96466e108963c88645b99bd32ce5f0f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/80f8da0cb96466e108963c88645b99bd32ce5f0f/Metadata.py |
cursor.close() connection.close() | try: cursor.close() connection.close() except: pass | def dosync(): """Function to do the syncronisation for the models""" # try to detect if it's a fresh new database try: cursor = connection.cursor() # If this table goes missing then don't forget to change it to the new one cursor.execute("Select * from reports_client") # if we get here with no error then the database h... | 5fe38f0054cf392829b69961b864f284e34057f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/5fe38f0054cf392829b69961b864f284e34057f4/updatefix.py |
if event.filename[0] == '/' or event.filename.startswith('CAs'): | if event.filename[0] == '/': | def HandleEvent(self, event=None): """ Updates which files this plugin handles based upon filesystem events. Allows configuration items to be added/removed without server restarts. """ action = event.code2str() if event.filename[0] == '/' or event.filename.startswith('CAs'): return epath = "".join([self.data, self.hand... | 6bbd4d6797d763777188d3984808f1ff692b2376 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/6bbd4d6797d763777188d3984808f1ff692b2376/SSLCA.py |
self.ca_passphrases[ca] = cp.get('sslca', ca+'_passphrase') | self.CAs[ca] = dict(cp.items('sslca_'+ca)) | def HandleEvent(self, event=None): """ Updates which files this plugin handles based upon filesystem events. Allows configuration items to be added/removed without server restarts. """ action = event.code2str() if event.filename[0] == '/' or event.filename.startswith('CAs'): return epath = "".join([self.data, self.hand... | 6bbd4d6797d763777188d3984808f1ff692b2376 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/6bbd4d6797d763777188d3984808f1ff692b2376/SSLCA.py |
ca_config = "".join([self.data, '/CAs/', ca, '/', 'openssl.cnf']) | ca_config = self.CAs[ca]['config'] | def build_cert(self, entry, metadata): """ creates a new certificate according to the specification """ req_config = self.build_req_config(entry, metadata) req = self.build_request(req_config, entry) ca = self.cert_specs[entry.get('name')]['ca'] ca_config = "".join([self.data, '/CAs/', ca, '/', 'openssl.cnf']) days = s... | 6bbd4d6797d763777188d3984808f1ff692b2376 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/6bbd4d6797d763777188d3984808f1ff692b2376/SSLCA.py |
passphrase = self.ca_passphrases[ca] cmd = "openssl ca -config %s -in %s -days %s -batch -passin pass:%s" % (ca_config, req, days, passphrase) | passphrase = self.CAs[ca].get('passphrase') if passphrase: cmd = "openssl ca -config %s -in %s -days %s -batch -passin pass:%s" % (ca_config, req, days, passphrase) else: cmd = "openssl ca -config %s -in %s -days %s -batch" % (ca_config, req, days) | def build_cert(self, entry, metadata): """ creates a new certificate according to the specification """ req_config = self.build_req_config(entry, metadata) req = self.build_request(req_config, entry) ca = self.cert_specs[entry.get('name')]['ca'] ca_config = "".join([self.data, '/CAs/', ca, '/', 'openssl.cnf']) days = s... | 6bbd4d6797d763777188d3984808f1ff692b2376 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/6bbd4d6797d763777188d3984808f1ff692b2376/SSLCA.py |
__req__ = {'Package': ['name', 'version']} | __req__ = {'Package': ['name', 'version'], 'Path': ['type']} | def __init__(self, logger): self.logger = logger | 42d9e6bacc33ac800f988ca67eae1d04b9b5c2fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/42d9e6bacc33ac800f988ca67eae1d04b9b5c2fc/YUMng.py |
if entry.get('type') == 'ignore' ] | if entry.tag == 'Path' and \ entry.get('type') == 'ignore' ] | def __init__(self, logger, setup, config): self.yb = yum.YumBase() Bcfg2.Client.Tools.PkgTool.__init__(self, logger, setup, config) self.ignores = [ entry.get('name') for struct in config \ for entry in struct \ if entry.get('type') == 'ignore' ] self.instance_status = {} self.extra_instances = [] self.modlists = {} se... | 42d9e6bacc33ac800f988ca67eae1d04b9b5c2fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/42d9e6bacc33ac800f988ca67eae1d04b9b5c2fc/YUMng.py |
self.__important__ = [entry.get('name') for struct in config for entry in struct \ | self.__important__ = [entry.get('name') \ for struct in config for entry in struct \ | def __init__(self, logger, setup, config): self.__important__ = [entry.get('name') for struct in config for entry in struct \ if entry.tag == 'Path' and \ entry.get('important') in ['true', 'True']] self.setup = setup self.logger = logger if not hasattr(self, '__ireq__'): self.__ireq__ = self.__req__ self.config = conf... | decb4dd187c808e2f1c0ff7040e914abc7adeae2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/decb4dd187c808e2f1c0ff7040e914abc7adeae2/__init__.py |
def canVerify(self, entry): """Test if entry has enough information to be verified.""" if not self.handlesEntry(entry): return False | decb4dd187c808e2f1c0ff7040e914abc7adeae2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/decb4dd187c808e2f1c0ff7040e914abc7adeae2/__init__.py | ||
self.logger.debug('Setting state to true for pkg %s' % (entry.get('name'))) | self.logger.debug('Setting state to true for pkg %s' % \ (entry.get('name'))) | def Install(self, packages, states): """ Run a one-pass install, followed by single pkg installs in case of failure. """ self.logger.info("Trying single pass package install for pkgtype %s" % \ self.pkgtype) | decb4dd187c808e2f1c0ff7040e914abc7adeae2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/decb4dd187c808e2f1c0ff7040e914abc7adeae2/__init__.py |
self.logger.info("Forcing state to true for pkg %s" % (pkg.get('name'))) | self.logger.info("Forcing state to true for pkg %s" % \ (pkg.get('name'))) | def Install(self, packages, states): """ Run a one-pass install, followed by single pkg installs in case of failure. """ self.logger.info("Trying single pass package install for pkgtype %s" % \ self.pkgtype) | decb4dd187c808e2f1c0ff7040e914abc7adeae2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/decb4dd187c808e2f1c0ff7040e914abc7adeae2/__init__.py |
self.logger.error("Failed to install package %s" % (pkg.get('name'))) | self.logger.error("Failed to install package %s" % \ (pkg.get('name'))) | def Install(self, packages, states): """ Run a one-pass install, followed by single pkg installs in case of failure. """ self.logger.info("Trying single pass package install for pkgtype %s" % \ self.pkgtype) | decb4dd187c808e2f1c0ff7040e914abc7adeae2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/decb4dd187c808e2f1c0ff7040e914abc7adeae2/__init__.py |
status = (rc == 0) | return (rc == 0) | def InstallService(self, entry): ''' Install Service entry In supervised mode we also take care it's (not) running ''' self.logger.info('Installing Service %s' % entry.get('name')) if entry.get('status') == 'on': # make sure it's enabled cmd = '/sbin/rc-update add %s default' rc = self.cmd.run(cmd % entry.get('name'))[... | 5ee259750bbef505378a1fc342c518b9a08540d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/5ee259750bbef505378a1fc342c518b9a08540d5/RcUpdate.py |
status = (rc == 0) | return (rc == 0) | def InstallService(self, entry): ''' Install Service entry In supervised mode we also take care it's (not) running ''' self.logger.info('Installing Service %s' % entry.get('name')) if entry.get('status') == 'on': # make sure it's enabled cmd = '/sbin/rc-update add %s default' rc = self.cmd.run(cmd % entry.get('name'))[... | 5ee259750bbef505378a1fc342c518b9a08540d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/5ee259750bbef505378a1fc342c518b9a08540d5/RcUpdate.py |
return status | return False | def InstallService(self, entry): ''' Install Service entry In supervised mode we also take care it's (not) running ''' self.logger.info('Installing Service %s' % entry.get('name')) if entry.get('status') == 'on': # make sure it's enabled cmd = '/sbin/rc-update add %s default' rc = self.cmd.run(cmd % entry.get('name'))[... | 5ee259750bbef505378a1fc342c518b9a08540d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/5ee259750bbef505378a1fc342c518b9a08540d5/RcUpdate.py |
elif words[0] == 'Depends': | elif words[0] in ['Depends', 'Pre-Depends']: | def read_files(self): bdeps = dict() bprov = dict() for fname in self.files: barch = [x for x in fname.split('@') if x.startswith('binary-')][0][7:] if barch not in bdeps: bdeps[barch] = dict() bprov[barch] = dict() try: reader = gzip.GzipFile(fname) except: print("Failed to read file %s" % fname) raise for line in rea... | 4cea0387ac87748a399f71060664a7a671b464e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/4cea0387ac87748a399f71060664a7a671b464e9/Packages.py |
self.gpg_keyids = self.getinstalledgpg() | def queuePkg(pkg, inst, queue): if pkg.get('name') == 'gpg-pubkey': gpg_keys.append(inst) else: queue.append(inst) | 21b8593780ef2020618ae6c82880c7698abd13ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/21b8593780ef2020618ae6c82880c7698abd13ea/YUMng.py | |
view, args, kw = resolve(request.path) | view, args, kw = resolve(request.META['PATH_INFO']) | def _handle_timeview(request, **kwargs): """Send any posts back.""" if request.method == 'POST': cal_date = request.POST['cal_date'] try: fmt = "%Y/%m/%d" if cal_date.find(' ') > -1: fmt += " %H:%M" timestamp = datetime(*strptime(cal_date, fmt)[0:6]) view, args, kw = resolve(request.path) kw['year'] = "%0.4d" % timesta... | d17fedf68c947c3ada40b441d32c8d3f185028f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/d17fedf68c947c3ada40b441d32c8d3f185028f9/views.py |
cursor.close() connection.close() | try: cursor.close() connection.close() except: pass | def dosync(): """Function to do the syncronisation for the models""" # try to detect if it's a fresh new database try: cursor = connection.cursor() # If this table goes missing then don't forget to change it to the new one cursor.execute("Select * from reports_client") # if we get here with no error then the database h... | 6079a4b01ee4d500fb79cd5552f00e987ed65485 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/6079a4b01ee4d500fb79cd5552f00e987ed65485/updatefix.py |
elif "is not installed" in item: | elif "is not installed" in item or "missing file" in item: | def VerifyDebsums(self, entry, modlist): output = self.cmd.run("/usr/bin/debsums -as %s" % entry.get('name'))[1] if len(output) == 1 and "no md5sums for" in output[0]: self.logger.info("Package %s has no md5sums. Cannot verify" % \ entry.get('name')) entry.set('qtext', "Reinstall Package %s-%s to setup md5sums? (y/N) "... | aab798ccfb9d4e04634181780627c94cb66a5e53 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/aab798ccfb9d4e04634181780627c94cb66a5e53/APT.py |
return item in self.packages['global'] or item in self.packages[arch[0]] | return (item in self.packages['global'] or item in self.packages[arch[0]]) and \ item not in self.blacklist and \ ((len(self.whitelist) == 0) or item in self.whitelist) | def is_package(self, metadata, item): arch = [a for a in self.arches if a in metadata.groups] if not arch: return False return item in self.packages['global'] or item in self.packages[arch[0]] | d57ed55d8effce27305e2d5e8fdd99cfe930ac42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/d57ed55d8effce27305e2d5e8fdd99cfe930ac42/Packages.py |
return pkg in self.pkgnames | return pkg in self.pkgnames and \ pkg not in self.blacklist and \ (len(self.whitelist) == 0 or pkg in self.whitelist) | def is_package(self, _, pkg): return pkg in self.pkgnames | d57ed55d8effce27305e2d5e8fdd99cfe930ac42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/d57ed55d8effce27305e2d5e8fdd99cfe930ac42/Packages.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.