Ejemplo n.º 1
0
 def _test_connect(self):
     auth_ret = uploadLib.call(self.server.packages.test_login, self.username, self.password)
     if auth_ret == 1:
         test_auth = "Passed"
     else:
         test_auth = "Failed"
     print "Testing connection and authentication:   %s" % test_auth
Ejemplo n.º 2
0
 def _test_connect(self):
     auth_ret = uploadLib.call(self.server.packages.test_login,
                               self.username, self.password)
     if auth_ret == 1:
         test_auth = "Passed"
     else:
         test_auth = "Failed"
     print "Testing connection and authentication:   %s" % test_auth
Ejemplo n.º 3
0
                # Don't bother to add the package if
                # no channel was specified or a source rpm was passed
                channel_packages.append(ret)

        #self.channels is never None, it always has at least one entry with an empty string.
        if len(self.channels) == 1 and self.channels[0] == '':
            return
        info = {'packages': channel_packages, 'channels': self.channels}
        if self.orgId == '' or self.orgId > 0:
            info['orgId'] = self.orgId

        #2/3/06 wregglej 173287 Added check to see if we can use session tokens.
        if channel_packages:
            self.authenticate()
            uploadLib.call(
                self.server.packages.channelPackageSubscriptionBySession,
                self.session.getSessionString(), info)
        return 0

    # does an existance check of the packages to be uploaded and returns their checksum and other info
    def check_package_exists(self):
        self.warn(
            2,
            "Computing checksum and package info. This may take some time ...")
        pkg_hash = {}
        digest_hash = {}

        for pkg in self.files:
            pkg_info = {}
            pkg_key = (pkg.strip()).split('/')[-1]
Ejemplo n.º 4
0
                channel_packages.append(ret)

        # self.channels is never None, it always has at least one entry with an empty string.
        if len(self.channels) == 1 and self.channels[0] == "":
            return
        info = {"packages": channel_packages, "channels": self.channels}
        if self.orgId == "" or self.orgId > 0:
            info["orgId"] = self.orgId

        # 2/3/06 wregglej 173287 Added check to see if we can use session tokens.
        if channel_packages:
            if self.new_sat_test():
                # 12/22/05 wregglej 173287  Changed the XMLRPC function to the new session-based one.
                self.authenticate()
                uploadLib.call(
                    self.server.packages.channelPackageSubscriptionBySession, self.session.getSessionString(), info
                )
            else:
                uploadLib.call(self.server.packages.channelPackageSubscription, self.username, self.password, info)
        return 0

    # does an existance check of the packages to be uploaded and returns their checksum and other info
    def check_package_exists(self):
        self.warn(2, "Computing checksum and package info. This may take some time ...")
        pkg_hash = {}
        digest_hash = {}

        for pkg in self.files:
            pkg_info = {}
            pkg_key = (pkg.strip()).split("/")[-1]