(tablet_conf)
| 54 | return (prefix, suffix, is_local) |
| 55 | |
| 56 | def InitEnv(tablet_conf): |
| 57 | for item in tablet_conf["address_arr"]: |
| 58 | host = item["address"].split(":")[0] |
| 59 | (prefix, suffix, is_local) = GetPrefixAndSuffix(host) |
| 60 | cmd_arr = [] |
| 61 | print("Init Env on {}".format(host)) |
| 62 | cmd_arr.append("{} echo 'never' > /sys/kernel/mm/transparent_hugepage/enabled;" |
| 63 | "echo 'never' > /sys/kernel/mm/transparent_hugepage/defrag {}".format(prefix, suffix)) |
| 64 | cmd_arr.append("{} swapoff -a {}".format(prefix, suffix)) |
| 65 | for cmd in cmd_arr: |
| 66 | (returncode,output,errout) = RunWithRetunCode(cmd) |
| 67 | if returncode != 0: |
| 68 | print("execute cmd[{}] failed! error msg: {}".format(cmd, errout)) |
| 69 | return |
| 70 | print("execute cmd[{}] success".format(cmd)) |
| 71 | |
| 72 | def CheckJava(host): |
| 73 | (prefix, suffix, is_local) = GetPrefixAndSuffix(host) |
no test coverage detected