示例#1
0
    def getObsoletes(self, version):
        """ Returns a list of packages that obsolete other packages """
        log_debug(3, self.channelName, version)
        # Check to see if the version they are requesting is the latest

        # check the validity of what the client thinks about this channel
        # or blow up
        self.__check_channel(version)

        obsoletes = rhnChannel.list_obsoletes(self.channelName)

        # Set the transport options
        transportOptions = rhnFlags.get('outputTransportOptions')
        transportOptions['Last-Modified'] = rfc822time(timestamp(version))
        rhnFlags.set("compress_response", 1)
        return obsoletes
示例#2
0
    def getObsoletes(self, version):
        """ Returns a list of packages that obsolete other packages """
        log_debug(3, self.channelName, version)
        # Check to see if the version they are requesting is the latest

        # check the validity of what the client thinks about this channel
        # or blow up
        self.__check_channel(version)

        obsoletes = rhnChannel.list_obsoletes(self.channelName)

        # Set the transport options
        transportOptions = rhnFlags.get('outputTransportOptions')
        transportOptions['Last-Modified'] = rfc822time(timestamp(version))
        rhnFlags.set("compress_response", 1)
        return obsoletes
示例#3
0
    print rhnChannel.channels_for_release_arch('2.1AS', 'athlon-redhat-linux', user_id=575937)
    print rhnChannel.channels_for_release_arch('2.1AS', 'XXXX-redhat-linux', user_id=575937)
    # mibanescu-2
#    print rhnChannel.channels_for_release_arch('9', 'i386-redhat-linux', user_id=2012148)
    # mibanescu-plain
    print rhnChannel.channels_for_release_arch('2.1AS', 'athlon-redhat-linux', user_id=2825619)
    sys.exit(1)

    channel = "redhat-linux-i386-7.1"

    start = time.time()
    ret = rhnChannel.list_packages(channel)
    print "Took %.2f seconds to list %d packages in %s" % (
        time.time() - start, len(ret), channel)
    # pprint.pprint(ret)

    start = time.time()
    ret = rhnChannel.list_obsoletes(channel)
    print "Took %.2f seconds to list %d obsoletes in %s" % (
        time.time() - start, len(ret), channel)
    # pprint.pprint(ret)

    server_id = 1002156837
    channels = rhnChannel.channels_for_server(server_id)

    s = rhnServer.search(server_id)
    s.change_base_channel("2.1AS-foobar")
    print map(lambda x: x['label'], channels)
    print map(lambda x: x['label'], rhnChannel.channels_for_server(server_id))
    rhnSQL.commit()