Skip to content

Commit

Permalink
fix: Fixed segment group check_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
willguibr committed Dec 23, 2023
1 parent 6fa8c59 commit ff6cc47
Show file tree
Hide file tree
Showing 9 changed files with 203 additions and 183 deletions.
1 change: 0 additions & 1 deletion plugins/doc_fragments/fragments.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

# Copyright 2023, Zscaler, Inc
Expand Down
2 changes: 0 additions & 2 deletions plugins/modules/zpa_application_segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@
- and applies Data Loss Prevention policies to the application segment you are creating
type: bool
required: false
type: bool
required: false
bypass_type:
description:
- Indicates whether users can bypass ZPA to access applications.
Expand Down
2 changes: 0 additions & 2 deletions plugins/modules/zpa_application_segment_inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@
- and applies Data Loss Prevention policies to the application segment you are creating
type: bool
required: false
type: bool
required: false
adp_enabled:
description:
- Indicates if Active Directory Inspection is enabled or not for the application.
Expand Down
2 changes: 0 additions & 2 deletions plugins/modules/zpa_application_segment_pra.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@
- and applies Data Loss Prevention policies to the application segment you are creating
type: bool
required: false
type: bool
required: false
bypass_type:
description:
- Indicates whether users can bypass ZPA to access applications.
Expand Down
31 changes: 31 additions & 0 deletions sanity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import os

# Define the modules directory, ignore versions, and path to the sanity tests directory
modules_directory = "plugins/modules"
sanity_tests_directory = "tests/sanity"
ignore_versions = ["2.13", "2.14", "2.15", "2.16"]
license_issue = "validate-modules:missing-gplv3-license"

# Check if the sanity tests directory exists, if not, create it
if not os.path.exists(sanity_tests_directory):
os.makedirs(sanity_tests_directory)

# Get a list of all module files in the modules directory, excluding __init__.py
modules = [
f for f in os.listdir(modules_directory) if f.endswith(".py") and f != "__init__.py"
]

# Ensure that there are no duplicate modules
modules = list(set(modules))

# For each version, generate an ignore file within the sanity tests directory
for version in ignore_versions:
with open(
os.path.join(sanity_tests_directory, f"ignore-{version}.txt"), "w"
) as ignore_file:
for module in modules:
ignore_file.write(f"{modules_directory}/{module} {license_issue}\n")

print(
f"Generated ignore files in {sanity_tests_directory} for versions: {', '.join(ignore_versions)}"
)
87 changes: 43 additions & 44 deletions tests/sanity/ignore-2.13.txt
Original file line number Diff line number Diff line change
@@ -1,55 +1,54 @@
plugins/modules/zpa_app_protection_predefined_control_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_server.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_isolation_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_provisioning_key.py validate-modules:missing-gplv3-license
plugins/modules/zpa_trusted_networks_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_idp_controller_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_server_group.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_ba_certificate.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_config_controller_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_enrollement_certificate_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_scim_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_custom_control.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_config_log_types_formats_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_controller_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_browser_access_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_assistant_schedule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_saml_attribute_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_assistant_schedule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_provisioning_key_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_pra.py validate-modules:missing-gplv3-license
plugins/modules/zpa_scim_attribute_header_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_app_protection_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_config_controller_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_cloud_connector_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_segment_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_groups_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_security_profile_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_rule_reorder.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_pra.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_browser_access.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_groups.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_isolation_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_machine_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_service_edge_groups_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_posture_profile_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_server_group.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_client_types_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_config_status_codes_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_config_controller.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_timeout_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_server_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_forwarding_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_timeout_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_app_protection_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_browser_access_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_forwarding_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_segment_group.py validate-modules:missing-gplv3-license
plugins/modules/zpa_server_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_config_log_types_formats_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_provisioning_key_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_connector_assistant_schedule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_inspection.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_server_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_security_profile.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_forwarding_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_machine_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_isolation_profile_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_timeout_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_timeout_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_isolation_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_groups_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_isolation_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_enrollement_certificate_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_custom_control_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_ba_certificate_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_server_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_predefined_control_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_app_protection_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_client_types_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_service_edge_groups.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_groups.py validate-modules:missing-gplv3-license
plugins/modules/zpa_ba_certificate_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_ba_certificate.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment.py validate-modules:missing-gplv3-license
plugins/modules/zpa_isolation_profile_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_inspection.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_controller_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_idp_controller_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_app_protection_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_scim_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_server.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_config_controller.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_forwarding_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_provisioning_key.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_rule_reorder.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_custom_control.py validate-modules:missing-gplv3-license
plugins/modules/zpa_service_edge_groups_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_all_predefined_controls_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_posture_profile_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_segment_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_security_profile_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_browser_access.py validate-modules:missing-gplv3-license
plugins/modules/zpa_connector_assistant_schedule_facts.py validate-modules:missing-gplv3-license
87 changes: 43 additions & 44 deletions tests/sanity/ignore-2.14.txt
Original file line number Diff line number Diff line change
@@ -1,55 +1,54 @@
plugins/modules/zpa_app_protection_predefined_control_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_server.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_isolation_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_provisioning_key.py validate-modules:missing-gplv3-license
plugins/modules/zpa_trusted_networks_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_idp_controller_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_server_group.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_ba_certificate.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_config_controller_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_enrollement_certificate_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_scim_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_custom_control.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_config_log_types_formats_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_controller_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_browser_access_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_assistant_schedule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_saml_attribute_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_assistant_schedule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_provisioning_key_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_pra.py validate-modules:missing-gplv3-license
plugins/modules/zpa_scim_attribute_header_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_app_protection_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_config_controller_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_cloud_connector_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_segment_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_groups_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_security_profile_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_rule_reorder.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_pra.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_browser_access.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_groups.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_isolation_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_machine_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_service_edge_groups_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_posture_profile_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_server_group.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_client_types_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_config_status_codes_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_config_controller.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_timeout_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_server_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_forwarding_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_timeout_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_app_protection_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_browser_access_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_forwarding_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_segment_group.py validate-modules:missing-gplv3-license
plugins/modules/zpa_server_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_config_log_types_formats_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_provisioning_key_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_connector_assistant_schedule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_inspection.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_server_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_security_profile.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_forwarding_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_machine_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_isolation_profile_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_timeout_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_timeout_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_isolation_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_groups_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_isolation_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_enrollement_certificate_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_custom_control_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_ba_certificate_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_server_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_predefined_control_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_app_protection_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_client_types_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_service_edge_groups.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_groups.py validate-modules:missing-gplv3-license
plugins/modules/zpa_ba_certificate_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_ba_certificate.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment.py validate-modules:missing-gplv3-license
plugins/modules/zpa_isolation_profile_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_inspection.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_connector_controller_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_idp_controller_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_app_protection_rule_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_scim_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_server.py validate-modules:missing-gplv3-license
plugins/modules/zpa_lss_config_controller.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_forwarding_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_provisioning_key.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_rule.py validate-modules:missing-gplv3-license
plugins/modules/zpa_policy_access_rule_reorder.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_custom_control.py validate-modules:missing-gplv3-license
plugins/modules/zpa_service_edge_groups_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_all_predefined_controls_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_posture_profile_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_segment_group_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_app_protection_security_profile_facts.py validate-modules:missing-gplv3-license
plugins/modules/zpa_application_segment_browser_access.py validate-modules:missing-gplv3-license
plugins/modules/zpa_connector_assistant_schedule_facts.py validate-modules:missing-gplv3-license
Loading

0 comments on commit ff6cc47

Please sign in to comment.