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

Fix: Resolved errors for integration test in github action #50

Open
wants to merge 7 commits into
base: v2
Choose a base branch
from

Conversation

AnilGadiyarHJ
Copy link
Collaborator

No description provided.

@AnilGadiyarHJ AnilGadiyarHJ changed the base branch from main to v2 December 7, 2024 19:28
@@ -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"
Copy link
Collaborator

Choose a reason for hiding this comment

The 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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -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"
Copy link
Collaborator

Choose a reason for hiding this comment

The 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 false would be a better input

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -2436,6 +2436,18 @@ def __init__(self, *args, **kwargs):
exclude = ["state", "csp_url", "api_key", "id"]
Copy link
Collaborator

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 and echo_client_id too ?

Copy link
Collaborator Author

@AnilGadiyarHJ AnilGadiyarHJ Dec 11, 2024

Choose a reason for hiding this comment

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

done

@@ -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
if self._payload.dhcp_config:
self._payload.dhcp_config.abandoned_reclaim_time = None
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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

@@ -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
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
# Safely remove unwanted attributes
# Unset unsupported DHCP configuration attributes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

self._payload.dhcp_config.abandoned_reclaim_time_v6 = None
self._payload.dhcp_config.echo_client_id = None

# Handle inheritance sources safely
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
# Handle inheritance sources safely
# Unset unsupported DHCP configuration attributes in the inherited DHCP config

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This piece of code was redundant, i have removed it

@AnilGadiyarHJ AnilGadiyarHJ requested a review from unasra December 11, 2024 11:16
@mathewab mathewab removed their request for review December 11, 2024 19:04
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.

2 participants