ipareplica/library/ipareplica_custodia_import_dm_password: Fix post 4.7 use

custodiainstance.import_dm_password does not support master_host_name post
4.6.90 anymore. A new inspect call has been added to verify if the arg is
supported or not.
This commit is contained in:
Thomas Woerner
2018-07-17 13:49:10 +02:00
parent 70f756fd83
commit eced45bb53
2 changed files with 4 additions and 1 deletions

View File

@@ -42,6 +42,8 @@ else:
if NUM_VERSION >= 40600:
# IPA version >= 4.6
import inspect
import contextlib
import logging

View File

@@ -183,7 +183,8 @@ def main():
ansible_log.debug("-- CUSTODIA IMPORT DM PASSWORD --")
if not hasattr(custodiainstance, "get_custodia_instance"):
argspec = inspect.getargspec(custodia.import_dm_password)
if "master_host_name" in argspec.args:
custodia.import_dm_password(config.master_host_name)
else:
custodia.import_dm_password()