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)
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)
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")
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 #print >> sys.stderr, 'server information: %s, %s, %s, %s' % \ # (host, port, scheme, path) self._server = server.KatelloServer(host, int(port), scheme, path) server.set_active_server(self._server)
def __init__(self): self.orgapi = OrganizationAPI() self.systemapi = SystemAPI() self.userapi = UserAPI() self.envapi = EnvironmentAPI() self.rolesapi = UserRoleAPI() self.permissionapi = PermissionAPI() self.distributorapi = DistributorAPI() self.provapi = ProviderAPI() self.infoapi = CustomInfoAPI() s = server.KatelloServer(CONFIG.get("katello", "hostname"), CONFIG.get("katello", "port"), CONFIG.get("katello", "proto"), CONFIG.get("katello", "api_url")) s.set_auth_method(BasicAuthentication(CONFIG.get("katello", "admin_user"), CONFIG.get("katello", "admin_pass"))) server.set_active_server(s)
def __init__(self): self.systemapi = SystemAPI() s = server.KatelloServer("10.3.11.129", "443", "https", "/sam") s.set_auth_method(BasicAuthentication('admin', 'admin')) server.set_active_server(s)
def init_server(): proto, host, path, port = parse_server(opts.url) s = server.KatelloServer(host, port, proto, path) s.set_auth_method(BasicAuthentication(opts.username, opts.password)) server.set_active_server(s)
p.add_option("-p", "--pass", dest="password", help="Password, default = admin", default="admin") p.add_option( "-n", "--num", dest="maxsystems", help="The maximum number of systems to create, default = 1", default=1 ) p.add_option( "-o", "--org", dest="org", help="Organization to use. Default = ACME_Corporation", default="ACME_Corporation" ) p.add_option("-e", "--env", dest="env", help="Environment to use. Default = DEV", default="DEV") 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) envid = process_environment(opts.org, opts.env) manager = Manager() maxconnections = 4 sem = manager.BoundedSemaphore(maxconnections) pool = Pool(processes=maxconnections * 2) for i in range(int(opts.maxsystems)): if opts.debug: print "Starting thread: [%s] for loadig systems" % i pool.apply_async(create_subscribed_systems, args=(opts.org, envid, sem)) pool.close() pool.join()
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) except Exception, e: sys.stderr.write("Error: An exception occurred %s" % e)