Move STRICT_SUDO overwrite into main()
The overwrite causes issues when running pytest, because the state is
maintained and carried into other tests.
Address this by moving the overwrite from the top level into main().
BUG=chromium:1061555
TEST=pytest, run_tests
Change-Id: I2b2090d57be544963c09996b7088c8829ad09611
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2103153
Tested-by: Greg Edelston <gredelston@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Greg Edelston <gredelston@google.com>
diff --git a/scripts/cros_sdk.py b/scripts/cros_sdk.py
index 48d8e67..2381760 100644
--- a/scripts/cros_sdk.py
+++ b/scripts/cros_sdk.py
@@ -41,8 +41,6 @@
from chromite.utils import key_value_store
-cros_build_lib.STRICT_SUDO = True
-
COMPRESSION_PREFERENCE = ('xz', 'bz2')
# TODO(zbehan): Remove the dependency on these, reimplement them in python
@@ -850,6 +848,8 @@
def main(argv):
+ # Turn on strict sudo checks.
+ cros_build_lib.STRICT_SUDO = True
conf = key_value_store.LoadFile(
os.path.join(constants.SOURCE_ROOT, constants.SDK_VERSION_FILE),
ignore_missing=True)