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

Adding ansible lint fixes for plugins #503

Open
wants to merge 3 commits into
base: release/1.9.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plugins/module_utils/prism/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def _build_spec_default_subnet(self, payload, subnet_ref):
if err:
return None, err

payload["spec"]["resources"][
"default_subnet_reference"
] = Subnet.build_subnet_reference_spec(uuid)
payload["spec"]["resources"]["default_subnet_reference"] = (
Subnet.build_subnet_reference_spec(uuid)
)
return payload, None

def _build_spec_subnets(self, payload, subnet_ref_list):
Expand Down
18 changes: 8 additions & 10 deletions plugins/module_utils/prism/projects_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ def _build_spec_default_subnet(self, payload, subnet_ref):
if err:
return None, err

payload["spec"]["project_detail"]["resources"][
"default_subnet_reference"
] = Subnet.build_subnet_reference_spec(uuid)
payload["spec"]["project_detail"]["resources"]["default_subnet_reference"] = (
Subnet.build_subnet_reference_spec(uuid)
)
return payload, None

def _build_spec_subnets(self, payload, subnet_ref_list):
Expand Down Expand Up @@ -393,13 +393,11 @@ def _build_spec_role_mappings(self, payload, role_mappings):
acp["acp"]["resources"]["user_reference_list"] = role_user_groups_map[
acp["acp"]["resources"]["role_reference"]["uuid"]
]["users"]
acp["acp"]["resources"][
"user_group_reference_list"
] = role_user_groups_map[
acp["acp"]["resources"]["role_reference"]["uuid"]
][
"user_groups"
]
acp["acp"]["resources"]["user_group_reference_list"] = (
role_user_groups_map[
acp["acp"]["resources"]["role_reference"]["uuid"]
]["user_groups"]
)

# pop the role uuid entry once used for acp update
role_user_groups_map.pop(
Expand Down
12 changes: 6 additions & 6 deletions plugins/module_utils/prism/protection_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ def _build_spec_schedules(self, payload, schedules):
az_connection_spec = {}
spec = {}
if schedule.get("source"):
az_connection_spec[
"source_availability_zone_index"
] = ordered_az_list.index(schedule["source"])
az_connection_spec["source_availability_zone_index"] = (
ordered_az_list.index(schedule["source"])
)
if schedule.get("destination"):
az_connection_spec[
"destination_availability_zone_index"
] = ordered_az_list.index(schedule["destination"])
az_connection_spec["destination_availability_zone_index"] = (
ordered_az_list.index(schedule["destination"])
)

if schedule["protection_type"] == "ASYNC":
if (
Expand Down
6 changes: 3 additions & 3 deletions plugins/module_utils/prism/recovery_plans.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ def _build_spec_floating_ip_assignments(self, payload, floating_ip_assignments):

vm_ip_assignment_specs.append(ip_assignment_spec)

floating_ip_assignment_spec[
"vm_ip_assignment_list"
] = vm_ip_assignment_specs
floating_ip_assignment_spec["vm_ip_assignment_list"] = (
vm_ip_assignment_specs
)
floating_ip_assignment_specs.append(floating_ip_assignment_spec)

payload["spec"]["resources"]["parameters"][
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/ntnx_acps.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
EXAMPLES = r"""
- name: Create min ACP
ntnx_acps:
validate_certs: False
validate_certs: false
state: present
nutanix_host: "{{ IP }}"
nutanix_username: "{{ username }}"
Expand All @@ -131,7 +131,7 @@

- name: Create ACP with user reference
ntnx_acps:
validate_certs: False
validate_certs: false
state: present
nutanix_host: "{{ IP }}"
nutanix_username: "{{ username }}"
Expand All @@ -144,7 +144,7 @@

- name: Create ACP with user ad user group reference
ntnx_acps:
validate_certs: False
validate_certs: false
state: present
nutanix_host: "{{ IP }}"
nutanix_username: "{{ username }}"
Expand All @@ -159,7 +159,7 @@

- name: Create ACP with all specfactions
ntnx_acps:
validate_certs: False
validate_certs: false
state: present
nutanix_host: "{{ IP }}"
nutanix_username: "{{ username }}"
Expand Down
44 changes: 22 additions & 22 deletions plugins/modules/ntnx_acps_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,28 @@
- Alaa Bishtawi (@alaa-bish)
"""
EXAMPLES = r"""
- name: List acp using name filter criteria
ntnx_acps_info:
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: False
filter:
name: "{{ acp.name }}"
kind: access_control_policy
register: result

- name: List acp using length, offset, sort order and name sort attribute
ntnx_acps_info:
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: False
length: 1
offset: 1
sort_order: "ASCENDING"
sort_attribute: "name"
register: result
- name: List acp using name filter criteria
ntnx_acps_info:
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: false
filter:
name: "{{ acp.name }}"
kind: access_control_policy
register: result

- name: List acp using length, offset, sort order and name sort attribute
ntnx_acps_info:
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: false
length: 1
offset: 1
sort_order: "ASCENDING"
sort_attribute: "name"
register: result
"""
RETURN = r"""
api_version:
Expand Down
12 changes: 6 additions & 6 deletions plugins/modules/ntnx_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: False
validate_certs: false
state: "present"
name: "{{first_category.name}}"
desc: "{{first_category.desc}}"
Expand All @@ -66,7 +66,7 @@
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: False
validate_certs: false
state: "present"
name: "{{first_category.name}}"
desc: "{{first_category.update_desc}}"
Expand All @@ -79,7 +79,7 @@
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: False
validate_certs: false
state: "absent"
name: "{{first_category.name}}"
desc: "{{first_category.update_desc}}"
Expand All @@ -91,7 +91,7 @@
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: False
validate_certs: false
state: "absent"
name: "{{first_category.name}}"
remove_values: true
Expand All @@ -101,7 +101,7 @@
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: False
validate_certs: false
state: "absent"
name: "{{first_category.name}}"
register: result
Expand All @@ -110,7 +110,7 @@
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: False
validate_certs: false
state: "present"
name: "{{second_category.name}}"
desc: test description
Expand Down
22 changes: 11 additions & 11 deletions plugins/modules/ntnx_categories_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
EXAMPLES = r"""
- name: test getting all categories
ntnx_categories_info:
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: False
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: false
register: result
ignore_errors: true

Expand All @@ -48,18 +48,18 @@
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: False
validate_certs: false
filter:
name: "{{category_name}}"
name: "{{category_name}}"
register: result

- name: test getting the category by it's name
ntnx_categories_info:
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: False
name: "{{category_name}}"
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: false
name: "{{category_name}}"
register: result
"""
RETURN = r"""
Expand Down
34 changes: 17 additions & 17 deletions plugins/modules/ntnx_clusters_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@
- Alaa Bishtawi (@alaa-bish)
"""
EXAMPLES = r"""
- name: List clusterss
ntnx_clusters_info:
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: False
kind: cluster
register: result

- name: test getting particular cluster using uuid
ntnx_clusters_info:
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: False
cluster_uuid: cluster_uuid
register: result
- name: List clusterss
ntnx_clusters_info:
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: false
kind: cluster
register: result

- name: test getting particular cluster using uuid
ntnx_clusters_info:
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: false
cluster_uuid: cluster_uuid
register: result
"""
RETURN = r"""
api_version:
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/ntnx_floating_ips.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
EXAMPLES = r"""
- name: create Floating IP with External Subnet Name
ntnx_floating_ips:
validate_certs: False
validate_certs: false
state: present
nutanix_host: "{{ IP }}"
nutanix_username: "{{ username }}"
Expand All @@ -86,20 +86,20 @@

- name: create Floating IP with vpc Name with external subnet uuid
ntnx_floating_ips:
validate_certs: False
validate_certs: false
state: present
nutanix_host: "{{ IP }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
external_subnet:
uuid: "{{external_subnet.subnet_uuiid}}"
vpc:
name: "{{vpc.vpc_name}}"
name: "{{vpc.vpc_name}}"
private_ip: "{{private_ip}}"

- name: create Floating IP with External Subnet with vm
ntnx_floating_ips:
validate_certs: False
validate_certs: false
state: present
nutanix_host: "{{ IP }}"
nutanix_username: "{{ username }}"
Expand Down
45 changes: 22 additions & 23 deletions plugins/modules/ntnx_floating_ips_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,28 @@
- Alaa Bishtawi (@alaa-bish)
"""
EXAMPLES = r"""
- name: List Floating ip using ip starts with 10 filter criteria
ntnx_floating_ips_info:
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: False
filter:
floating_ip: "10."
kind: floating_ip
register: result

- name: List Floating ip using length, offset, sort order and floating_ip sort attribute
ntnx_floating_ips_info:
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: False
length: 3
offset: 0
sort_order: "DESCENDING"
sort_attribute: "floating_ip"
register: result

- name: List Floating ip using ip starts with 10 filter criteria
ntnx_floating_ips_info:
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: false
filter:
floating_ip: "10."
kind: floating_ip
register: result

- name: List Floating ip using length, offset, sort order and floating_ip sort attribute
ntnx_floating_ips_info:
nutanix_host: "{{ ip }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: false
length: 3
offset: 0
sort_order: "DESCENDING"
sort_attribute: "floating_ip"
register: result
"""
RETURN = r"""
api_version:
Expand Down
Loading
Loading