Skip to content
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

enhancement for node_mgmt_epg_to_contract (DCNE-87) #658

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

Conversation

Ziaf007
Copy link

@Ziaf007 Ziaf007 commented May 21, 2024

-) Added node_mgmt_epg_to_contract module
-) Test.yml still pending, working on it.

DCNE-87

@github-actions github-actions bot changed the title enhancement for node_mgmt_epg_to_contract enhancement for node_mgmt_epg_to_contract (DCNE-87) Oct 18, 2024
@Ziaf007 Ziaf007 force-pushed the node_mgmt_epg_to_contract branch from 9010dbf to 820f4cc Compare October 18, 2024 13:35
@Ziaf007 Ziaf007 force-pushed the node_mgmt_epg_to_contract branch from 820f4cc to 2873077 Compare October 24, 2024 14:15
argument_spec.update(aci_annotation_spec())
argument_spec.update(
contract_type=dict(type="str", choices=["consumer", "provider", "taboo", "interface"], required=True),
epg_type=dict(type="str", aliases=["type"], choices=["in_band","out_of_band"], required=True)
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
epg_type=dict(type="str", aliases=["type"], choices=["in_band","out_of_band"], required=True)
epg_type=dict(type="str", aliases=["type"], choices=["in_band","out_of_band"], required=True),

This should fix the black formatting error. Please run black -l 159 to format this one.

@akinross akinross requested a review from samiib December 16, 2024 13:52
Comment on lines +4 to +5
# Copyright: (c) 2017, Jacob McGill (@jmcgill298)
# Copyright: (c) 2023, Akini Ross (@akinross) <[email protected]>
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove and put your own

argument_spec = aci_argument_spec()
argument_spec.update(aci_annotation_spec())
argument_spec.update(
contract_type=dict(type="str", choices=["consumer", "provider", "taboo", "interface"], required=True),
Copy link
Collaborator

Choose a reason for hiding this comment

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

docs do not match [ consumer, provider, taboo, interface, intra_epg ]

Comment on lines +89 to +90
- Jacob McGill (@jmcgill298)
- Akini Ross (@akinross)
Copy link
Collaborator

Choose a reason for hiding this comment

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

use your own


DOCUMENTATION = r"""
---
module: aci_epg_to_contract
Copy link
Collaborator

Choose a reason for hiding this comment

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

wrong module name

module: aci_epg_to_contract
short_description: Bind EPGs to Contracts (fv:RsCons, fv:RsProv, fv:RsProtBy, fv:RsConsIf, and fv:RsIntraEpg)
description:
- Bind EPGs to Contracts on Cisco ACI fabrics.
Copy link
Collaborator

Choose a reason for hiding this comment

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

specific to magement node

class_config = {"prio": priority, aci_name: contract}

if contract_type != "provider":
module.fail_json(msg="out_of_band EPG only supports Provider contract attachment.")
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
module.fail_json(msg="out_of_band EPG only supports Provider contract attachment.")
module.fail_json(msg="only 'provider' contract_type is supported for 'out_of_band' epg_type")

Comment on lines +311 to +333
root_class=dict(
aci_class="fvTenant",
aci_rn="tn-mgmt",
module_object="mgmt",
target_filter={"name": "mgmt"},
),
subclass_1=dict(
aci_class="mgmtMgmtP",
aci_rn="mgmtp-default",
module_object="default",
target_filter={"name": "default"},
),
subclass_2=dict(
aci_class=class_Map[epg_type][0]["epg_class"],
aci_rn=class_Map[epg_type][0]["epg_rn"].format(epg),
module_object=epg,
target_filter={"name": epg},
),
subclass_3=dict(
aci_class=aci_class,
aci_rn="{0}{1}".format(aci_rn, contract),
module_object=contract,
target_filter={aci_name: contract},
Copy link
Collaborator

Choose a reason for hiding this comment

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

is class query working? else try adding rootclass /subclass1/2 together since they are static values

Copy link
Author

Choose a reason for hiding this comment

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

Will have to test this

aci.get_existing()

if state == "present":
child_configs = []
Copy link
Collaborator

Choose a reason for hiding this comment

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

why define child_configs here as []?

# Test code for the ACI modules
# Copyright: (c) 2024, Faiz Mohammad (@faizmoh) <[email protected]>

# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
Copy link
Collaborator

Choose a reason for hiding this comment

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

state: present

# CREATE INB
- name: bind inb contract to inband epg - check mode works
Copy link
Collaborator

Choose a reason for hiding this comment

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

assert defaults and test all attributes can be updates that can be updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aci_epg_to_contract module does not work for associating contracts to Node mgmt EPGs (DCNE-87)
3 participants