-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fix: Resolved errors for integration test in github action #50
base: v2
Are you sure you want to change the base?
Changes from 2 commits
497d196
9ce03fb
f239a20
aaff22d
d07f169
3521d48
ae99357
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2436,6 +2436,18 @@ def __init__(self, *args, **kwargs): | |||||
exclude = ["state", "csp_url", "api_key", "id"] | ||||||
self._payload_params = {k: v for k, v in self.params.items() if v is not None and k not in exclude} | ||||||
self._payload = Subnet.from_dict(self._payload_params) | ||||||
# Safely remove unwanted attributes | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||||||
if self._payload.dhcp_config: | ||||||
self._payload.dhcp_config.abandoned_reclaim_time = None | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Documentation and Return for subnet should to be updated to remove these 3 attributes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all the fields are required to be sent as part of the inheritance payload |
||||||
self._payload.dhcp_config.abandoned_reclaim_time_v6 = None | ||||||
self._payload.dhcp_config.echo_client_id = None | ||||||
|
||||||
# Handle inheritance sources safely | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This piece of code was redundant, i have removed it |
||||||
if self._payload.inheritance_sources and self._payload.inheritance_sources.dhcp_config: | ||||||
inherited_dhcp_config = self._payload.inheritance_sources.dhcp_config | ||||||
setattr(inherited_dhcp_config, "abandoned_reclaim_time", None) | ||||||
setattr(inherited_dhcp_config, "abandoned_reclaim_time_v6", None) | ||||||
setattr(inherited_dhcp_config, "echo_client_id", None) | ||||||
self._existing = None | ||||||
|
||||||
@property | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,12 +266,12 @@ | |
- subnet_info.objects | length == 1 | ||
- subnet_info.objects[0].ddns_generate_name == true | ||
|
||
- name: "Create a Subnet with ddns_send_updates set to false" | ||
- name: "Create a Subnet with ddns_send_updates set to true" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Its generally a good idea to test the attribute value other default values , hence in this case There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
infoblox.bloxone.ipam_subnet: | ||
address: "10.0.0.0/24" | ||
space: "{{ ip_space.id }}" | ||
state: "present" | ||
ddns_send_updates: "false" | ||
ddns_send_updates: "true" | ||
register: subnet | ||
- name: Get information about the Subnet | ||
infoblox.bloxone.ipam_subnet_info: | ||
|
@@ -284,27 +284,7 @@ | |
that: | ||
- subnet is not failed | ||
- subnet_info.objects | length == 1 | ||
- subnet_info.objects[0].ddns_send_updates == false | ||
|
||
- name: "Create a Subnet with ddns_ttl_percent set to 25" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of deleting the Task , it would be a better idea to comment it out and add the reason as well as the ticket number indicating why the task is skipped There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
infoblox.bloxone.ipam_subnet: | ||
address: "10.0.0.0/24" | ||
space: "{{ ip_space.id }}" | ||
state: "present" | ||
ddns_ttl_percent: 25 | ||
register: subnet | ||
- name: Get information about the Subnet | ||
infoblox.bloxone.ipam_subnet_info: | ||
filters: | ||
address: "10.0.0.0" | ||
space: "{{ ip_space.id }}" | ||
cidr: 24 | ||
register: subnet_info | ||
- assert: | ||
that: | ||
- subnet is not failed | ||
- subnet_info.objects | length == 1 | ||
- subnet_info.objects[0].ddns_ttl_percent == 25 | ||
- subnet_info.objects[0].ddns_send_updates == true | ||
|
||
- name: "Create a Subnet with ddns_update_on_renew set to true" | ||
infoblox.bloxone.ipam_subnet: | ||
|
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.
As per Address block implementation , shouldn't this "exclude" contain
abandoned_reclaim_time
,abandoned_reclaim_time_v6
andecho_client_id
too ?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.
done