From a92fab433125c75e80bde7796db962be4d0a4c7f Mon Sep 17 00:00:00 2001 From: omnom62 <75066712+omnom62@users.noreply.github.com> Date: Mon, 28 Sep 2026 20:46:52 +1000 Subject: T8989: update to vyos's get_value() method (#29) * T8989: update to vyos's get_value() method * T8989: Refactor vyos.py with new get_value() wrapper Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * T8989: Refactor return statement to handle None values Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * T8989: get_values - AI fixes, add unit test * T8989: get_values - AI fixes, add unit test --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Daniil Baturin --- plugins/module_utils/vyos.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins/module_utils/vyos.py') diff --git a/plugins/module_utils/vyos.py b/plugins/module_utils/vyos.py index f7c17f9..b7a519e 100644 --- a/plugins/module_utils/vyos.py +++ b/plugins/module_utils/vyos.py @@ -320,7 +320,8 @@ class VyOSModule: that's actually already correct. """ result = self._client.retrieve_return_value(path) - return result.get("data") or "" + data = result.get("data") + return "" if data is None else data def apply_commands(self, commands): if not commands: @@ -372,7 +373,8 @@ class VyOSModule: rather than being indistinguishable from a valid empty response. """ result = self._client.show(path) - return result.get("data") or "" + data = result.get("data") + return "" if data is None else data def save_config(self, file_path=None): """Save the running configuration to disk.""" -- cgit v1.2.3