ACI: Move to 'host' parameter instead of 'hostname' (#35161)

* ACI: Move to 'host' parameter instead of 'hostname'

* Update host parameter in documentation fragment too
This commit is contained in:
Dag Wieers 2018-01-22 22:06:56 +01:00 committed by GitHub
parent cf1f7b53df
commit d6004852a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 197 additions and 198 deletions

View file

@ -63,7 +63,7 @@ except ImportError:
def aci_argument_spec():
return dict(
hostname=dict(type='str', required=True, aliases=['host']),
host=dict(type='str', required=True, aliases=['hostname']),
port=dict(type='int', required=False),
username=dict(type='str', default='admin', aliases=['user']),
password=dict(type='str', no_log=True),
@ -216,9 +216,9 @@ class ACIModule(object):
# Perform login request
if 'port' in self.params and self.params['port'] is not None:
url = '%(protocol)s://%(hostname)s:%(port)s/api/aaaLogin.json' % self.params
url = '%(protocol)s://%(host)s:%(port)s/api/aaaLogin.json' % self.params
else:
url = '%(protocol)s://%(hostname)s/api/aaaLogin.json' % self.params
url = '%(protocol)s://%(host)s/api/aaaLogin.json' % self.params
payload = {'aaaUser': {'attributes': {'name': self.params['username'], 'pwd': self.params['password']}}}
resp, auth = fetch_url(self.module, url,
data=json.dumps(payload),
@ -281,9 +281,9 @@ class ACIModule(object):
self.result['path'] = path
if 'port' in self.params and self.params['port'] is not None:
self.result['url'] = '%(protocol)s://%(hostname)s:%(port)s/' % self.params + path.lstrip('/')
self.result['url'] = '%(protocol)s://%(host)s:%(port)s/' % self.params + path.lstrip('/')
else:
self.result['url'] = '%(protocol)s://%(hostname)s/' % self.params + path.lstrip('/')
self.result['url'] = '%(protocol)s://%(host)s/' % self.params + path.lstrip('/')
# Sign and encode request as to APIC's wishes
if self.params['private_key'] is not None:
@ -319,9 +319,9 @@ class ACIModule(object):
self.result['path'] = path
if 'port' in self.params and self.params['port'] is not None:
self.result['url'] = '%(protocol)s://%(hostname)s:%(port)s/' % self.params + path.lstrip('/')
self.result['url'] = '%(protocol)s://%(host)s:%(port)s/' % self.params + path.lstrip('/')
else:
self.result['url'] = '%(protocol)s://%(hostname)s/' % self.params + path.lstrip('/')
self.result['url'] = '%(protocol)s://%(host)s/' % self.params + path.lstrip('/')
# Sign and encode request as to APIC's wishes
if self.params['private_key'] is not None:
@ -395,9 +395,9 @@ class ACIModule(object):
self.result['path'] = path
if 'port' in self.params and self.params['port'] is not None:
self.result['url'] = '{0}://{1}:{2}/{3}'.format(self.module.params['protocol'], self.module.params['hostname'], self.module.params['port'], path)
self.result['url'] = '{0}://{1}:{2}/{3}'.format(self.module.params['protocol'], self.module.params['host'], self.module.params['port'], path)
else:
self.result['url'] = '{0}://{1}/{2}'.format(self.module.params['protocol'], self.module.params['hostname'], path)
self.result['url'] = '{0}://{1}/{2}'.format(self.module.params['protocol'], self.module.params['host'], path)
self.result['filter_string'] = filter_string
def _construct_url_1(self, obj, child_includes):