2 ##############################################################################
3 # Copyright (c) 2018 Huawei Technologies Co.,Ltd and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10 import utils.infra_setup.passwordless_SSH.ssh as localssh
13 def moon_envprepare(host_info):
14 if ("password") in host_info:
15 client = localssh.SSH(user=host_info["user"],
17 password=host_info["password"])
19 client = localssh.SSH(user=host_info["user"],
21 key_filename=host_info["keyfile"])
22 with open("/home/opnfv/bottlenecks/utils/env_prepare/moon_prepare.bash",
24 client.run("cat > ~/bottlenecks_envprepare.bash", stdin=stdin_file)
25 client.execute("sudo bash ~/bottlenecks_envprepare.bash")