8000 Added changes to support OSPFv3_interfaces ansible by Mansi062001 · Pull Request #536 · ansible-collections/dellemc.enterprise_sonic · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Added changes to support OSPFv3_interfaces ansible #536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Mansi062001
Copy link
@Mansi062001 Mansi062001 commented Mar 25, 2025
SUMMARY
GitHub Issues

List the GitHub issues impacted by this PR. If no Github issues are affected, please indicate this with "N/A".

GitHub Issue #
N/A
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME
  • sonic_ospfv3_interfaces
OUTPUT
ADDITIONAL INFORMATION

Checklist:
  • I have performed a self-review of my own code to ensure there are no formatting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have maintained backward compatibility or have provided any relevant "breaking_changes" descriptions in a "fragment" file in the "changelogs/fragments" directory of this repository.
  • I have provided a summary for this PR in valid "fragment" file format in the "changelogs/fragments" directory of this repository branch. Reference : Ansible Change Log Document
How Has This Been Tested?

ansible_log.txt
regression-2025-03-24-12-36-47.pdf

@santhosh-kt santhosh-kt self-requested a review March 25, 2025 11:52
@santhosh-kt santhosh-kt added the new_resource_module This pull request adds a new resource module label Mar 25, 2025

def get_ospfv3_interfaces_facts(self):
""" Get the 'facts' (the current configuration)
:rtype: A dictionary
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
:rtype: A dictionary
:rtype: A list


def set_config(self, existing_ospfv3_interfaces_facts):
""" Collect the configuration from the args passed to the module,
collect the current configuration (as a dict from facts)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
collect the current configuration (as a dict from facts)
collect the current configuration (as a list from facts)


def set_state(self, want, have):
""" Select the appropriate function based on the state provided
:param want: the desired configuration as a dictionary
Copy link
Collaborator

Choose a reason for hiding this comment

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

change dictionary to list on both 152-153


new_config = get_new_config(new_commands, old_config, TEST_KEYS)

latest_config = self.new_cfg(new_config)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
latest_config = self.new_cfg(new_config)
new_config = self.new_cfg(new_config)

Copy link
Collaborator

Choose a reason for hiding this comment

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

replace 'latest_config' in below follow ups as well.


self.facts_edit_config.side_effect = self.facts_side_effect
self.config_edit_config.side_effect = self.config_side_effect
self.utils_edit_config.side_effect = self.facts_side_effect
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
self.utils_edit_config.side_effect = self.facts_side_effect
self.utils_edit_config.side_effect = self.config_side_effect

DOCUMENTATION = """
---
module: sonic_ospfv3_interfaces
version_added: '3.1.0'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
version_added: '3.1.0'
version_added: '3.1.0'
notes:
- Supports C(check_mode).
- Tested against Enterprise SONiC Distribution by Dell Technologies.

@santhosh-kt santhosh-kt added this to the v3.1.0 milestone May 9, 2025
Comment on lines 7 to 23
#############################################
# WARNING #
#############################################
#
# This file is auto generated by the resource
# module builder playbook.
#
# Do not edit this file manually.
#
# Changes to this file will be over written
# by the resource module builder.
#
# Changes should be made in the model used to
# generate this file or in the resource module
# builder template.
#
#############################################
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
#############################################
# WARNING #
#############################################
#
# This file is auto generated by the resource
# module builder playbook.
#
# Do not edit this file manually.
#
# Changes to this file will be over written
# by the resource module builder.
#
# Changes should be made in the model used to
# generate this file or in the resource module
# builder template.
#
#############################################

ansible_facts['ansible_network_resources'].update(facts)
return ansible_facts

def render_config(self, spec, conf):
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function returns same config.
Hence remove this and also change line 56 to 58 as objs.append(ospfv3_interface_config)

if intf_name == "eth0":
continue

ospf = None
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
ospf = None

if ipv6:
ospf_int = ipv6.get('openconfig-ospfv3-ext:ospfv3', {})
if ospf_int:
# for name in ospf_int.get('config', []):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# for name in ospf_int.get('config', []):

@@ -0,0 +1,599 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2024 Dell Inc. or its subsidiaries. All Rights Reserved
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# Copyright 2024 Dell Inc. or its subsidiaries. All Rights Reserved
# Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved

Comment on lines 2 to 4
- name: "Debug"
ansible.builtin.debug:

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- name: "Debug"
ansible.builtin.debug:

Comment on lines 232 to 234



Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change

- no router ospfv3

sonic_ospfv3_interfaces_tests:
- name: test_case_01
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a blank line between each testcases for more clarity

del_config.append({'name': intf_name})
return add_config, del_config

def get_create_ospf_interfaces_requests(self, commands, have):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove commented lines.

description:
- Configure OSPFv3 transmit delay (1 to 65535).
type: int
bfd:
Copy link
Collaborator

Choose a reason for hiding this comment

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

move bfd next to area_id for alphabetical order and arrange all attributes in alphabetical order.

Copy link
Collaborator

Choose a reason for hiding this comment

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

so does bfd_profile before enable.

@santhosh-kt
Copy link
Collaborator

Refer https://github.com/ansible-collections/dellemc.enterprise_sonic/pull/544/files#diff-18d6cff77d3f99e665fab5cd24dc4384256c8aa59f5300c2a72098a582e6a1d8

and update ospfv3_interface details in meta/runtime.yml
and symlink of ospfv3_interfaces.py in plugins/action/pms.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new_resource_module This pull request adds a new resource module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0