autotest: Force skylab in commands
Force CLI commands to use skylab.
The --skylab flag is not removed in case some users are still passing it.
BUG=chromium:1033823
TEST=None
Change-Id: I4fb74d76ebd41d19780e85db02c46645fba92872
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2129139
Commit-Queue: Allen Li <[email protected]>
Tested-by: Allen Li <[email protected]>
Reviewed-by: Gregory Nisbet <[email protected]>
diff --git a/cli/topic_common.py b/cli/topic_common.py
index 0416484..1c85713 100644
--- a/cli/topic_common.py
+++ b/cli/topic_common.py
@@ -451,17 +451,18 @@
dest='log_level')
- def add_skylab_options(self, enforce_skylab=False):
- """Add options for reading and writing skylab inventory repository."""
+ def add_skylab_options(self, enforce_skylab=True):
+ """Add options for reading and writing skylab inventory repository.
+
+ The enforce_skylab parameter does nothing and is kept for compatibility.
+ """
self.allow_skylab = True
- self.enforce_skylab = enforce_skylab
+ self.enforce_skylab = True
self.parser.add_option('--skylab',
- help=('Use the skylab inventory as the data '
- 'source. Default to %s.' %
- self.enforce_skylab),
- action='store_true', dest='skylab',
- default=self.enforce_skylab)
+ help='Deprecated',
+ action='store_const', dest='skylab',
+ const=True)
self.parser.add_option('--env',
help=('Environment ("prod" or "staging") of the '
'machine. Default to "prod". %s' %
@@ -525,9 +526,7 @@
@param: options: Option values parsed by the parser.
"""
- self.skylab = options.skylab
- if not self.skylab:
- return
+ self.skylab = True
# TODO(nxia): crbug.com/837831 Add skylab_inventory to
# autotest-server-deps ebuilds to remove the ImportError check.