aci_aaa_user: Manage AAA users on ACI fabrics (#35543)

* aci_aaa_user: Manage AAA users on ACI fabrics

* Fix module documentation

* Ensure we allow to not set accountStatus and expires

* Added aaa_password_lifetime and aaa_password_update_required support

* Improvements to integration tests in light of issue 35544

* Fix ACI ISO 8601 formatted string

* Add HAS_DATEUTIL
This commit is contained in:
Dag Wieers
2018-02-01 00:45:32 +01:00
committed by GitHub
parent 512d6f6ac6
commit 12b8b8dcf2
4 changed files with 439 additions and 1 deletions

View File

@@ -186,6 +186,14 @@ class ACIModule(object):
elif self.params['password'] is not None:
self.module.warn('When doing ACI signatured-based authentication, a password is not required')
def iso8601_format(self, dt):
''' Return an ACI-compatible ISO8601 formatted time: 2123-12-12T00:00:00.000+00:00 '''
try:
return dt.isoformat(timespec='milliseconds')
except:
tz = dt.strftime('%z')
return '%s.%03d%s:%s' % (dt.strftime('%Y-%m-%dT%H:%M:%S'), dt.microsecond / 1000, tz[:3], tz[3:])
def define_protocol(self):
''' Set protocol based on use_ssl parameter '''
@@ -315,7 +323,6 @@ class ACIModule(object):
def query(self, path):
''' Perform a query with no payload '''
# Ensure method is set
self.result['path'] = path
if 'port' in self.params and self.params['port'] is not None: