Skip to content

nic firmware enhancements - #285

Open
jaspals3123 wants to merge 4 commits into
developmentfrom
jaspal_nicfirmware_enhancements
Open

jaspals3123 wants to merge 4 commits into
developmentfrom
jaspal_nicfirmware_enhancements

Conversation

@jaspals3123

Copy link
Copy Markdown
Collaborator

{ "name": "firmware policy", "plugins": { "RdmaPlugin": { "collection_args": {}, "analysis_args": { "expected_nic_firmware": "238.1.168.0" } }, "NicPlugin": { "collection_args": {}, "analysis_args": { "expected_nic_firmware": "238.1.169.0" } }, "NetworkPlugin": { "collection_args": {}, "analysis_args": { "expected_nic_firmware": "238.1.168.0" } } } }

node-scraper --plugin-configs=/home/jaspals/node-scraper/rdma.json

Comment thread nodescraper/plugins/inband/network/analyzer_args.py


class NetworkAnalyzer(RegexAnalyzer[NetworkDataModel, None]):
def _validate_firmware_policy(records: list[Dict[str, Any]], policies: Any) -> list[Dict[str, Any]]:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function along with _ploicy_matches and _normalize_firmware_version are all shared by network/nic/rdma analyzers. Please move them in utils or something like that so they can share it.


def _firmware_matches(actual: str, expected_pattern: str) -> bool:
try:
return re.fullmatch(expected_pattern, actual, flags=re.IGNORECASE) is not None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think u want to use re.escape instead of fullmatch here?

Comment thread nodescraper/plugins/inband/network/network_collector.py

@alexandraBara alexandraBara left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants