Skip to content

Commit

Permalink
Fix the sync.zfs state file drp copy to peer nodes
Browse files Browse the repository at this point in the history
Remove the undocumented, thus unuseable, "sender" keyword. Replace it with
an autodetection of the peers nodes that need to receive the state file.
  • Loading branch information
cvaroqui committed Jan 23, 2018
1 parent 9e159c7 commit eb2f928
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/resSyncZfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def __init__(self,
target=None,
src=None,
dst=None,
sender=None,
recursive = True,
snap_size=0,
**kwargs):
Expand All @@ -29,7 +28,6 @@ def __init__(self,

self.label = "zfs of %s to %s"%(src, ",".join(target))
self.target = target
self.sender = sender
self.recursive = recursive
self.src = src
self.dst = dst
Expand All @@ -40,7 +38,6 @@ def _info(self):
data = [
["src", self.src],
["dst", self.dst],
["sender", self.sender if self.sender else ""],
["target", " ".join(self.target) if self.target else ""],
["recursive", str(self.recursive).lower()],
]
Expand Down Expand Up @@ -122,9 +119,10 @@ def get_dst_info(self):

def get_peersenders(self):
self.peersenders = set()
if 'nodes' == self.sender:
self.peersenders |= self.svc.nodes
self.peersenders -= set([rcEnv.nodename])
if rcEnv.nodename not in self.svc.nodes or self.target != ["drpnodes"]:
return
self.peersenders |= self.svc.nodes
self.peersenders -= set([rcEnv.nodename])

def get_targets(self):
self.targets = set()
Expand Down Expand Up @@ -398,8 +396,8 @@ def push_statefile(self, node):
self.set_statefile()
self._push_statefile(node)
self.get_peersenders()
for s in self.peersenders:
self._push_statefile(s)
for node in self.peersenders:
self._push_statefile(node)

def parse_statefile(self, out, node=None):
self.set_statefile()
Expand Down

0 comments on commit eb2f928

Please sign in to comment.