Imported Upstream version 4.3.1
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python3
|
||||
#! /usr/bin/python2
|
||||
|
||||
# Authors:
|
||||
# Petr Viktorin <pviktori@redhat.com>
|
||||
@@ -21,23 +21,23 @@
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import logging
|
||||
import sys
|
||||
import os
|
||||
import argparse
|
||||
|
||||
from ipapython.ipa_log_manager import standard_logging_setup
|
||||
from ipatests.pytest_ipa.integration import config
|
||||
from ipatests.pytest_ipa.integration import tasks
|
||||
from ipatests.pytest_ipa.integration.host import Host
|
||||
from ipatests.pytest_ipa.integration import collect_logs
|
||||
from ipapython.ipa_log_manager import log_mgr, standard_logging_setup
|
||||
from ipatests.test_integration import config
|
||||
from ipatests.test_integration import tasks
|
||||
from ipatests.test_integration.host import Host
|
||||
from ipatests.pytest_plugins.integration import collect_logs
|
||||
|
||||
try:
|
||||
from pytest_beakerlib import BeakerLibProcess
|
||||
except ImportError:
|
||||
BeakerLibProcess = None
|
||||
|
||||
logger = logging.getLogger(os.path.basename(__file__))
|
||||
|
||||
log = log_mgr.get_logger(__name__)
|
||||
|
||||
|
||||
class TaskRunner(object):
|
||||
@@ -333,37 +333,36 @@ class TaskRunner(object):
|
||||
|
||||
def install_master(self, args):
|
||||
master = self.get_host(args.host, default=args.domain.master)
|
||||
logger.info('Installing master %s', master.hostname)
|
||||
log.info('Installing master %s', master.hostname)
|
||||
tasks.install_master(master)
|
||||
|
||||
def install_replica(self, args):
|
||||
replica = self.get_host(args.replica)
|
||||
master = self.get_host(args.master, default=args.domain.master)
|
||||
logger.info('Installing replica %s from %s',
|
||||
replica.hostname, master.hostname)
|
||||
log.info('Installing replica %s from %s',
|
||||
replica.hostname, master.hostname)
|
||||
tasks.install_replica(master, replica)
|
||||
|
||||
def install_client(self, args):
|
||||
client = self.get_host(args.client)
|
||||
master = self.get_host(args.master, default=args.domain.master)
|
||||
logger.info('Installing client %s on %s',
|
||||
client.hostname, master.hostname)
|
||||
log.info('Installing client %s on %s', client.hostname, master.hostname)
|
||||
tasks.install_client(master, client)
|
||||
|
||||
def uninstall_master(self, args):
|
||||
default_hosts = [args.domain.master] + args.domain.replicas
|
||||
hosts = self.get_hosts(args.host, default=default_hosts)
|
||||
logger.info('Uninstalling masters: %s', [h.hostname for h in hosts])
|
||||
log.info('Uninstalling masters: %s', [h.hostname for h in hosts])
|
||||
for master in hosts:
|
||||
logger.info('Uninstalling %s', master.hostname)
|
||||
log.info('Uninstalling %s', master.hostname)
|
||||
tasks.uninstall_master(master)
|
||||
|
||||
def uninstall_client(self, args):
|
||||
default_hosts = args.domain.clients
|
||||
hosts = self.get_hosts(args.host, default=default_hosts)
|
||||
logger.info('Uninstalling clients: %s', [h.hostname for h in hosts])
|
||||
log.info('Uninstalling clients: %s', [h.hostname for h in hosts])
|
||||
for client in hosts:
|
||||
logger.info('Uninstalling %s', client.hostname)
|
||||
log.info('Uninstalling %s', client.hostname)
|
||||
tasks.uninstall_client(client)
|
||||
|
||||
def uninstall_all(self, args):
|
||||
@@ -373,9 +372,9 @@ class TaskRunner(object):
|
||||
def cleanup(self, args):
|
||||
default_hosts = args.domain.hosts
|
||||
hosts = self.get_hosts(args.host, default=default_hosts)
|
||||
logger.info('Cleaning up hosts: %s', [h.hostname for h in hosts])
|
||||
log.info('Cleaning up hosts: %s', [h.hostname for h in hosts])
|
||||
for host in hosts:
|
||||
logger.info('Cleaning up %s', host.hostname)
|
||||
log.info('Cleaning up %s', host.hostname)
|
||||
tasks.unapply_fixes(host)
|
||||
|
||||
def connect_replica(self, args):
|
||||
@@ -403,7 +402,7 @@ class TaskRunner(object):
|
||||
|
||||
def install_adtrust(self, args):
|
||||
master = self.get_host(args.host, default=args.domain.master)
|
||||
logger.info('Configuring AD trust support on %s', master.hostname)
|
||||
log.info('Configuring AD trust support on %s', master.hostname)
|
||||
tasks.install_adtrust(master)
|
||||
|
||||
def configure_dns_for_trust(self, args):
|
||||
@@ -453,4 +452,4 @@ class TaskRunner(object):
|
||||
tasks.add_a_record(master, host)
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(TaskRunner().main(sys.argv[1:]))
|
||||
exit(TaskRunner().main(sys.argv[1:]))
|
||||
|
||||
Reference in New Issue
Block a user