diff options
author | Shreenidhi Shedi <53473811+sshedi@users.noreply.github.com> | 2022-01-13 01:22:32 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-12 13:52:32 -0600 |
commit | e3f3485d875f021915654bf2b64678e151a8d6f6 (patch) | |
tree | 564f89b77371edb01d20164758a073f56da45ea0 /tests | |
parent | 88f38158fd432152b9fe341f270c4f52c657ef80 (diff) | |
download | vyos-cloud-init-e3f3485d875f021915654bf2b64678e151a8d6f6.tar.gz vyos-cloud-init-e3f3485d875f021915654bf2b64678e151a8d6f6.zip |
Remove distutils usage (#1177)
distutils is getting deprecated soon. Let's replace it with suggested
alternatives as suggested in:
https://www.python.org/dev/peps/pep-0632/
Remove `requests` version check and related code from url_helper.py
as the versions specified are old enough to no longer be relevant.
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration_tests/integration_settings.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/integration_tests/integration_settings.py b/tests/integration_tests/integration_settings.py index 641ce297..02037a88 100644 --- a/tests/integration_tests/integration_settings.py +++ b/tests/integration_tests/integration_settings.py @@ -1,6 +1,7 @@ # This file is part of cloud-init. See LICENSE file for license information. import os -from distutils.util import strtobool + +from cloudinit.util import is_false, is_true ################################################################## # LAUNCH SETTINGS @@ -126,8 +127,9 @@ for setting in current_settings: "CLOUD_INIT_{}".format(setting), globals()[setting] ) if isinstance(env_setting, str): - try: - env_setting = bool(strtobool(env_setting.strip())) - except ValueError: - pass + env_setting = env_setting.strip() + if is_true(env_setting): + env_setting = True + elif is_false(env_setting): + env_setting = False globals()[setting] = env_setting |