summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authoromnom62 <75066712+omnom62@users.noreply.github.com>2026-09-28 20:46:52 +1000
committerGitHub <noreply@github.com>2026-09-28 11:46:52 +0100
commita92fab433125c75e80bde7796db962be4d0a4c7f (patch)
treede8a57a24e8202c8499ec3cb33ffbe9917e89f89 /plugins
parent35f2016a0d5c40c3e4b6374ebe459571be544b1f (diff)
downloadrest.vyos-a92fab433125c75e80bde7796db962be4d0a4c7f.tar.gz
rest.vyos-a92fab433125c75e80bde7796db962be4d0a4c7f.zip
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 <daniil@vyos.io>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/module_utils/vyos.py6
1 files changed, 4 insertions, 2 deletions
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."""