vsphere_copy: fix the E309 error (#56537)

Resolve the two following errors:

ERROR: lib/ansible/modules/cloud/vmware/vsphere_copy.py:0:0: E309 version_added for new option (host) should be '2.9'. Currently None
ERROR: lib/ansible/modules/cloud/vmware/vsphere_copy.py:0:0: E309 version_added for new option (login) should be '2.9'. Currently None
pull/56424/head
Gonéri Le Bouder 6 years ago committed by Matt Clay
parent 867e357eb1
commit 32620b7e00

@ -26,22 +26,12 @@ author:
options: options:
hostname: hostname:
version_added: "2.9" version_added: "2.9"
aliases: ['host']
port: port:
version_added: "2.9" version_added: "2.9"
username: username:
version_added: "2.9" version_added: "2.9"
host: aliases: ['login']
description:
- Use C(hostname) instead like the other VMware modules.
- The vCenter or ESXi server on which the datastore is available.
- This option is deprecated and will eventually be removed in 2.12.
aliases: ['hostname']
login:
description:
- Use C(username) instead like the other VMware modules.
- The login name to authenticate on the vCenter or ESXi server.
- This option is deprecated and will eventually be removed in 2.12.
aliases: ['username']
src: src:
description: description:
- The file to push to vCenter. - The file to push to vCenter.
@ -143,8 +133,8 @@ def vmware_path(datastore, datacenter, path):
def main(): def main():
argument_spec = vmware_argument_spec() argument_spec = vmware_argument_spec()
argument_spec.update(dict( argument_spec.update(dict(
host=dict(required=False, removedin_version='2.12'), hostname=dict(required=False, aliases=['host']),
login=dict(required=False, removedin_version='2.12'), username=dict(required=False, aliases=['login']),
src=dict(required=True, aliases=['name']), src=dict(required=True, aliases=['name']),
datacenter=dict(required=False), datacenter=dict(required=False),
datastore=dict(required=True), datastore=dict(required=True),
@ -158,13 +148,13 @@ def main():
supports_check_mode=False, supports_check_mode=False,
) )
if module.params['host'] is not None: if module.params.get('host'):
module.deprecate("The 'host' option is being replaced by 'hostname'", version='2.12') module.deprecate("The 'host' option is being replaced by 'hostname'", version='2.12')
if module.params['login'] is not None: if module.params.get('login'):
module.deprecate("The 'login' option is being replaced by 'username'", version='2.12') module.deprecate("The 'login' option is being replaced by 'username'", version='2.12')
hostname = module.params['hostname'] or module.params['host'] hostname = module.params['hostname']
username = module.params['username'] or module.params['login'] username = module.params['username']
password = module.params.get('password') password = module.params.get('password')
src = module.params.get('src') src = module.params.get('src')
datacenter = module.params.get('datacenter') datacenter = module.params.get('datacenter')

@ -307,7 +307,6 @@ lib/ansible/modules/cloud/vmware/vca_vapp.py E322
lib/ansible/modules/cloud/vmware/vca_vapp.py E324 lib/ansible/modules/cloud/vmware/vca_vapp.py E324
lib/ansible/modules/cloud/vmware/vmware_guest.py E322 lib/ansible/modules/cloud/vmware/vmware_guest.py E322
lib/ansible/modules/cloud/vmware/vsphere_copy.py E322 lib/ansible/modules/cloud/vmware/vsphere_copy.py E322
lib/ansible/modules/cloud/vmware/vsphere_copy.py E309
lib/ansible/modules/clustering/consul.py E322 lib/ansible/modules/clustering/consul.py E322
lib/ansible/modules/clustering/consul_session.py E322 lib/ansible/modules/clustering/consul_session.py E322
lib/ansible/modules/clustering/etcd3.py E326 lib/ansible/modules/clustering/etcd3.py E326

Loading…
Cancel
Save