Fix bug when setting up a local vserver peer (#54257)
* Revert "changes to clusteR" This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80. * Revert "changes to clusteR" This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80. * Revert "Revert "changes to clusteR"" This reverts commitf1104a37b4
. * Revert "Revert "changes to clusteR"" This reverts commitf1104a37b4
. * Revert "documentation changes" This reverts commit 02c369d0414fdff492d90865c903bdade3174261. * fix bug * Revert "Revert "documentation changes"" This reverts commit496b91bebe
.
This commit is contained in:
parent
81deb8f132
commit
1c6bc5ed4a
1 changed files with 10 additions and 4 deletions
|
@ -224,6 +224,12 @@ class NetAppONTAPVserverPeer(object):
|
|||
% (self.parameters['vserver'], to_native(error)),
|
||||
exception=traceback.format_exc())
|
||||
|
||||
def is_remote_peer(self):
|
||||
if self.parameters.get('dest_hostname') is None or \
|
||||
(self.parameters['dest_hostname'] == self.parameters['hostname']):
|
||||
return False
|
||||
return True
|
||||
|
||||
def vserver_peer_accept(self):
|
||||
"""
|
||||
Accept a vserver peer at destination
|
||||
|
@ -234,9 +240,7 @@ class NetAppONTAPVserverPeer(object):
|
|||
'vserver-peer-accept', **{'peer-vserver': self.parameters['vserver'],
|
||||
'vserver': self.parameters['peer_vserver']})
|
||||
try:
|
||||
# accept only if the peer relationship is on a remote cluster
|
||||
if self.parameters.get('dest_hostname') is not None:
|
||||
self.dest_server.invoke_successfully(vserver_peer_accept, enable_tunneling=True)
|
||||
self.dest_server.invoke_successfully(vserver_peer_accept, enable_tunneling=True)
|
||||
except netapp_utils.zapi.NaApiError as error:
|
||||
self.module.fail_json(msg='Error accepting vserver peer %s: %s'
|
||||
% (self.parameters['peer_vserver'], to_native(error)),
|
||||
|
@ -253,7 +257,9 @@ class NetAppONTAPVserverPeer(object):
|
|||
cd_action = self.na_helper.get_cd_action(current, self.parameters)
|
||||
if cd_action == 'create':
|
||||
self.vserver_peer_create()
|
||||
self.vserver_peer_accept()
|
||||
# accept only if the peer relationship is on a remote cluster
|
||||
if self.is_remote_peer():
|
||||
self.vserver_peer_accept()
|
||||
elif cd_action == 'delete':
|
||||
self.vserver_peer_delete()
|
||||
|
||||
|
|
Loading…
Reference in a new issue