OLD | NEW |
1 from autotest_lib.client.common_lib import utils, error, global_config | 1 from autotest_lib.client.common_lib import utils, error, global_config |
2 from autotest_lib.server import autotest, utils as server_utils | 2 from autotest_lib.server import autotest, utils as server_utils |
3 from autotest_lib.server.hosts import site_factory, ssh_host, serial | 3 from autotest_lib.server.hosts import site_factory, ssh_host, serial |
4 from autotest_lib.server.hosts import logfile_monitor | 4 from autotest_lib.server.hosts import logfile_monitor |
5 | 5 |
6 DEFAULT_FOLLOW_PATH = '/var/log/kern.log' | 6 DEFAULT_FOLLOW_PATH = '/var/log/kern.log' |
7 DEFAULT_PATTERNS_PATH = 'console_patterns' | 7 DEFAULT_PATTERNS_PATH = 'console_patterns' |
8 SSH_ENGINE = global_config.global_config.get_config_value('AUTOSERV', | 8 SSH_ENGINE = global_config.global_config.get_config_value('AUTOSERV', |
9 'ssh_engine', | 9 'ssh_engine', |
10 type=str) | 10 type=str) |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 elif follow_paths: | 62 elif follow_paths: |
63 logfile_monitor_class = logfile_monitor.NewLogfileMonitorMixin( | 63 logfile_monitor_class = logfile_monitor.NewLogfileMonitorMixin( |
64 follow_paths, pattern_paths) | 64 follow_paths, pattern_paths) |
65 classes.append(logfile_monitor_class) | 65 classes.append(logfile_monitor_class) |
66 | 66 |
67 # do any site-specific processing of the classes list | 67 # do any site-specific processing of the classes list |
68 site_factory.postprocess_classes(classes, hostname, | 68 site_factory.postprocess_classes(classes, hostname, |
69 auto_monitor=auto_monitor, **args) | 69 auto_monitor=auto_monitor, **args) |
70 | 70 |
71 hostname, args['user'], args['password'], args['port'] = \ | 71 args['user'] = ssh_user |
72 server_utils.parse_machine(hostname, ssh_user, ssh_pass, ssh_port) | 72 args['port'] = ssh_port |
| 73 args['password'] = ssh_pass |
73 | 74 |
74 # create a custom host class for this machine and return an instance of it | 75 # create a custom host class for this machine and return an instance of it |
75 host_class = type("%s_host" % hostname, tuple(classes), {}) | 76 host_class = type("%s_host" % hostname, tuple(classes), {}) |
76 host_instance = host_class(hostname, **args) | 77 host_instance = host_class(hostname, **args) |
77 | 78 |
78 # call job_start if this is the first time this host is being used | 79 # call job_start if this is the first time this host is being used |
79 if hostname not in _started_hostnames: | 80 if hostname not in _started_hostnames: |
80 host_instance.job_start() | 81 host_instance.job_start() |
81 _started_hostnames.add(hostname) | 82 _started_hostnames.add(hostname) |
82 | 83 |
83 return host_instance | 84 return host_instance |
OLD | NEW |