Exemplo n.º 1
0
 def create(count):
     if count >= CREATE_OR_SET_LOOP_LIMIT:
         raise CreateOrSetLoopLimitReachedError(path)
     d = kz_client.create(path, content, makepath=True)
     d.addErrback(
         catch_failure(NodeExistsError, lambda f: set_content(count)))
     return d
Exemplo n.º 2
0
 def create(count):
     if count >= CREATE_OR_SET_LOOP_LIMIT:
         raise CreateOrSetLoopLimitReachedError(path)
     d = kz_client.create(path, content, makepath=True)
     d.addErrback(catch_failure(NodeExistsError,
                                lambda f: set_content(count)))
     return d
Exemplo n.º 3
0
 def set_content(count):
     d = kz_client.set(path, content)
     d.addErrback(catch_failure(NoNodeError, lambda f: create(count + 1)))
     return d.addCallback(lambda r: path)
Exemplo n.º 4
0
 def set_content(count):
     d = kz_client.set(path, content)
     d.addErrback(catch_failure(NoNodeError, lambda f: create(count + 1)))
     return d.addCallback(lambda r: path)