ipareplica_setup_custodia: create_replica only available in newer releases

The check for the existence of get_custodia_instance in custodiainstance
is not sufficient for the use od create_replica in CustodiaInstance. A new
check for create_replica in CustodiaInstance has been added.
This commit is contained in:
Thomas Woerner
2019-07-22 17:24:48 +02:00
parent fbf6f23590
commit 7e8145e43a

View File

@@ -185,7 +185,8 @@ def main():
if not hasattr(custodiainstance, "get_custodia_instance"):
custodia = custodiainstance.CustodiaInstance(config.host_name,
config.realm_name)
if promote:
if promote and \
hasattr(custodiainstance.CustodiaInstance, "create_replica"):
ansible_log.debug("-- CUSTODIA CREATE_REPLICA --")
custodia.create_replica(config.master_host_name)
else: