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

VMware: Remove unused option from vmware_host_datastore #47824

Merged
merged 1 commit into from
Nov 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions lib/ansible/modules/cloud/vmware/vmware_host_datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
datacenter_name:
description:
- Name of the datacenter to add the datastore.
required: true
- The datacenter isn't used by the API to create a datastore.
- Will be removed in 2.11.
required: false
datastore_name:
description:
- Name of the datastore to add/remove.
Expand Down Expand Up @@ -89,7 +91,6 @@
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter_name: '{{ datacenter }}'
datastore_name: '{{ item.name }}'
datastore_type: '{{ item.type }}'
vmfs_device_name: 'naa.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
Expand All @@ -103,7 +104,6 @@
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter_name: '{{ datacenter }}'
datastore_name: '{{ item.name }}'
datastore_type: '{{ item.type }}'
nfs_server: '{{ item.server }}'
Expand All @@ -121,7 +121,6 @@
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter_name: '{{ datacenter }}'
datastore_name: '{{ item.name }}'
datastore_type: '{{ item.type }}'
nfs_server: '{{ item.server }}'
Expand All @@ -139,7 +138,6 @@
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter_name: '{{ datacenter }}'
datastore_name: NasDS_vol01
esxi_hostname: '{{ inventory_hostname }}'
state: absent
Expand All @@ -163,6 +161,7 @@ class VMwareHostDatastore(PyVmomi):
def __init__(self, module):
super(VMwareHostDatastore, self).__init__(module)

# NOTE: The below parameter is deprecated starting from Ansible v2.11
self.datacenter_name = module.params['datacenter_name']
self.datastore_name = module.params['datastore_name']
self.datastore_type = module.params['datastore_type']
Expand Down Expand Up @@ -284,7 +283,7 @@ def mount_vmfs_datastore_host(self):
def main():
argument_spec = vmware_argument_spec()
argument_spec.update(
datacenter_name=dict(type='str', required=True),
datacenter_name=dict(type='str', required=False, removed_in_version=2.11),
datastore_name=dict(type='str', required=True),
datastore_type=dict(type='str', choices=['nfs', 'nfs41', 'vmfs']),
nfs_server=dict(type='str'),
Expand Down