a better way to determine if were running inside a vagrant box

This commit is contained in:
Daniel Schonfeld 2016-12-24 19:28:13 +01:00 committed by Peter Barker
parent 21ca1d3835
commit ef637e4add
2 changed files with 4 additions and 1 deletions

View File

@ -656,7 +656,7 @@ def start_mavproxy(opts, stuff):
# If running inside of a vagrant guest, then we probably want to forward our mavlink out to the containing host OS
ports = [p + 10 * cmd_opts.instance for p in [14550,14551]]
for port in ports:
if getpass.getuser() == "vagrant":
if os.path.isfile("/ardupilot.vagrant"):
cmd.extend(["--out", "10.0.2.2:" + str(port)])
else:
cmd.extend(["--out", "127.0.0.1:" + str(port)])

View File

@ -82,5 +82,8 @@ cd jsbsim
make -j2
EOF
#Plant a marker for sim_vehicle that we're inside a vagrant box
touch /ardupilot.vagrant
# Now you can run
# vagrant ssh -c "screen -d -R"