Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,4 @@ cython_debug/

# Changelog plugin cache
changelogs/.plugin-cache.yaml
sandbox/
3 changes: 3 additions & 0 deletions changelogs/fragments/upate_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfix:
- Check connection
2 changes: 1 addition & 1 deletion plugins/action/dme_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def run(self, tmp=None, task_vars=None):
task_vars=task_vars,
)

if self._task.args.get("config"):
if self._task.args.get("config") and conn_request:
(
self._result["dme_response"],
self._result["changed"],
Expand Down
10 changes: 10 additions & 0 deletions plugins/action/dme_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ def configure_module_rpc(self, dme_request, payload):
return api_response, code

def run(self, tmp=None, task_vars=None):
"""
Main execution method for the action plugin.

Args:
tmp: Temporary directory path
task_vars: Task variables

Returns:
Result dictionary with validation outcomes
"""
self._supports_check_mode = False
self._result = super(ActionModule, self).run(tmp, task_vars)

Expand Down
12 changes: 12 additions & 0 deletions tests/unit/plugins/modules/test_dme_config_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ def test_module_author(self):
assert "Sagar Paul" in doc_dict["author"]
assert "@KB-perByte" in doc_dict["author"]

def test_examples_yaml_structure_pattern(self):
"""Test that examples follow YAML structure."""
import yaml

try:
# Examples should be valid YAML
examples_list = yaml.safe_load_all(dme_config.EXAMPLES)
examples = list(examples_list)
assert len(examples) > 0
except yaml.YAMLError as e:
pytest.fail(f"Examples are not valid YAML: {e}")

def test_examples_show_workflow(self):
"""Test that examples show the complete workflow."""
examples = dme_config.EXAMPLES
Expand Down