diff --git a/scripts/featured b/scripts/featured index 1f812bf0..a3c91c28 100644 --- a/scripts/featured +++ b/scripts/featured @@ -26,7 +26,11 @@ PORT_INIT_TIMEOUT_SEC = 180 def run_cmd(cmd, log_err=True, raise_exception=False): try: - subprocess.check_call(cmd) + result = subprocess.run(cmd, + capture_output=True, + check=True, text=True) + syslog.syslog(syslog.LOG_INFO, "Output: {} , Stderr: {}" + .format(result.stdout, result.stderr)) except Exception as err: if log_err: syslog.syslog(syslog.LOG_ERR, "{} - failed: return code - {}, output:\n{}" diff --git a/tests/featured/featured_test.py b/tests/featured/featured_test.py index dbb3ca29..a42d2bb8 100644 --- a/tests/featured/featured_test.py +++ b/tests/featured/featured_test.py @@ -175,9 +175,9 @@ def test_sync_state_field(self, test_scenario_name, config_data, fs): feature_table_state_db_calls = self.get_state_db_set_calls(feature_table) self.checks_systemd_config_file(device_type, config_data['config_db']['FEATURE'], feature_systemd_name_map) - mocked_subprocess.check_call.assert_has_calls(config_data['enable_feature_subprocess_calls'], + mocked_subprocess.run.assert_has_calls(config_data['enable_feature_subprocess_calls'], any_order=True) - mocked_subprocess.check_call.assert_has_calls(config_data['daemon_reload_subprocess_call'], + mocked_subprocess.run.assert_has_calls(config_data['daemon_reload_subprocess_call'], any_order=True) feature_state_table_mock.set.assert_has_calls(feature_table_state_db_calls) self.checks_systemd_config_file(device_type, config_data['config_db']['FEATURE'], feature_systemd_name_map) @@ -227,9 +227,9 @@ def test_handler(self, test_scenario_name, config_data, fs): feature_systemd_name_map[feature_name] = feature_names self.checks_systemd_config_file(device_type, config_data['config_db']['FEATURE'], feature_systemd_name_map) - mocked_subprocess.check_call.assert_has_calls(config_data['enable_feature_subprocess_calls'], + mocked_subprocess.run.assert_has_calls(config_data['enable_feature_subprocess_calls'], any_order=True) - mocked_subprocess.check_call.assert_has_calls(config_data['daemon_reload_subprocess_call'], + mocked_subprocess.run.assert_has_calls(config_data['daemon_reload_subprocess_call'], any_order=True) def test_feature_config_parsing(self): @@ -375,15 +375,15 @@ def test_feature_events(self, mock_syslog, get_runtime): daemon.start(time.time()) except TimeoutError as e: pass - expected = [call(['sudo', 'systemctl', 'daemon-reload']), - call(['sudo', 'systemctl', 'unmask', 'dhcp_relay.service']), - call(['sudo', 'systemctl', 'enable', 'dhcp_relay.service']), - call(['sudo', 'systemctl', 'start', 'dhcp_relay.service']), - call(['sudo', 'systemctl', 'daemon-reload']), - call(['sudo', 'systemctl', 'unmask', 'mux.service']), - call(['sudo', 'systemctl', 'enable', 'mux.service']), - call(['sudo', 'systemctl', 'start', 'mux.service'])] - mocked_subprocess.check_call.assert_has_calls(expected) + expected = [call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'dhcp_relay.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'dhcp_relay.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'dhcp_relay.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'mux.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'mux.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'mux.service'], capture_output=True, check=True, text=True)] + mocked_subprocess.run.assert_has_calls(expected, any_order=True) # Change the state to disabled MockSelect.reset_event_queue() @@ -393,10 +393,10 @@ def test_feature_events(self, mock_syslog, get_runtime): daemon.start(time.time()) except TimeoutError: pass - expected = [call(['sudo', 'systemctl', 'stop', 'dhcp_relay.service']), - call(['sudo', 'systemctl', 'disable', 'dhcp_relay.service']), - call(['sudo', 'systemctl', 'mask', 'dhcp_relay.service'])] - mocked_subprocess.check_call.assert_has_calls(expected) + expected = [call(['sudo', 'systemctl', 'stop', 'dhcp_relay.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'disable', 'dhcp_relay.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'mask', 'dhcp_relay.service'], capture_output=True, check=True, text=True)] + mocked_subprocess.run.assert_has_calls(expected, any_order=True) def test_delayed_service(self, mock_syslog, get_runtime): MockSelect.set_event_queue([('FEATURE', 'dhcp_relay'), @@ -417,20 +417,20 @@ def test_delayed_service(self, mock_syslog, get_runtime): daemon.start(time.time()) except TimeoutError: pass - expected = [call(['sudo', 'systemctl', 'daemon-reload']), - call(['sudo', 'systemctl', 'unmask', 'dhcp_relay.service']), - call(['sudo', 'systemctl', 'enable', 'dhcp_relay.service']), - call(['sudo', 'systemctl', 'start', 'dhcp_relay.service']), - call(['sudo', 'systemctl', 'daemon-reload']), - call(['sudo', 'systemctl', 'unmask', 'mux.service']), - call(['sudo', 'systemctl', 'enable', 'mux.service']), - call(['sudo', 'systemctl', 'start', 'mux.service']), - call(['sudo', 'systemctl', 'daemon-reload']), - call(['sudo', 'systemctl', 'unmask', 'telemetry.service']), - call(['sudo', 'systemctl', 'enable', 'telemetry.service']), - call(['sudo', 'systemctl', 'start', 'telemetry.service'])] - - mocked_subprocess.check_call.assert_has_calls(expected) + expected = [call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'dhcp_relay.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'dhcp_relay.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'dhcp_relay.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'mux.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'mux.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'mux.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'telemetry.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'telemetry.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'telemetry.service'], capture_output=True, check=True, text=True)] + + mocked_subprocess.run.assert_has_calls(expected, any_order=True) def test_advanced_reboot(self, mock_syslog, get_runtime): MockRestartWaiter.advancedReboot = True @@ -442,25 +442,26 @@ def test_advanced_reboot(self, mock_syslog, get_runtime): daemon = featured.FeatureDaemon() daemon.render_all_feature_states() daemon.register_callbacks() - try: + try: daemon.start(time.time()) except TimeoutError: - pass - expected = [call(['sudo', 'systemctl', 'daemon-reload']), - call(['sudo', 'systemctl', 'unmask', 'dhcp_relay.service']), - call(['sudo', 'systemctl', 'enable', 'dhcp_relay.service']), - call(['sudo', 'systemctl', 'start', 'dhcp_relay.service']), - call(['sudo', 'systemctl', 'daemon-reload']), - call(['sudo', 'systemctl', 'unmask', 'mux.service']), - call(['sudo', 'systemctl', 'enable', 'mux.service']), - call(['sudo', 'systemctl', 'start', 'mux.service']), - call(['sudo', 'systemctl', 'daemon-reload']), - call(['sudo', 'systemctl', 'unmask', 'telemetry.service']), - call(['sudo', 'systemctl', 'enable', 'telemetry.service']), - call(['sudo', 'systemctl', 'start', 'telemetry.service'])] - - mocked_subprocess.check_call.assert_has_calls(expected) - + pass + expected = [ + call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'dhcp_relay.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'dhcp_relay.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'dhcp_relay.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'mux.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'mux.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'mux.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'telemetry.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'telemetry.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'telemetry.service'], capture_output=True, check=True, text=True)] + + mocked_subprocess.run.assert_has_calls(expected, any_order=True) + def test_portinit_timeout(self, mock_syslog, get_runtime): print(MockConfigDb.CONFIG_DB) MockSelect.NUM_TIMEOUT_TRIES = 1 @@ -479,16 +480,16 @@ def test_portinit_timeout(self, mock_syslog, get_runtime): daemon.start(0.0) except TimeoutError: pass - expected = [call(['sudo', 'systemctl', 'daemon-reload']), - call(['sudo', 'systemctl', 'unmask', 'dhcp_relay.service']), - call(['sudo', 'systemctl', 'enable', 'dhcp_relay.service']), - call(['sudo', 'systemctl', 'start', 'dhcp_relay.service']), - call(['sudo', 'systemctl', 'daemon-reload']), - call(['sudo', 'systemctl', 'unmask', 'mux.service']), - call(['sudo', 'systemctl', 'enable', 'mux.service']), - call(['sudo', 'systemctl', 'start', 'mux.service']), - call(['sudo', 'systemctl', 'daemon-reload']), - call(['sudo', 'systemctl', 'unmask', 'telemetry.service']), - call(['sudo', 'systemctl', 'enable', 'telemetry.service']), - call(['sudo', 'systemctl', 'start', 'telemetry.service'])] - mocked_subprocess.check_call.assert_has_calls(expected) + expected = [call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'dhcp_relay.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'dhcp_relay.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'dhcp_relay.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'mux.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'mux.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'mux.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'daemon-reload'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'telemetry.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'telemetry.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'telemetry.service'], capture_output=True, check=True, text=True)] + mocked_subprocess.run.assert_has_calls(expected, any_order=True) diff --git a/tests/featured/test_vectors.py b/tests/featured/test_vectors.py index b62186eb..1a5552b2 100644 --- a/tests/featured/test_vectors.py +++ b/tests/featured/test_vectors.py @@ -97,18 +97,18 @@ }, }, "enable_feature_subprocess_calls": [ - call(["sudo", "systemctl", "unmask", "dhcp_relay.service"]), - call(["sudo", "systemctl", "enable", "dhcp_relay.service"]), - call(["sudo", "systemctl", "start", "dhcp_relay.service"]), - call(["sudo", "systemctl", "unmask", "mux.service"]), - call(["sudo", "systemctl", "enable", "mux.service"]), - call(["sudo", "systemctl", "start", "mux.service"]), - call(["sudo", "systemctl", "unmask", "telemetry.service"]), - call(["sudo", "systemctl", "enable", "telemetry.service"]), - call(["sudo", "systemctl", "start", "telemetry.service"]), + call(["sudo", "systemctl", "unmask", "dhcp_relay.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "dhcp_relay.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "dhcp_relay.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "mux.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "mux.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "mux.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "telemetry.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "telemetry.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "telemetry.service"], capture_output=True, check=True, text=True), ], "daemon_reload_subprocess_call": [ - call(["sudo", "systemctl", "daemon-reload"]), + call(["sudo", "systemctl", "daemon-reload"], capture_output=True, check=True, text=True), ], "popen_attributes": { 'communicate.return_value': ('output', 'error') @@ -211,18 +211,18 @@ }, }, "enable_feature_subprocess_calls": [ - call(["sudo", "systemctl", "stop", "mux.service"]), - call(["sudo", "systemctl", "disable", "mux.service"]), - call(["sudo", "systemctl", "mask", "mux.service"]), - call(["sudo", "systemctl", "unmask", "telemetry.service"]), - call(["sudo", "systemctl", "enable", "telemetry.service"]), - call(["sudo", "systemctl", "start", "telemetry.service"]), - call(["sudo", "systemctl", "unmask", "sflow.service"]), - call(["sudo", "systemctl", "enable", "sflow.service"]), - call(["sudo", "systemctl", "start", "sflow.service"]), + call(["sudo", "systemctl", "stop", "mux.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "disable", "mux.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "mask", "mux.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "telemetry.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "telemetry.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "telemetry.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "sflow.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "sflow.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "sflow.service"], capture_output=True, check=True, text=True), ], "daemon_reload_subprocess_call": [ - call(["sudo", "systemctl", "daemon-reload"]), + call(["sudo", "systemctl", "daemon-reload"], capture_output=True, check=True, text=True), ], "popen_attributes": { 'communicate.return_value': ('output', 'error') @@ -307,15 +307,15 @@ }, }, "enable_feature_subprocess_calls": [ - call(["sudo", "systemctl", "stop", "mux.service"]), - call(["sudo", "systemctl", "disable", "mux.service"]), - call(["sudo", "systemctl", "mask", "mux.service"]), - call(["sudo", "systemctl", "unmask", "telemetry.service"]), - call(["sudo", "systemctl", "enable", "telemetry.service"]), - call(["sudo", "systemctl", "start", "telemetry.service"]), + call(["sudo", "systemctl", "stop", "mux.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "disable", "mux.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "mask", "mux.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "telemetry.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "telemetry.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "telemetry.service"], capture_output=True, check=True, text=True), ], "daemon_reload_subprocess_call": [ - call(["sudo", "systemctl", "daemon-reload"]), + call(["sudo", "systemctl", "daemon-reload"], capture_output=True, check=True, text=True), ], "popen_attributes": { 'communicate.return_value': ('output', 'error') @@ -400,18 +400,18 @@ }, }, "enable_feature_subprocess_calls": [ - call(["sudo", "systemctl", "unmask", "dhcp_relay.service"]), - call(["sudo", "systemctl", "enable", "dhcp_relay.service"]), - call(["sudo", "systemctl", "start", "dhcp_relay.service"]), - call(["sudo", "systemctl", "stop", "mux.service"]), - call(["sudo", "systemctl", "disable", "mux.service"]), - call(["sudo", "systemctl", "mask", "mux.service"]), - call(["sudo", "systemctl", "unmask", "telemetry.service"]), - call(["sudo", "systemctl", "enable", "telemetry.service"]), - call(["sudo", "systemctl", "start", "telemetry.service"]), + call(["sudo", "systemctl", "unmask", "dhcp_relay.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "dhcp_relay.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "dhcp_relay.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "stop", "mux.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "disable", "mux.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "mask", "mux.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "telemetry.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "telemetry.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "telemetry.service"], capture_output=True, check=True, text=True), ], "daemon_reload_subprocess_call": [ - call(["sudo", "systemctl", "daemon-reload"]), + call(["sudo", "systemctl", "daemon-reload"], capture_output=True, check=True, text=True), ], "popen_attributes": { 'communicate.return_value': ('output', 'error') @@ -498,7 +498,7 @@ }, "enable_feature_subprocess_calls": [], "daemon_reload_subprocess_call": [ - call(["sudo", "systemctl", "daemon-reload"]), + call(["sudo", "systemctl", "daemon-reload"], capture_output=True, check=True, text=True), ], "popen_attributes": { 'communicate.return_value': ('enabled', 'error') @@ -595,16 +595,16 @@ }, }, "enable_feature_subprocess_calls": [ - call(["sudo", "systemctl", "stop", "bgp.service"]), - call(["sudo", "systemctl", "disable", "bgp.service"]), - call(["sudo", "systemctl", "mask", "bgp.service"]), - call(["sudo", "systemctl", "unmask", "syncd.service"]), - call(["sudo", "systemctl", "enable", "syncd.service"]), - call(["sudo", "systemctl", "start", "syncd.service"]), + call(["sudo", "systemctl", "stop", "bgp.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "disable", "bgp.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "mask", "bgp.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "syncd.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "syncd.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "syncd.service"], capture_output=True, check=True, text=True), ], "daemon_reload_subprocess_call": [ - call(["sudo", "systemctl", "daemon-reload"]), + call(["sudo", "systemctl", "daemon-reload"], capture_output=True, check=True, text=True), ], "popen_attributes": { 'communicate.return_value': ('output', 'error') @@ -701,16 +701,16 @@ }, }, "enable_feature_subprocess_calls": [ - call(["sudo", "systemctl", "stop", "bgp.service"]), - call(["sudo", "systemctl", "disable", "bgp.service"]), - call(["sudo", "systemctl", "mask", "bgp.service"]), - call(["sudo", "systemctl", "unmask", "syncd.service"]), - call(["sudo", "systemctl", "enable", "syncd.service"]), - call(["sudo", "systemctl", "start", "syncd.service"]), + call(["sudo", "systemctl", "stop", "bgp.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "disable", "bgp.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "mask", "bgp.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "syncd.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "syncd.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "syncd.service"], capture_output=True, check=True, text=True), ], "daemon_reload_subprocess_call": [ - call(["sudo", "systemctl", "daemon-reload"]), + call(["sudo", "systemctl", "daemon-reload"], capture_output=True, check=True, text=True), ], "popen_attributes": { 'communicate.return_value': ('output', 'error') @@ -807,19 +807,19 @@ }, }, "enable_feature_subprocess_calls": [ - call(["sudo", "systemctl", "start", "bgp.service"]), - call(["sudo", "systemctl", "enable", "bgp.service"]), - call(["sudo", "systemctl", "unmask", "bgp.service"]), - call(["sudo", "systemctl", "start", "teamd.service"]), - call(["sudo", "systemctl", "enable", "teamd.service"]), - call(["sudo", "systemctl", "unmask", "teamd.service"]), - call(["sudo", "systemctl", "unmask", "syncd.service"]), - call(["sudo", "systemctl", "enable", "syncd.service"]), - call(["sudo", "systemctl", "start", "syncd.service"]), + call(["sudo", "systemctl", "start", "bgp.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "bgp.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "bgp.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "teamd.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "teamd.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "teamd.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "syncd.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "syncd.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "syncd.service"], capture_output=True, check=True, text=True), ], "daemon_reload_subprocess_call": [ - call(["sudo", "systemctl", "daemon-reload"]), + call(["sudo", "systemctl", "daemon-reload"], capture_output=True, check=True, text=True), ], "popen_attributes": { 'communicate.return_value': ('output', 'error') @@ -916,19 +916,19 @@ }, }, "enable_feature_subprocess_calls": [ - call(["sudo", "systemctl", "start", "bgp.service"]), - call(["sudo", "systemctl", "enable", "bgp.service"]), - call(["sudo", "systemctl", "unmask", "bgp.service"]), - call(["sudo", "systemctl", "start", "teamd.service"]), - call(["sudo", "systemctl", "enable", "teamd.service"]), - call(["sudo", "systemctl", "unmask", "teamd.service"]), - call(["sudo", "systemctl", "unmask", "syncd.service"]), - call(["sudo", "systemctl", "enable", "syncd.service"]), - call(["sudo", "systemctl", "start", "syncd.service"]), + call(["sudo", "systemctl", "start", "bgp.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "bgp.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "bgp.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "teamd.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "teamd.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "teamd.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "syncd.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "syncd.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "syncd.service"], capture_output=True, check=True, text=True), ], "daemon_reload_subprocess_call": [ - call(["sudo", "systemctl", "daemon-reload"]), + call(["sudo", "systemctl", "daemon-reload"], capture_output=True, check=True, text=True), ], "popen_attributes": { 'communicate.return_value': ('output', 'error') @@ -1026,33 +1026,33 @@ }, }, "enable_feature_subprocess_calls": [ - call(["sudo", "systemctl", "stop", "bgp@0.service"]), - call(["sudo", "systemctl", "disable", "bgp@0.service"]), - call(["sudo", "systemctl", "mask", "bgp@0.service"]), - call(["sudo", "systemctl", "stop", "bgp@1.service"]), - call(["sudo", "systemctl", "disable", "bgp@1.service"]), - call(["sudo", "systemctl", "mask", "bgp@1.service"]), - call(["sudo", "systemctl", "start", "teamd@0.service"]), - call(["sudo", "systemctl", "enable", "teamd@0.service"]), - call(["sudo", "systemctl", "unmask", "teamd@0.service"]), - call(["sudo", "systemctl", "start", "teamd@1.service"]), - call(["sudo", "systemctl", "enable", "teamd@1.service"]), - call(["sudo", "systemctl", "unmask", "teamd@1.service"]), - call(["sudo", "systemctl", "stop", "lldp@0.service"]), - call(["sudo", "systemctl", "disable", "lldp@0.service"]), - call(["sudo", "systemctl", "mask", "lldp@0.service"]), - call(["sudo", "systemctl", "stop", "lldp@1.service"]), - call(["sudo", "systemctl", "disable", "lldp@1.service"]), - call(["sudo", "systemctl", "mask", "lldp@1.service"]), - call(["sudo", "systemctl", "start", "syncd@0.service"]), - call(["sudo", "systemctl", "enable", "syncd@0.service"]), - call(["sudo", "systemctl", "unmask", "syncd@0.service"]), - call(["sudo", "systemctl", "start", "syncd@1.service"]), - call(["sudo", "systemctl", "enable", "syncd@1.service"]), - call(["sudo", "systemctl", "unmask", "syncd@1.service"]), + call(["sudo", "systemctl", "stop", "bgp@0.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "disable", "bgp@0.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "mask", "bgp@0.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "stop", "bgp@1.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "disable", "bgp@1.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "mask", "bgp@1.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "teamd@0.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "teamd@0.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "teamd@0.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "teamd@1.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "teamd@1.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "teamd@1.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "stop", "lldp@0.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "disable", "lldp@0.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "mask", "lldp@0.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "stop", "lldp@1.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "disable", "lldp@1.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "mask", "lldp@1.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "syncd@0.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "syncd@0.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "syncd@0.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "start", "syncd@1.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "enable", "syncd@1.service"], capture_output=True, check=True, text=True), + call(["sudo", "systemctl", "unmask", "syncd@1.service"], capture_output=True, check=True, text=True), ], "daemon_reload_subprocess_call": [ - call(["sudo", "systemctl", "daemon-reload"]), + call(["sudo", "systemctl", "daemon-reload"], capture_output=True, check=True, text=True), ], "popen_attributes": { 'communicate.return_value': ('output', 'error') @@ -1167,36 +1167,36 @@ }, }, "enable_feature_subprocess_calls": [ - call(['sudo', 'systemctl', 'unmask', 'bgp@0.service']), - call(['sudo', 'systemctl', 'enable', 'bgp@0.service']), - call(['sudo', 'systemctl', 'start', 'bgp@0.service']), - call(['sudo', 'systemctl', 'unmask', 'bgp@1.service']), - call(['sudo', 'systemctl', 'enable', 'bgp@1.service']), - call(['sudo', 'systemctl', 'start', 'bgp@1.service']), - call(['sudo', 'systemctl', 'unmask', 'teamd@0.service']), - call(['sudo', 'systemctl', 'enable', 'teamd@0.service']), - call(['sudo', 'systemctl', 'start', 'teamd@0.service']), - call(['sudo', 'systemctl', 'unmask', 'teamd@1.service']), - call(['sudo', 'systemctl', 'enable', 'teamd@1.service']), - call(['sudo', 'systemctl', 'start', 'teamd@1.service']), - call(['sudo', 'systemctl', 'mask', 'lldp.service']), - call(['sudo', 'systemctl', 'disable', 'lldp.service']), - call(['sudo', 'systemctl', 'stop', 'lldp.service']), - call(['sudo', 'systemctl', 'unmask', 'lldp@0.service']), - call(['sudo', 'systemctl', 'enable', 'lldp@0.service']), - call(['sudo', 'systemctl', 'start', 'lldp@0.service']), - call(['sudo', 'systemctl', 'unmask', 'lldp@1.service']), - call(['sudo', 'systemctl', 'enable', 'lldp@1.service']), - call(['sudo', 'systemctl', 'start', 'lldp@1.service']), - call(['sudo', 'systemctl', 'unmask', 'macsec@0.service']), - call(['sudo', 'systemctl', 'enable', 'macsec@0.service']), - call(['sudo', 'systemctl', 'start', 'macsec@0.service']), - call(['sudo', 'systemctl', 'unmask', 'macsec@1.service']), - call(['sudo', 'systemctl', 'enable', 'macsec@1.service']), - call(['sudo', 'systemctl', 'start', 'macsec@1.service']) + call(['sudo', 'systemctl', 'unmask', 'bgp@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'bgp@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'bgp@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'bgp@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'bgp@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'bgp@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'teamd@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'teamd@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'teamd@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'teamd@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'teamd@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'teamd@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'mask', 'lldp.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'disable', 'lldp.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'stop', 'lldp.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'lldp@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'lldp@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'lldp@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'lldp@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'lldp@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'lldp@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'macsec@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'macsec@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'macsec@0.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'unmask', 'macsec@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'enable', 'macsec@1.service'], capture_output=True, check=True, text=True), + call(['sudo', 'systemctl', 'start', 'macsec@1.service'], capture_output=True, check=True, text=True) ], "daemon_reload_subprocess_call": [ - call(["sudo", "systemctl", "daemon-reload"]), + call(["sudo", "systemctl", "daemon-reload"], capture_output=True, check=True, text=True), ], "popen_attributes": { 'communicate.return_value': ('output', 'error')