eliminate remaining reference to /opt/planetstack from python files
diff --git a/observer-initscript b/observer-initscript
index d948eac..5f8cf0d 100644
--- a/observer-initscript
+++ b/observer-initscript
@@ -9,7 +9,7 @@
[ -f /etc/sysconfig/plstackobserver ] && . /etc/sysconfig/plstackobserver
-plstackobserver=${NODEMANAGER-"python /opt/planetstack/planetstack-backend.py -d"}
+plstackobserver=${NODEMANAGER-"python /opt/xos/xos-observer.py -d"}
prog="OpenCloud Observer"
pidfile=${PIDFILE-/var/run/plstackobserver.pid}
diff --git a/planetstack/ec2_observer/start.sh b/planetstack/ec2_observer/start.sh
deleted file mode 100644
index 1e623cd..0000000
--- a/planetstack/ec2_observer/start.sh
+++ /dev/null
@@ -1 +0,0 @@
-nohup python ec2_backend.py -C /opt/planetstack/hpc_observer/hpc_observer_config > /dev/null 2>&1 &
diff --git a/planetstack/hpc_observer/fsck.py b/planetstack/hpc_observer/fsck.py
index c1d833a..817d616 100644
--- a/planetstack/hpc_observer/fsck.py
+++ b/planetstack/hpc_observer/fsck.py
@@ -5,8 +5,8 @@
import os
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
-sys.path.append("/opt/planetstack")
-from planetstack.config import Config, DEFAULT_CONFIG_FN
+sys.path.append("/opt/xos")
+from planetstack.config import Config, DEFAULT_CONFIG_FN, XOS_DIR
from util.logger import Logger, logging
from observer.syncstep import SyncStep
@@ -27,7 +27,7 @@
if hasattr(Config(), "observer_steps_dir"):
step_dir = Config().observer_steps_dir
else:
- step_dir = "/opt/planetstack/observer/steps"
+ step_dir = XOS_DIR+"/observer/steps"
for fn in os.listdir(step_dir):
pathname = os.path.join(step_dir,fn)
@@ -58,7 +58,7 @@
def main():
if not "-C" in sys.argv:
- print >> sys.stderr, "You probably wanted to use -C /opt/planetstack/hpc_observer/hpc_observer_config"
+ print >> sys.stderr, "You probably wanted to use -C " + XOS_DIR + "/hpc_observer/hpc_observer_config"
# Generate command line parser
parser = argparse.ArgumentParser(usage='%(prog)s [options]')
diff --git a/planetstack/hpc_observer/hpclib.py b/planetstack/hpc_observer/hpclib.py
index a4fa3b9..7986540 100644
--- a/planetstack/hpc_observer/hpclib.py
+++ b/planetstack/hpc_observer/hpclib.py
@@ -5,7 +5,7 @@
import xmlrpclib
if __name__ == '__main__':
- sys.path.append("/opt/planetstack")
+ sys.path.append("/opt/xos")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
from planetstack.config import Config
diff --git a/planetstack/hpc_observer/run.sh b/planetstack/hpc_observer/run.sh
index 3369a4a..8ebecc9 100644
--- a/planetstack/hpc_observer/run.sh
+++ b/planetstack/hpc_observer/run.sh
@@ -1 +1,2 @@
-python hpc-backend.py -C /opt/planetstack/hpc_observer/hpc_observer_config
+export XOS_DIR=/opt/xos
+python hpc-backend.py -C $XOS_DIR/hpc_observer/hpc_observer_config
diff --git a/planetstack/hpc_observer/start.sh b/planetstack/hpc_observer/start.sh
index b4df9f5..c24ca3e 100644
--- a/planetstack/hpc_observer/start.sh
+++ b/planetstack/hpc_observer/start.sh
@@ -1 +1,2 @@
-nohup python hpc-backend.py -C /opt/planetstack/hpc_observer/hpc_observer_config > /dev/null 2>&1 &
+export XOS_DIR=/opt/xos
+nohup python hpc-backend.py -C $XOS_DIR/hpc_observer/hpc_observer_config > /dev/null 2>&1 &
diff --git a/planetstack/hpc_observer/upload.sh b/planetstack/hpc_observer/upload.sh
deleted file mode 100644
index 1a1b90d..0000000
--- a/planetstack/hpc_observer/upload.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-scp hpc_observer_config run.sh start.sh stop.sh root@viccidev1.cs.princeton.edu:/opt/planetstack/hpc_observer/
-scp steps/*.py root@viccidev1.cs.princeton.edu:/opt/planetstack/hpc_observer/steps/
-scp deleters/*.py root@viccidev1.cs.princeton.edu:/opt/planetstack/hpc_observer/deleters/
diff --git a/planetstack/rr_observer/deleters/servicemap_deleter.py b/planetstack/rr_observer/deleters/servicemap_deleter.py
index b5d4509..60fe337 100644
--- a/planetstack/rr_observer/deleters/servicemap_deleter.py
+++ b/planetstack/rr_observer/deleters/servicemap_deleter.py
@@ -4,6 +4,7 @@
from requestrouter.models import ServiceMap
from observer.deleter import Deleter
from util.logger import Logger, logging
+from planetstack.config import Config, XOS_DIR
parentdir = os.path.join(os.path.dirname(__file__),"..")
sys.path.insert(0,parentdir)
@@ -27,8 +28,8 @@
try:
servicemap = ServiceMap.objects.get(pk=pk)
service_uid = self.get_servicemap_uid(servicemap)
- self.config_push(service_uid, rrlib_config.REDIR_USER, "/opt/planetstack/rr_observer/playbook/site_redir_delete.yml", "/etc/ansible/requestrouter/dnsredir/hosts")
- self.config_push(service_uid, rrlib_config.DEMUX_USER, "/opt/planetstack/rr_observer/playbook/site_demux_delete.yml", "/etc/ansible/requestrouter/dnsdemux/hosts")
+ self.config_push(service_uid, rrlib_config.REDIR_USER, XOS_DIR + "/rr_observer/playbook/site_redir_delete.yml", "/etc/ansible/requestrouter/dnsredir/hosts")
+ self.config_push(service_uid, rrlib_config.DEMUX_USER, XOS_DIR + "/rr_observer/playbook/site_demux_delete.yml", "/etc/ansible/requestrouter/dnsdemux/hosts")
print "XXX delete ServiceMap %s", servicemap.name
return True
except Exception, e:
diff --git a/planetstack/rr_observer/rrlib.py b/planetstack/rr_observer/rrlib.py
index 10a5171..ed5a836 100644
--- a/planetstack/rr_observer/rrlib.py
+++ b/planetstack/rr_observer/rrlib.py
@@ -5,7 +5,7 @@
import socket
from sets import Set
if __name__ == '__main__':
- sys.path.append("/opt/planetstack")
+ sys.path.append("/opt/xos")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
from planetstack.config import Config
diff --git a/planetstack/rr_observer/steps/sync_servicemap.py b/planetstack/rr_observer/steps/sync_servicemap.py
index 76d2fdd..6ab8c79 100644
--- a/planetstack/rr_observer/steps/sync_servicemap.py
+++ b/planetstack/rr_observer/steps/sync_servicemap.py
@@ -5,7 +5,7 @@
import base64
import traceback
from django.db.models import F, Q
-from planetstack.config import Config
+from planetstack.config import Config, XOS_DIR
from observer.syncstep import SyncStep
from core.models import Service
from requestrouter.models import ServiceMap
@@ -44,8 +44,8 @@
self.gen_dnsdemux_serviceconf(servicemap)
# push generated files from temp_config
service_uid = self.get_servicemap_uid(servicemap)
- self.config_push(service_uid, rrlib_config.REDIR_USER, "/opt/planetstack/rr_observer/playbook/site_redir.yml", "/etc/ansible/requestrouter/dnsredir/hosts")
- self.config_push(service_uid, rrlib_config.DEMUX_USER, "/opt/planetstack/rr_observer/playbook/site_demux.yml", "/etc/ansible/requestrouter/dnsdemux/hosts")
+ self.config_push(service_uid, rrlib_config.REDIR_USER, XOS_DIR + "/rr_observer/playbook/site_redir.yml", "/etc/ansible/requestrouter/dnsredir/hosts")
+ self.config_push(service_uid, rrlib_config.DEMUX_USER, XOS_DIR + "/rr_observer/playbook/site_demux.yml", "/etc/ansible/requestrouter/dnsdemux/hosts")
self.teardown_temp_configfiles(service_uid)
except Exception, e:
traceback.print_exc()
diff --git a/planetstack/syndicate_observer/run.sh b/planetstack/syndicate_observer/run.sh
index b8fb166..824a248 100644
--- a/planetstack/syndicate_observer/run.sh
+++ b/planetstack/syndicate_observer/run.sh
@@ -1,2 +1,2 @@
-export PYTHONPATH=/opt/planetstack
-python syndicate-backend.py -C /opt/planetstack/syndicate_observer/syndicate_observer_config
+export XOS_DIR=/opt/xos
+python syndicate-backend.py -C $XOS_DIR/syndicate_observer/syndicate_observer_config
diff --git a/planetstack/syndicate_observer/start.sh b/planetstack/syndicate_observer/start.sh
index ff45535..313d504 100644
--- a/planetstack/syndicate_observer/start.sh
+++ b/planetstack/syndicate_observer/start.sh
@@ -1 +1,2 @@
-nohup python syndicate-backend.py -C /opt/planetstack/syndicate_observer/syndicate_observer_config > /dev/null 2>&1 &
+export XOS_DIR=/opt/xos
+nohup python syndicate-backend.py -C $XOS_DIR/syndicate_observer/syndicate_observer_config > /dev/null 2>&1 &
diff --git a/planetstack/syndicate_observer/syndicatelib.py b/planetstack/syndicate_observer/syndicatelib.py
index d4844e8..6be7738 100644
--- a/planetstack/syndicate_observer/syndicatelib.py
+++ b/planetstack/syndicate_observer/syndicatelib.py
@@ -1332,7 +1332,7 @@
# run functional tests
if __name__ == "__main__":
- sys.path.append("/opt/planetstack")
+ sys.path.append("/opt/xos")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
if len(sys.argv) < 2:
diff --git a/planetstack/syndicate_observer/syndicatelib_config/config-opencloud.py b/planetstack/syndicate_observer/syndicatelib_config/config-opencloud.py
index 54000ff..4fb7fcc 100644
--- a/planetstack/syndicate_observer/syndicatelib_config/config-opencloud.py
+++ b/planetstack/syndicate_observer/syndicatelib_config/config-opencloud.py
@@ -36,7 +36,7 @@
# This is the location of the observer's private key. It must be an absolute
# path, and refer to a 4096-bit PEM-encoded RSA key.
-SYNDICATE_PRIVATE_KEY="/opt/planetstack/syndicate_observer/syndicatelib_config/pollserver.pem"
+SYNDICATE_PRIVATE_KEY="/opt/xos/syndicate_observer/syndicatelib_config/pollserver.pem"
# This is the master secret used to generate secrets to seal sensitive information sent to the
# Syndicate sliver mount daemons. It is also used to seal sensitive information
diff --git a/planetstack/syndicate_observer/syndicatelib_config/config.py b/planetstack/syndicate_observer/syndicatelib_config/config.py
index 54000ff..4fb7fcc 100644
--- a/planetstack/syndicate_observer/syndicatelib_config/config.py
+++ b/planetstack/syndicate_observer/syndicatelib_config/config.py
@@ -36,7 +36,7 @@
# This is the location of the observer's private key. It must be an absolute
# path, and refer to a 4096-bit PEM-encoded RSA key.
-SYNDICATE_PRIVATE_KEY="/opt/planetstack/syndicate_observer/syndicatelib_config/pollserver.pem"
+SYNDICATE_PRIVATE_KEY="/opt/xos/syndicate_observer/syndicatelib_config/pollserver.pem"
# This is the master secret used to generate secrets to seal sensitive information sent to the
# Syndicate sliver mount daemons. It is also used to seal sensitive information
diff --git a/planetstack/tests/GetConfiguration.py b/planetstack/tests/GetConfiguration.py
index 55d2467..d0d36d2 100644
--- a/planetstack/tests/GetConfiguration.py
+++ b/planetstack/tests/GetConfiguration.py
@@ -4,7 +4,7 @@
import sys
import time
-sys.path.append("/opt/planetstack")
+sys.path.append("/opt/xos")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
from openstack.manager import OpenStackManager
diff --git a/planetstack/tests/generate_billing_sample.py b/planetstack/tests/generate_billing_sample.py
index fd6d1ea..01b8919 100644
--- a/planetstack/tests/generate_billing_sample.py
+++ b/planetstack/tests/generate_billing_sample.py
@@ -21,7 +21,7 @@
MONTH_SECONDS = DAY_SECONDS * 30
# XXX hardcoded path
-sys.path.append("/opt/planetstack")
+sys.path.append("/opt/xos")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
#from openstack.manager import OpenStackManager
diff --git a/planetstack/tests/networktest.py b/planetstack/tests/networktest.py
index 7f3cf70..131db5a 100644
--- a/planetstack/tests/networktest.py
+++ b/planetstack/tests/networktest.py
@@ -15,7 +15,7 @@
import sys
import time
-sys.path.append("/opt/planetstack")
+sys.path.append("/opt/xos")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
from openstack.manager import OpenStackManager
diff --git a/planetstack/tests/planetstacktest.py b/planetstack/tests/planetstacktest.py
index 77ed95f..7174331 100644
--- a/planetstack/tests/planetstacktest.py
+++ b/planetstack/tests/planetstacktest.py
@@ -3,7 +3,7 @@
import sys
import time
-sys.path.append("/opt/planetstack")
+sys.path.append("/opt/xos")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
from openstack.manager import OpenStackManager
diff --git a/planetstack/tests/slivertest.py b/planetstack/tests/slivertest.py
index 271fe5b..c0fea7e 100644
--- a/planetstack/tests/slivertest.py
+++ b/planetstack/tests/slivertest.py
@@ -10,7 +10,7 @@
import sys
import time
-sys.path.append("/opt/planetstack")
+sys.path.append("/opt/xos")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
from openstack.manager import OpenStackManager