summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorshoward <showard@592f7852-d20e-0410-864c-8624ca9c26a4>2009-08-20 23:42:44 +0000
committershoward <showard@592f7852-d20e-0410-864c-8624ca9c26a4>2009-08-20 23:42:44 +0000
commitc455b86151861887a1cf03d9090f2f327673fc53 (patch)
treedec3563012aed01725ca0998676bfc96e9214563 /cli
parent15fa81714864dd452379aa80861aee066e9c855b (diff)
Remove the ability for host status to be modified via the frontend.
This interferes with the monitor_db scheduler as it owns the field. Signed-off-by: Gregory Smith <gps@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@3584 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'cli')
-rwxr-xr-xcli/host.py16
-rwxr-xr-xcli/host_unittest.py28
2 files changed, 23 insertions, 21 deletions
diff --git a/cli/host.py b/cli/host.py
index 94c2016c..34130dbf 100755
--- a/cli/host.py
+++ b/cli/host.py
@@ -299,13 +299,13 @@ class host_jobs(host):
print '-'*5
print 'Hostname: %s' % host
self.print_table(jobs, keys_header=['job_id',
- 'job_owner',
- 'job_name',
- 'status'])
+ 'job_owner',
+ 'job_name',
+ 'status'])
class host_mod(host):
- """atest host mod --lock|--unlock|--ready
+ """atest host mod --lock|--unlock|--protection
--mlist <file>|<hosts>"""
usage_action = 'mod'
@@ -314,9 +314,6 @@ class host_mod(host):
self.data = {}
self.messages = []
super(host_mod, self).__init__()
- self.parser.add_option('-y', '--ready',
- help='Mark this host ready',
- action='store_true')
self.parser.add_option('-l', '--lock',
help='Lock hosts',
action='store_true')
@@ -337,12 +334,9 @@ class host_mod(host):
self._parse_lock_options(options)
- if options.ready:
- self.data['status'] = 'Ready'
- self.messages.append('Set status to Ready for host')
-
if options.protection:
self.data['protection'] = options.protection
+ self.messages.append('Protection set to "%s"' % options.protection)
if len(self.data) == 0:
self.invalid_syntax('No modification requested')
diff --git a/cli/host_unittest.py b/cli/host_unittest.py
index e64477f4..f6436c2d 100755
--- a/cli/host_unittest.py
+++ b/cli/host_unittest.py
@@ -1231,26 +1231,34 @@ class host_mod_unittest(cli_mock.cli_unittest):
err_words_ok=['Host', 'matching', 'query', 'host1'])
- def test_execute_ready_hosts(self):
+ def test_execute_protection_hosts(self):
mfile = cli_mock.create_file('host0\nhost1,host2\nhost3 host4')
- self.run_cmd(argv=['atest', 'host', 'mod', '--ready',
+ self.run_cmd(argv=['atest', 'host', 'mod', '--protection',
+ 'Do not repair',
'host5' ,'--mlist', mfile.name, 'host1', 'host6',
'--ignore_site_file'],
- rpcs=[('modify_host', {'id': 'host6', 'status': 'Ready'},
+ rpcs=[('modify_host', {'id': 'host6',
+ 'protection': 'Do not repair'},
True, None),
- ('modify_host', {'id': 'host5', 'status': 'Ready'},
+ ('modify_host', {'id': 'host5',
+ 'protection': 'Do not repair'},
True, None),
- ('modify_host', {'id': 'host4', 'status': 'Ready'},
+ ('modify_host', {'id': 'host4',
+ 'protection': 'Do not repair'},
True, None),
- ('modify_host', {'id': 'host3', 'status': 'Ready'},
+ ('modify_host', {'id': 'host3',
+ 'protection': 'Do not repair'},
True, None),
- ('modify_host', {'id': 'host2', 'status': 'Ready'},
+ ('modify_host', {'id': 'host2',
+ 'protection': 'Do not repair'},
True, None),
- ('modify_host', {'id': 'host1', 'status': 'Ready'},
+ ('modify_host', {'id': 'host1',
+ 'protection': 'Do not repair'},
True, None),
- ('modify_host', {'id': 'host0', 'status': 'Ready'},
+ ('modify_host', {'id': 'host0',
+ 'protection': 'Do not repair'},
True, None)],
- out_words_ok=['Ready', 'host0', 'host1', 'host2',
+ out_words_ok=['Do not repair', 'host0', 'host1', 'host2',
'host3', 'host4', 'host5', 'host6'])
mfile.clean()