Merge branch 'master' of github.com:open-cloud/xos
diff --git a/containers/xos/Dockerfile b/containers/xos/Dockerfile
index 9e69cac..dc9a638 100644
--- a/containers/xos/Dockerfile
+++ b/containers/xos/Dockerfile
@@ -86,6 +86,7 @@
 
 # Set environment variables.
 ENV HOME /root
+ENV PYTHONPATH /usr/local/lib/python2.7/site-packages:/usr/lib/python2.7/dist-packages
 
 # Define working directory.
 WORKDIR /opt/xos
diff --git a/containers/xos/Dockerfile.templ b/containers/xos/Dockerfile.templ
index f29305b..216ceb5 100644
--- a/containers/xos/Dockerfile.templ
+++ b/containers/xos/Dockerfile.templ
@@ -80,6 +80,7 @@
 
 # Set environment variables.
 ENV HOME /root
+ENV PYTHONPATH /usr/local/lib/python2.7/site-packages:/usr/lib/python2.7/dist-packages
 
 # Define working directory.
 WORKDIR /root
diff --git a/xos/configurations/cord/Makefile b/xos/configurations/cord/Makefile
index 755f704..0dc7a73 100644
--- a/xos/configurations/cord/Makefile
+++ b/xos/configurations/cord/Makefile
@@ -3,7 +3,7 @@
 LAST_CONTAINER=$(shell sudo docker ps -l -q)
 
 cord: common_cloudlab ceilometer_dashboard virtualbng_json vtn_network_cfg_json
-	rm ../../xos_configuration/*
+	if [ -a ../../xos_configuration/* ]; then rm ../../xos_configuration/*; fi
 	echo "# Autogenerated -- do not edit" > Dockerfile
 	cat ../common/Dockerfile.common Dockerfile.cord >> Dockerfile
 	cp ../common/xos_common_config ../../xos_configuration/
diff --git a/xos/configurations/cord/README-VTN.md b/xos/configurations/cord/README-VTN.md
index d196205..b8a28c1 100644
--- a/xos/configurations/cord/README-VTN.md
+++ b/xos/configurations/cord/README-VTN.md
@@ -5,6 +5,9 @@
 inside the xos container:
 
     python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/tosca/samples/vtn.yaml
+    emacs /opt/xos/xos_configuration/xos_common_config
+        [networking]
+        use_vtn=True
 
 ctl node:
 
@@ -44,7 +47,8 @@
     # change 172.17.0.2 to the IP address for the ONOS container (use "docker inspect")
     iptables -t nat -A PREROUTING -i br-ex -p tcp --dport 8101 -j DNAT --to-destination 172.17.0.2
     iptables -t nat -A PREROUTING -i br-ex -p tcp --dport 8181 -j DNAT --to-destination 172.17.0.2
-
+    iptables -t nat -A PREROUTING -i br-ex -p tcp --dport 6653 -j DNAT --to-destination 172.17.0.2
+    
 Compute nodes (all of them):
 
     systemctl stop neutron-plugin-openvswitch-agent
@@ -65,4 +69,6 @@
 
 Problems:
 * If you have more than one compute node, then the node that isn't running ONOS VTN will report as incomplete in VTN. This is because the openvswitch is trying to contact VTN on 172.17.0.2:6653. 
-* VTN doesn't like the nat-net network that XOS creates by default. Go into model_policies/model_policy_Slice.py and disable automatic creation of nat-net.
+
+Notes:
+* Adding use_vtn=True to the [networking] section in the XOS config file has two effects: 1) it sets the gateway in sync_controller_networks, and 2) it disables automatic creation of nat-net for new slices. This is because VTN will fail if there is no gateway on a network, and because we don't have nat-net under the VTN configuration.
diff --git a/xos/configurations/devel/Makefile b/xos/configurations/devel/Makefile
index f33479f..97a9806 100644
--- a/xos/configurations/devel/Makefile
+++ b/xos/configurations/devel/Makefile
@@ -9,7 +9,7 @@
 opencloud: common_opencloud xos
 
 xos:
-	rm ../../xos_configuration/*
+	if [ -a ../../xos_configuration/* ]; then rm ../../xos_configuration/*; fi
 	cp ../common/xos_common_config ../../xos_configuration/
 	echo "# Autogenerated -- do not edit" > Dockerfile
 	cat ../common/Dockerfile.common Dockerfile.devel >> Dockerfile
diff --git a/xos/configurations/frontend/Makefile b/xos/configurations/frontend/Makefile
index e30877a..96b0779 100644
--- a/xos/configurations/frontend/Makefile
+++ b/xos/configurations/frontend/Makefile
@@ -6,7 +6,7 @@
 all: frontend
 
 frontend:
-	rm ../../xos_configuration/*
+	if [ -a ../../xos_configuration/* ]; then rm ../../xos_configuration/*; fi
 	sudo apt-get -y install httpie
 	cat ../common/Dockerfile.common Dockerfile.frontend > Dockerfile
 	cp ../common/xos_common_config ../../xos_configuration/
@@ -16,7 +16,7 @@
 	echo $(RUNNING_CONTAINER)
 
 interactive:
-	rm ../../xos_configuration/*
+	if [ -a ../../xos_configuration/* ]; then rm ../../xos_configuration/*; fi
 	cat ../common/Dockerfile.common Dockerfile.frontend > Dockerfile
 	cp ../common/xos_common_config ../../xos_configuration/
 	#cp ../cord/xos_cord_config ../../xos_configuration/
diff --git a/xos/configurations/test/Makefile b/xos/configurations/test/Makefile
index b1cca93..75143fa 100644
--- a/xos/configurations/test/Makefile
+++ b/xos/configurations/test/Makefile
@@ -1,6 +1,7 @@
 MYIP:=$(shell hostname -i)
 
 test: common_cloudlab
+	if [ -a ../../xos_configuration/* ]; then rm ../../xos_configuration/*; fi
 	cat ../common/Dockerfile.common Dockerfile.test > Dockerfile
 	cd ../../..; sudo docker build -t xos -f xos/configurations/test/Dockerfile .
 	# sudo docker run -d --add-host="ctl:$(MYIP)" -p 9999:8000 xos