Ejemplo n.º 1
0
    def setup_server(self):
        """
        Setup the active server connection.
        """
        host = self.opts.host
        port = self.opts.port
        scheme = self.opts.scheme
        path = self.opts.path

        self._server = server.KatelloServer(host, int(port), scheme, path)
        server.set_active_server(self._server)
Ejemplo n.º 2
0
 def __init__(self):
     self.systemapi = SystemAPI()
     self._load_config()
     logger.info("connecting to %s://%s:%s%s" % (self.kt_scheme, self.kt_host, self.kt_port, self.kt_path))
     s = server.KatelloServer(self.kt_host, self.kt_port, self.kt_scheme, self.kt_path)
     s.set_auth_method(BasicAuthentication(self.kt_username, self.kt_password))
     server.set_active_server(s)
     if self.autoregister_hypervisors:
         logger.info("hypervisor autoregistration is enabled")
     else:
         logger.info("hypervisor autoregistration is disabled")
Ejemplo n.º 3
0
    def __init__(self,
                 host,
                 project='/katello/',
                 username='******',
                 password='******',
                 port=443):
        """
        Initiates a session to the provided host, using credentials.
        """

        s = server.KatelloServer(host=host, path_prefix=project, port=port)
        s.set_auth_method(BasicAuthentication(username, password))
        server.set_active_server(s)
Ejemplo n.º 4
0
                 '--random',
                 action='store_true',
                 dest='randomize',
                 help='Will randomly select and attempt subscription',
                 default=False)
    p.add_option('-d',
                 '--debug',
                 action='store_true',
                 dest='debug',
                 help='Enable Debug',
                 default=False)

    (opts, args) = p.parse_args()

    proto, host, path, port = parse_url(opts.url)
    s = server.KatelloServer(host, port, proto, path)
    s.set_auth_method(BasicAuthentication(opts.username, opts.password))
    server.set_active_server(s)

    if opts.randomize:
        print """
        ====================================================
        You have opted to allow the program to randomly 
        select a subscription from all available.  This 
        can increase run time as the application will 
        have to work harder to find a suitable subscription.
        ====================================================
        """
    try:
        envid = process_environment(opts.org, opts.env)
        pool_ids = get_pool_ids(opts.org)