-
Notifications
You must be signed in to change notification settings - Fork 98
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
[minor change] New module for out-of-band contract creation (DCNE-219) #700
base: master
Are you sure you want to change the base?
Conversation
that: | ||
- present_check_mode is changed | ||
- present_check_mode.previous == [] | ||
- present_check_mode.sent.vzBrCP.attributes.name == 'anstest' |
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.
assertions are failing, this is the wrong class which should be vzOOBBrCP
msg: 'Please define the following variables: aci_hostname, aci_username and aci_password.' | ||
when: aci_hostname is not defined or aci_username is not defined or aci_password is not defined | ||
|
||
- name: ensure tenant exists for tests to kick off |
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.
please follow the test cases format as in https://github.com/CiscoDevNet/ansible-aci/blob/master/tests/integration/targets/aci_esg_to_contract/tasks/main.yml
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #700 +/- ##
===========================================
- Coverage 95.68% 21.25% -74.44%
===========================================
Files 270 4 -266
Lines 12404 1087 -11317
Branches 1869 246 -1623
===========================================
- Hits 11869 231 -11638
- Misses 404 836 +432
+ Partials 131 20 -111
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
plugins/modules/aci_oob_contract.py
Outdated
aliases: [ contract_name, name ] | ||
description: | ||
description: | ||
- Description for the contract. |
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.
- Description for the contract. | |
- The description of the OOB Contract. |
@@ -0,0 +1,162 @@ | |||
# Test code for the ACI modules | |||
# Copyright: (c) 2017, Jacob McGill (@jmcgill298) |
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.
update to your name
@@ -0,0 +1,162 @@ | |||
# Test code for the ACI modules |
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.
can you convert to this format: https://github.com/CiscoDevNet/ansible-aci/blob/master/tests/integration/targets/aci_esg_to_contract/tasks/main.yml
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.
Apart from # CREATE/UPDATE/QUERY/DELETE Comments and separating CREATE and UPDATE, the format seems to be followed.
Do highlight if anything specific. I have updated the above.
state: absent | ||
description: Ansible Test | ||
|
||
- name: create contract - check mode works |
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.
assert that defaults are set when attribute not provided
<<: *aci_oob_contract_present | ||
register: present_idempotent | ||
|
||
- name: update contract - update works |
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.
update all attributes to a different value when possible
plugins/modules/aci_oob_contract.py
Outdated
|
||
seealso: | ||
- name: APIC Management Information Model reference | ||
description: More information about the internal APIC class B(vz:BrCP). |
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.
description: More information about the internal APIC class B(vz:BrCP). | |
description: More information about the internal APIC class B(vz:OOBBrCP). |
plugins/modules/aci_oob_contract.py
Outdated
options: | ||
contract: | ||
description: | ||
- The name of the contract. |
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.
- The name of the contract. | |
- The name of the OOB Contract. |
plugins/modules/aci_oob_contract.py
Outdated
aliases: [ descr ] | ||
scope: | ||
description: | ||
- The scope of a service contract. |
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.
- The scope of a service contract. | |
- The scope of the OOB Contract. |
plugins/modules/aci_oob_contract.py
Outdated
choices: [ application-profile, context, global, tenant ] | ||
priority: | ||
description: | ||
- The desired QoS class to be used. |
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.
- The desired QoS class to be used. | |
- The desired Quality of Service (QoS) class to be used. |
tenant = "mgmt" # hard coding tenant to 'mgmt' | ||
name_alias = module.params.get("name_alias") | ||
|
||
aci = ACIModule(module) | ||
aci.construct_url( | ||
root_class=dict( | ||
aci_class="fvTenant", | ||
aci_rn="tn-{0}".format(tenant), | ||
module_object=tenant, | ||
target_filter={"name": tenant}, | ||
), | ||
subclass_1=dict( | ||
aci_class="vzOOBBrCP", | ||
aci_rn="oobbrc-{0}".format(contract), | ||
module_object=contract, | ||
target_filter={"name": contract}, | ||
), | ||
) |
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.
Can we define the subclass combine to be able to leverage class query for query all?
tenant = "mgmt" # hard coding tenant to 'mgmt' | |
name_alias = module.params.get("name_alias") | |
aci = ACIModule(module) | |
aci.construct_url( | |
root_class=dict( | |
aci_class="fvTenant", | |
aci_rn="tn-{0}".format(tenant), | |
module_object=tenant, | |
target_filter={"name": tenant}, | |
), | |
subclass_1=dict( | |
aci_class="vzOOBBrCP", | |
aci_rn="oobbrc-{0}".format(contract), | |
module_object=contract, | |
target_filter={"name": contract}, | |
), | |
) | |
name_alias = module.params.get("name_alias") | |
aci = ACIModule(module) | |
aci.construct_url( | |
root_class=dict( | |
aci_class="vzOOBBrCP", | |
aci_rn="tn-mgmt/oobbrc-{0}".format(contract), | |
module_object=contract, | |
target_filter={"name": contract}, | |
), | |
) |
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.
Would have to test this once for querying operations. Will analyse over the weekend.
added in module for oob_contract creation.
Updated test files for this as well.