Commit a526e777 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

updated. rocko - py 3.5.2, jethro - py 2.7.12

parent 5127c1fa
......@@ -40,10 +40,13 @@ python do_target_scp () {
cmd = "ping "+REMOTE_IP+" -c 1"
print("cmd: "+cmd)
try:
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
except subprocess.CalledProcessError:
subprocess.run(cmd,stderr=subprocess.STDOUT,shell=True)
except subprocess.CalledProcessError as e:
print("MOST EPIC FAIL 1: "+str(e.output))
print("MOST EPIC FAIL 2: "+str(e.cmd))
raise Exception("No route to target "+REMOTE_IP)
nandboot = command_over_ssh(d,"'if [ -d /tmp/rootfs.ro ]; then echo 1; else echo 0;fi'")
......@@ -56,7 +59,7 @@ python do_target_scp () {
#copy archive
cmd = "scp -i "+IDENTITY_FILE+" -p "+WORKDIR+"/image.tar.gz "+REMOTE_USER+"@"+REMOTE_IP+":/"
print("cmd: "+cmd)
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
subprocess.run(cmd,stderr=subprocess.STDOUT,shell=True)
#unpack archive to /
command_over_ssh(d,"'tar -C / -xzpf /image.tar.gz; sync'")
#unpack archive to /tmp/rootfs.ro
......@@ -86,7 +89,7 @@ python do_target_scp () {
#copy archive
print("Copy archive")
cmd = "scp -i "+IDENTITY_FILE+" -p "+WORKDIR+"/image.tar.gz "+REMOTE_USER+"@"+REMOTE_IP+":/"
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
subprocess.run(cmd,stderr=subprocess.STDOUT,shell=True)
#unpack archive to mountpoint
print("Unpack archive then delete")
......@@ -101,7 +104,7 @@ python do_target_scp () {
#copy archive
cmd = "scp -i "+IDENTITY_FILE+" -p "+WORKDIR+"/image.tar.gz "+REMOTE_USER+"@"+REMOTE_IP+":/"
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
subprocess.run(cmd,stderr=subprocess.STDOUT,shell=True)
#unpack archive to /
command_over_ssh(d,"'tar -C / -xzpf /image.tar.gz; rm -f /image.tar.gz; sync'")
......
......@@ -8,8 +8,9 @@ def command_over_ssh(d,command):
cmd = "ssh -i "+id+" "+user+"@"+ip+" "+command
print("cmd: "+cmd)
try:
ret = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
except subprocess.CalledProcessError:
ret = subprocess.run(cmd,stderr=subprocess.STDOUT,shell=True)
except subprocess.CalledProcessError as e:
print("Error code: "+e.returncode)
raise Exception("Copying to target requires access by public key. Run: \033[1;37mssh-copy-id "+REMOTE_USER+"@"+REMOTE_IP+"\033[0m")
return ret.strip()
return str(ret).strip()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment