You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
424 B
18 lines
424 B
6 years ago
|
import time
|
||
|
import sys
|
||
|
from kazoo.client import KazooClient
|
||
|
|
||
|
class ZkClient:
|
||
|
def __init__(self):
|
||
|
self.zk = KazooClient(hosts=sys.argv[1])
|
||
|
self.zk.start()
|
||
|
def del_node(self):
|
||
|
self.zk.delete(sys.argv[2], recursive=True)
|
||
6 years ago
|
print('deleted success')
|
||
6 years ago
|
def __del__(self):
|
||
|
self.zk.stop()
|
||
|
if __name__ == '__main__':
|
||
|
zkclient = ZkClient()
|
||
|
zkclient.del_node()
|
||
|
time.sleep(2)
|