Example #1
0
def ensure_remote_usable(remote, session, user, password, host):
    client = autoLogin.login4public(remote.name, user, host, password)
    if utility.is_risk_path(remote.tmpPath):
        utility.pexit("risk path: " + remote.tmpPath + " found when try to remove it.")

    path = os.path.join(remote.tmpPath, session)
    client.sendline("mkdir -p  " + path)
    client.expect("[$#]")
    time.sleep(1)
    client.close()
Example #2
0
def ensure_remote_usable(remote, session, user, password, host):
    client = autoLogin.login4public(remote.name, user, host, password)
    if utility.is_risk_path(remote.tmpPath):
        utility.pexit("risk path: " + remote.tmpPath +
                      " found when try to remove it.")

    path = os.path.join(remote.tmpPath, session)
    client.sendline("mkdir -p  " + path)
    client.expect("[$#]")
    time.sleep(1)
    client.close()
Example #3
0
    def deploy(self):
        client = autoLogin.login4public(self.__nodeInfo.name, "", "", "")  # todo reactor mail user info

        client.sendline("cd ~/")
        client.expect("[#$]")

        client.sendline("echo \"" + self.__generateDeployShell() + "\" > deploy.sh")
        client.expect("[#$]")

        client.sendline("chmod +x deploy.sh")
        client.expect("[#$]")

        client.sendline("./deploy.sh")
        client.expect("[#$]")
        client.expect("[#$]")
        time.sleep(5)
Example #4
0
    def deploy(self):
        client = autoLogin.login4public(self.__nodeInfo.name, "", "",
                                        "")  # todo reactor mail user info

        client.sendline("cd ~/")
        client.expect("[#$]")

        client.sendline("echo \"" + self.__generateDeployShell() +
                        "\" > deploy.sh")
        client.expect("[#$]")

        client.sendline("chmod +x deploy.sh")
        client.expect("[#$]")

        client.sendline("./deploy.sh")
        client.expect("[#$]")
        client.expect("[#$]")
        time.sleep(5)
Example #5
0
 def __init__(self, info, streams):
     self.__info = info
     self.__upstream = UpStream(streams)
     self.__client = autoLogin.login4public(info.name, "", "", "")