bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
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... | 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, maildirflag in flagmap: if imapflag.lower() in imapflaglist: retval.append(maildirflag) retval.sort()... | 463,000 |
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) + ')' | def flagsmaildir2imap(maildirflaglist): retval = [] for imapflag, maildirflag in flagmap: if maildirflag in maildirflaglist: retval.append(imapflag) retval.sort() return '(' + ' '.join(retval) + ')' | 463,001 |
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... | def run(self): global exitthreads, profiledir self.threadid = thread.get_ident() try: if not profiledir: # normal case Thread.run(self) else: try: import cProfile as profile except ImportError: import profile prof = profile.Profile() try: prof = prof.runctx("Thread.run(self)", globals(), locals()) except Syste... | 463,002 |
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'] | 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:]) self.datastore = setup['repo'] | 463,003 |
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'] | 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'] | 463,004 |
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'] | 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'] | 463,005 |
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() | 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() | 463,006 |
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... | 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... | 463,007 |
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() | 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() | 463,008 |
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" %... | 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" %... | 463,009 |
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 ... | def VerifyService(self, entry, _): ''' Verify Service status for entry. Assumes we run in the "default" runlevel. ''' # check if init script exists# check is service is enabled cmd = '/etc/init.d/%s status | grep started' rc = self.cmd.run(cmd % entry.get('name'))[0] is_enabled = (rc == 0) | 463,010 |
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 ... | 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 ... | 463,011 |
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 ... | 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 ... | 463,012 |
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 | 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 | 463,013 |
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... | 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 \ e.get('name').startswith('/etc/yum.d') or e.get('name') == '/etc/yum.conf'] self... | 463,014 |
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... | 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 \ entry.get('name').startswith('/etc/yum.d') or entry.get('name') == '/etc/yum.conf'] ... | 463,015 |
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... | 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... | 463,016 |
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... | 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... | 463,017 |
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) " \ ... | 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) " \ ... | 463,018 |
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 | 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'): if (deb_version in DEBIAN_OLD_STYLE_BOOT_SEQUENCE): start_sequence = int(entry.get('sequence')) kill_sequence = 100 - start_sequence else: self.... | 463,019 |
def run(command): return Popen(command, shell=True, stdout=PIPE).communicate() | def run(command): return Popen(command, shell=True, stdout=PIPE).communicate() | 463,020 |
def _load_config(self, force_update=False): ''' Load the configuration data and setup sources | def _load_config(self, force_update=False): ''' Load the configuration data and setup sources | 463,021 |
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'] | 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:]) self.datastore = setup['repo'] | 463,022 |
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'] | 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'] | 463,023 |
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'] | 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'] | 463,024 |
def resolve_requirement(self, metadata, requirement, packages, debug=False): '''Resolve requirement to packages and or additional requirements | def resolve_requirement(self, metadata, requirement, packages, debug=False): '''Resolve requirement to packages and or additional requirements | 463,025 |
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... | defWriteBack(self,force=0):'''Writestatisticschangesbacktopersistentstore'''#FIXMEswitchtoathreadwriterif(self.dirtyand(self.lastwrite+self.__min_write_delay__<=time()))\orforce:try:fout=open(self.filename+'.new','w')exceptIOError,ioerr:self.logger.error("Failedtoopen%sforwriting:%s"%(self.filename+'.new',ioerr))else:f... | 463,026 |
def updateStats(self, xml, client): '''Updates the statistics of a current node with new data''' | def updateStats(self, xml, client): '''Updates the statistics of a current node with new data''' | 463,027 |
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) | 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) | 463,028 |
def process_statistics(self, client, xdata): self.data_file.updateStats(copy.deepcopy(xdata), client.hostname) | def process_statistics(self, client, xdata): self.data_file.updateStats(copy.deepcopy(xdata), client.hostname) | 463,029 |
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... | 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... | 463,030 |
def complete(self, meta, input_requirements, debug=False): '''Build the transitive closure of all package dependencies | def complete(self, meta, input_requirements, debug=False): '''Build the transitive closure of all package dependencies | 463,031 |
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 ... | 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 ... | 463,032 |
def run(command): return Popen(command, shell=True, stdout=PIPE).communicate() | def run(command): return Popen(command, shell=True, stdout=PIPE).communicate() | 463,033 |
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 ... | def source_from_xml(xsource): ret = dict([('rawurl', False), ('url', False)]) for key, tag in [('groups', 'Group'), ('components', 'Component'), ('arches', 'Arch'), ('blacklist', 'Blacklist'), ('whitelist', 'Whitelist')]: ret[key] = [item.text for item in xsource.findall(tag)] # version and component need to both conta... | 463,034 |
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... | def __init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, whitelist, 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.bla... | 463,035 |
def resolve_requirement(self, metadata, requirement, packages, debug=False): '''Resolve requirement to packages and or additional requirements | def resolve_requirement(self, metadata, requirement, packages, debug=False): '''Resolve requirement to packages and or additional requirements | 463,036 |
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.... | def __init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, whitelist, 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.base... | 463,037 |
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.... | def __init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, recommended): Source.__init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, whitelist, recommended) if not self.rawurl: self.baseurl = self.url + '%(version)s/%(component)s/%(arch)s/' else: self.base... | 463,038 |
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... | def __init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, whitelist, 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:... | 463,039 |
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... | def __init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, recommended): Source.__init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, whitelist, recommended) if not self.rawurl: self.cachefile = self.escape_url(self.url + '@' + self.version) + '.data' else:... | 463,040 |
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... | 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'].META['PATH_INFO'] total_pages = int(context['total_pages']) records_per_page = int(context['re... | 463,041 |
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... | def filter_navigator(context): try: path = context['request'].META['PATH_INFO'] 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: ... | 463,042 |
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 ... | def render(self, context): link = '#' try: path = context['request'].META['PATH_INFO'] 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 # The... | 463,043 |
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... | 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... | 463,044 |
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... | 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... | 463,045 |
def Install(self, packages, states): ''' Pacman Install ''' pkgline = "" for pkg in packages: pkgline += " " + pkg.get('name') | def Install(self, packages, states): ''' Pacman Install ''' pkgline = "" for pkg in packages: pkgline += " " + pkg.get('name') | 463,046 |
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... | def RefreshPackages(self): '''Refresh memory hashes of packages''' ret, cache = self.cmd.run("equery -q list") if ret == 2: 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.... | 463,047 |
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 | 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 | 463,048 |
def Install(self, packages, states): ''' Pacman Install ''' pkgline = "" for pkg in packages: pkgline += " " + pkg.get('name') | def Install(self, packages, states): ''' Pacman Install ''' pkgline = "" for pkg in packages: pkgline += " " + pkg.get('name') | 463,049 |
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... | def build_yname(pkgname, inst): """Build yum appropriate package name.""" d = {} d['name'] = 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 i... | 463,050 |
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... | def build_yname(pkgname, inst): """Build yum appropriate package name.""" ypname = pkgname if inst.get('version') != 'any': d['version'] = inst.get('version') if inst.get('epoch', False): ypname += "%s:" % inst.get('epoch') if inst.get('version', False) and inst.get('version') != 'any': ypname += "%s" % (inst.get('vers... | 463,051 |
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... | def build_yname(pkgname, inst): """Build yum appropriate package name.""" ypname = pkgname if inst.get('version') != 'any': ypname += '-' if inst.get('epoch', False): d['epoch'] = inst.get('epoch') if inst.get('release', False) and inst.get('release') != 'any': ypname += "-%s" % (inst.get('release')) if inst.get('arch'... | 463,052 |
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... | 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... | 463,053 |
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... | 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... | 463,054 |
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. | 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. | 463,055 |
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. | 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. | 463,056 |
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. | 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. | 463,057 |
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. | 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. | 463,058 |
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. | 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. | 463,059 |
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. | 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. | 463,060 |
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. | 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. | 463,061 |
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. | 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. | 463,062 |
def RemovePackages(self, packages): """ Remove specified entries. | def RemovePackages(self, packages): """ Remove specified entries. | 463,063 |
def RemovePackages(self, packages): """ Remove specified entries. | def RemovePackages(self, packages): """ Remove specified entries. | 463,064 |
def RemovePackages(self, packages): """ Remove specified entries. | def RemovePackages(self, packages): """ Remove specified entries. | 463,065 |
def close_request(self, request): request.unwrap() request.shutdown(2) request.close() | def close_request(self, request): request.unwrap() request.close() | 463,066 |
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 | def get_vpkgs(self, metadata): rv = Source.get_vpkgs(self, metadata) for arch, fmdata in self.filemap.iteritems(): if arch not in metadata.groups and arch != 'global': continue for filename, pkgs in fmdata.iteritems(): rv[filename] = pkgs return rv | 463,067 |
def VerifyService(self, entry, _): '''Verify Service status for entry | def VerifyService(self, entry, _): '''Verify Service status for entry | 463,068 |
def __init__(self, logger): self.logger = logger | def __init__(self, logger): self.logger = logger | 463,069 |
def __init__(self, logger): self.logger = logger | def __init__(self, logger): self.logger = logger | 463,070 |
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 | 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 | 463,071 |
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(\ ... | 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(\ ... | 463,072 |
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... | 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... | 463,073 |
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... | 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... | 463,074 |
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... | 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.META['PATH_INFO']) kw['year'] = "%0.... | 463,075 |
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... | defresolve_client(self,addresspair):'''LookupaddresslocallyorinDNStogetahostname'''#printself.session_cacheifaddresspairinself.session_cache:(stamp,uuid)=self.session_cache[addresspair]iftime.time()-stamp<90:returnself.session_cache[addresspair][1]address=addresspair[0]ifaddressinself.addresses:iflen(self.addresses[add... | 463,076 |
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... | 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... | 463,077 |
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... | 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... | 463,078 |
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... | 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] == '/': return epath = "".join([self.data, self.handles[event.requestID], event.filename... | 463,079 |
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... | 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... | 463,080 |
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... | 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 = self.CAs[ca]['config'] days = self.cert_specs[entry.get('name'... | 463,081 |
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... | 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... | 463,082 |
def __init__(self, logger): self.logger = logger | def __init__(self, logger): self.logger = logger | 463,083 |
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... | 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.tag == 'Path' and \ entry.get('type') == 'ignore' ] self.instance_status = {} self.extra_instances ... | 463,084 |
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... | 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 = co... | 463,085 |
def canVerify(self, entry): """Test if entry has enough information to be verified.""" if not self.handlesEntry(entry): return False | defcanVerify(self,entry):"""Testifentryhasenoughinformationtobeverified."""ifnotself.handlesEntry(entry):returnFalse | 463,086 |
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) | 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) | 463,087 |
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) | 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) | 463,088 |
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) | 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) | 463,089 |
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'))[... | 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'))[... | 463,090 |
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'))[... | 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'))[... | 463,091 |
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'))[... | 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'))[... | 463,092 |
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... | 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... | 463,093 |
def queuePkg(pkg, inst, queue): if pkg.get('name') == 'gpg-pubkey': gpg_keys.append(inst) else: queue.append(inst) | def queuePkg(pkg, inst, queue): if pkg.get('name') == 'gpg-pubkey': gpg_keys.append(inst) else: queue.append(inst) | 463,094 |
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... | 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.META['PATH_INFO']) kw['year'] = "%0.... | 463,095 |
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... | 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... | 463,096 |
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) "... | 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) "... | 463,097 |
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]] | 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]] | 463,098 |
def is_package(self, _, pkg): return pkg in self.pkgnames | def is_package(self, _, pkg): return pkg in self.pkgnames | 463,099 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.