示例#1
0
    def __init__(self,
                 host,
                 member_no,
                 template,
                 user,
                 password,
                 rootdir,
                 distribution,
                 dir_name,
                 hosts,
                 ds_seed_nodes,
                 rpc_seed_nodes,
                 replicas,
                 clean=False):
        self.host = host
        self.member_no = member_no
        self.template = template
        self.user = user
        self.password = password
        self.rootdir = rootdir
        self.clean = clean
        self.distribution = distribution
        self.dir_name = dir_name
        self.hosts = hosts
        self.ds_seed_nodes = ds_seed_nodes
        self.rpc_seed_nodes = rpc_seed_nodes
        self.replicas = replicas

        # Connect to the remote host and start doing operations
        self.remote = RemoteHost(self.host, self.user, self.password,
                                 self.rootdir)
示例#2
0
def main():
    hosts = args.hosts.split(",")
    for x in range(0, len(hosts)):
        # Connect to the remote host and start doing operations
        remote = RemoteHost(hosts[x], args.user, args.password, args.rootdir)
        remote.kill_controller()
        if args.clean:
            remote.exec_cmd("rm -rf " + args.rootdir +
                            "/deploy/current/odl/*journal")
            remote.exec_cmd("rm -rf " + args.rootdir +
                            "/deploy/current/odl/snapshots")
        remote.start_controller(args.rootdir + "/deploy/current")