diff options
-rw-r--r-- | cloudinit/config/cc_ubuntu_advantage.py | 2 | ||||
-rw-r--r-- | tests/unittests/config/test_cc_ubuntu_advantage.py | 24 | ||||
-rw-r--r-- | tools/.github-cla-signers | 1 |
3 files changed, 20 insertions, 7 deletions
diff --git a/cloudinit/config/cc_ubuntu_advantage.py b/cloudinit/config/cc_ubuntu_advantage.py index 413fd3c1..9239f7de 100644 --- a/cloudinit/config/cc_ubuntu_advantage.py +++ b/cloudinit/config/cc_ubuntu_advantage.py @@ -137,7 +137,7 @@ def configure_ua(token=None, enable=None): enable_errors = [] for service in enable: try: - cmd = ["ua", "enable", service] + cmd = ["ua", "enable", "--assume-yes", service] subp.subp(cmd, capture=True) except subp.ProcessExecutionError as e: enable_errors.append((service, e)) diff --git a/tests/unittests/config/test_cc_ubuntu_advantage.py b/tests/unittests/config/test_cc_ubuntu_advantage.py index d7519a1b..c39e421f 100644 --- a/tests/unittests/config/test_cc_ubuntu_advantage.py +++ b/tests/unittests/config/test_cc_ubuntu_advantage.py @@ -63,7 +63,9 @@ class TestConfigureUA(CiTestCase): """all services should be enabled and then any failures raised""" def fake_subp(cmd, capture=None): - fail_cmds = [["ua", "enable", svc] for svc in ["esm", "cc"]] + fail_cmds = [ + ["ua", "enable", "--assume-yes", svc] for svc in ["esm", "cc"] + ] if cmd in fail_cmds and capture: svc = cmd[-1] raise subp.ProcessExecutionError( @@ -78,9 +80,15 @@ class TestConfigureUA(CiTestCase): m_subp.call_args_list, [ mock.call(["ua", "attach", "SomeToken"]), - mock.call(["ua", "enable", "esm"], capture=True), - mock.call(["ua", "enable", "cc"], capture=True), - mock.call(["ua", "enable", "fips"], capture=True), + mock.call( + ["ua", "enable", "--assume-yes", "esm"], capture=True + ), + mock.call( + ["ua", "enable", "--assume-yes", "cc"], capture=True + ), + mock.call( + ["ua", "enable", "--assume-yes", "fips"], capture=True + ), ], ) self.assertIn( @@ -118,7 +126,9 @@ class TestConfigureUA(CiTestCase): m_subp.call_args_list, [ mock.call(["ua", "attach", "SomeToken"]), - mock.call(["ua", "enable", "fips"], capture=True), + mock.call( + ["ua", "enable", "--assume-yes", "fips"], capture=True + ), ], ) self.assertEqual( @@ -135,7 +145,9 @@ class TestConfigureUA(CiTestCase): m_subp.call_args_list, [ mock.call(["ua", "attach", "SomeToken"]), - mock.call(["ua", "enable", "fips"], capture=True), + mock.call( + ["ua", "enable", "--assume-yes", "fips"], capture=True + ), ], ) self.assertEqual( diff --git a/tools/.github-cla-signers b/tools/.github-cla-signers index aed7b4d0..e4b64b0d 100644 --- a/tools/.github-cla-signers +++ b/tools/.github-cla-signers @@ -33,6 +33,7 @@ holmanb impl irishgordo izzyleung +j5awry Jille JohnKepplers johnsonshi |