Ejemplo n.º 1
0
    def __init__(self, api_url=None, candlepin_url=None, portal_url=None, login='******', password='******', maxtries=40, insecure=None, configfile=None, candlepin_port=443):
        BasePortal.__init__(self, login, password, maxtries, insecure, api_url, portal_url, configfile)

        self.candlepin_port = candlepin_port

        if candlepin_url is not None:
            self.candlepin_url = candlepin_url
        else:
            try:
                self.candlepin_url = self.config.get('subman', 'candlepin')
            except:
                self.logger.debug("Failed to get 'subman/candlepin' setting from config file")
                self.candlepin_url = None

        if self.candlepin_url:
            self.candlepin_url = self.candlepin_url.replace("https://", "")

        self.con = connection.UEPConnection(self.candlepin_url, ssl_port=self.candlepin_port, username=self.login, password=self.password, insecure=self.insecure)
Ejemplo n.º 2
0
    def __init__(
        self,
        xmlrpc_url=None,
        login="******",
        password="******",
        maxtries=40,
        insecure=None,
        webui_url=None,
        api_url=None,
        portal_url=None,
        configfile=None,
    ):
        BasePortal.__init__(self, login, password, maxtries, insecure, api_url, portal_url, configfile)

        if xmlrpc_url is not None:
            self.xmlrpc_url = xmlrpc_url
        else:
            try:
                self.xmlrpc_url = self.config.get("rhn", "xmlrpc")
            except:
                self.logger.debug("Failed to get 'rhn/xmlrpc' setting from config file")
                self.xmlrpc_url = None

        if webui_url is not None:
            self.webui_url = webui_url
        else:
            try:
                self.webui_url = self.config.get("rhn", "webui")
            except:
                self.logger.debug("Failed to get 'rhn/webui' setting from config file")
                self.webui_url = None

        self.rpc = rpclib.Server(self.xmlrpc_url)
        self.rpc_api = rpclib.Server(self.xmlrpc_url.replace("/XMLRPC", "/rpc/api"))
        self.systems = {}
        if self.webui_url is None:
            self.webui_url = self.xmlrpc_url
            self.webui_url = self.webui_url.replace("/XMLRPC", "")
            self.webui_url = self.webui_url.replace("http://xmlrpc.", "http://")
            self.webui_url = self.webui_url.replace("https://xmlrpc.", "https://")