-
Notifications
You must be signed in to change notification settings - Fork 78
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
base: main
Are you sure you want to change the base?
Added changes to support OSPFv3_interfaces ansible #536
Conversation
|
||
def get_ospfv3_interfaces_facts(self): | ||
""" Get the 'facts' (the current configuration) | ||
:rtype: A dictionary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latest_config = self.new_cfg(new_config) | |
new_config = self.new_cfg(new_config) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version_added: '3.1.0' | |
version_added: '3.1.0' | |
notes: | |
- Supports C(check_mode). | |
- Tested against Enterprise SONiC Distribution by Dell Technologies. |
############################################# | ||
# 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. | ||
# | ||
############################################# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
############################################# | |
# 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): |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ospf = None |
if ipv6: | ||
ospf_int = ipv6.get('openconfig-ospfv3-ext:ospfv3', {}) | ||
if ospf_int: | ||
# for name in ospf_int.get('config', []): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Copyright 2024 Dell Inc. or its subsidiaries. All Rights Reserved | |
# Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved |
- name: "Debug" | ||
ansible.builtin.debug: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: "Debug" | |
ansible.builtin.debug: |
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- no router ospfv3 | ||
|
||
sonic_ospfv3_interfaces_tests: | ||
- name: test_case_01 |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
and update ospfv3_interface details in meta/runtime.yml |
SUMMARY
GitHub Issues
List the GitHub issues impacted by this PR. If no Github issues are affected, please indicate this with "N/A".
ISSUE TYPE
COMPONENT NAME
OUTPUT
ADDITIONAL INFORMATION
Checklist:
How Has This Been Tested?
ansible_log.txt
regression-2025-03-24-12-36-47.pdf