Skip to content
Merged
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
33 changes: 15 additions & 18 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ ansible-core==2.17.14
# ansible-lint
ansible-lint==25.9.2
# via -r requirements.in
ansible-runner==2.4.1
ansible-runner==2.4.2
# via -r requirements.in
astroid==4.0.1
# via pylint
attrs==25.4.0
# via
# jsonschema
# referencing
azure-common==1.1.28
# via azure-mgmt-network
azure-core==1.35.1
azure-core==1.36.0
# via
# azure-identity
# azure-kusto-data
Expand All @@ -47,7 +45,7 @@ azure-mgmt-core==1.6.0
# via
# azure-mgmt-compute
# azure-mgmt-network
azure-mgmt-network==29.0.0
azure-mgmt-network==30.0.0
# via -r requirements.in
azure-storage-blob==12.23.0
# via
Expand All @@ -71,17 +69,17 @@ cffi==2.0.0
# via
# ansible-lint
# cryptography
charset-normalizer==3.4.3
charset-normalizer==3.4.4
# via requests
click==8.3.0
# via
# -r requirements.in
# black
coverage[toml]==7.10.7
coverage[toml]==7.11.0
# via
# -r requirements.in
# pytest-cov
cryptography==46.0.2
cryptography==46.0.3
# via
# ansible-core
# ansible-lint
Expand All @@ -104,11 +102,10 @@ ijson==3.4.0.post0
# via azure-kusto-data
importlib-metadata==8.7.0
# via ansible-lint
iniconfig==2.1.0
iniconfig==2.3.0
# via pytest
isodate==0.7.2
# via
# azure-mgmt-network
# azure-storage-blob
# azure-storage-queue
# msrest
Expand Down Expand Up @@ -144,7 +141,9 @@ msal==1.34.0
msal-extensions==1.3.1
# via azure-identity
msrest==0.7.1
# via azure-mgmt-compute
# via
# azure-mgmt-compute
# azure-mgmt-network
mypy-extensions==1.1.0
# via black
numpy==2.2.6
Expand Down Expand Up @@ -190,7 +189,7 @@ pyjwt[crypto]==2.10.1
# via
# msal
# pyjwt
pylint==4.0.0
pylint==4.0.2
# via -r requirements.in
pytest==8.4.2
# via
Expand All @@ -207,7 +206,7 @@ python-dateutil==2.9.0.post0
# via
# azure-kusto-data
# pandas
pytokens==0.1.10
pytokens==0.2.0
# via black
pytz==2025.2
# via pandas
Expand Down Expand Up @@ -238,20 +237,18 @@ resolvelib==1.0.1
# via ansible-core
rich==14.2.0
# via -r requirements.in
rpds-py==0.27.1
rpds-py==0.28.0
# via
# jsonschema
# referencing
ruamel-yaml==0.18.15
ruamel-yaml==0.18.16
# via ansible-lint
ruamel-yaml-clib==0.2.14
# via
# ansible-lint
# ruamel-yaml
six==1.17.0
# via
# azure-core
# python-dateutil
# via python-dateutil
subprocess-tee==0.4.2
# via
# ansible-compat
Expand Down
1 change: 0 additions & 1 deletion src/module_utils/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import logging
import re
import shlex
import ipaddress
from typing import Any

try:
Expand Down
6 changes: 0 additions & 6 deletions src/module_utils/filesystem_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
Collectors for data collection in SAP Automation QA
"""
import json
from abc import ABC, abstractmethod
import logging
import re
import shlex
import ipaddress
from typing import Any

try:
Expand Down Expand Up @@ -434,14 +430,12 @@ def gather_all_filesystem_info(
fstype = fs.get("fstype", "")
stripe_size = fs.get("stripe_size", "")
stripes = ""
lv_size = ""

if not stripe_size and vg_name and source:
for lv_name, lv_info in lvm_volumes.items():
if lv_info.get("dm_path") == source:
stripe_size = lv_info.get("stripe_size", "")
stripes = lv_info.get("stripes", "")
lv_size = lv_info.get("size", "")
self.parent.log(
logging.INFO,
f"Found LVM details for {target}: "
Expand Down
3 changes: 1 addition & 2 deletions tests/module_utils/collector_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
Unit tests for the collector module.
"""

import pytest
import json
from typing import Any, Dict
from unittest.mock import Mock

import pytest

from src.module_utils.collector import (
AzureDataParser,
Expand Down
9 changes: 2 additions & 7 deletions tests/module_utils/filesystem_collector_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@
Tests use pytest with monkeypatch for mocking, avoiding unittest entirely.
"""

import json
import logging
from typing import Any, Dict, List
from unittest.mock import Mock

import pytest

from typing import Any, Dict
from src.module_utils.filesystem_collector import FileSystemCollector


Expand Down Expand Up @@ -768,7 +763,7 @@ def test_collect_empty_lvm_fullreport(self, collector, mock_parent):
"mount_info": "/data /dev/sdc xfs rw",
"df_info": "Filesystem 1K-blocks Used Available Use% Mounted\n/dev/sdc 524288000 52428800 471859200 10% /data",
}
result = collector.collect(MockCheck(), context)
collector.collect(MockCheck(), context)
assert any(
"lvm_fullreport is empty or invalid" in log["message"] for log in mock_parent.logs
)
Expand Down
2 changes: 0 additions & 2 deletions tests/module_utils/get_pcmk_properties_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,5 @@ def test_check_required_resources_optional(self, validator):
"meta_attributes": {},
}
validator.RESOURCE_CATEGORIES["optional_resource"] = ".//primitive[@type='NonExistent']"

initial_message = validator.result["message"]
validator._check_required_resources()
assert "Required resource 'optional_resource'" not in validator.result["message"]
4 changes: 1 addition & 3 deletions tests/modules/configuration_check_module_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
"""

import json
import logging
from datetime import datetime
from typing import Any, Dict, Optional
from unittest.mock import Mock, MagicMock, patch
from unittest.mock import Mock, patch

import pytest

Expand Down Expand Up @@ -698,7 +697,6 @@ def test_get_results_summary_empty(self, config_module):

def test_get_results_summary_with_results(self, config_module, sample_check):
"""Test summary with mixed results"""
# Create mock result objects with status as string values for summary
result1 = Mock()
result1.status = TestStatus.SUCCESS.value
result1.check = sample_check
Expand Down
2 changes: 0 additions & 2 deletions tests/modules/get_azure_lb_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ def test_get_load_balancers_details(self, azure_lb):
:type azure_lb: AzureLoadBalancer
"""
azure_lb.get_load_balancers_details()
print(f"\n\nResult: {azure_lb.result}")
print(f"Parameters: {azure_lb.result['details']['parameters']}")
assert azure_lb.result["status"] == "PASSED"
assert azure_lb.result["details"]["parameters"] is not None

Expand Down