rename planetstack module to xos
diff --git a/planetstack/core/dashboard/views/view_common.py b/planetstack/core/dashboard/views/view_common.py
index deb8210..7d59278 100644
--- a/planetstack/core/dashboard/views/view_common.py
+++ b/planetstack/core/dashboard/views/view_common.py
@@ -18,7 +18,7 @@
from operator import itemgetter, attrgetter
import traceback
import math
-from planetstack.config import Config, XOS_DIR
+from xos.config import Config, XOS_DIR
def getDashboardContext(user, context={}, tableFormat = False):
context = {}
diff --git a/planetstack/core/middleware.py b/planetstack/core/middleware.py
index 54267e3..4cfd991 100644
--- a/planetstack/core/middleware.py
+++ b/planetstack/core/middleware.py
@@ -4,7 +4,7 @@
def get_request():
if not hasattr(_active, "request"):
- raise Exception("Please add 'core.middleware.GlobalRequestMiddleware' to <XOS_DIR>/planetstack/settings.py:MIDDLEWARE_CLASSES")
+ raise Exception("Please add 'core.middleware.GlobalRequestMiddleware' to <XOS_DIR>/xos.settings.py:MIDDLEWARE_CLASSES")
return _active.request
class GlobalRequestMiddleware(object):
diff --git a/planetstack/core/models/site.py b/planetstack/core/models/site.py
index 2a41352..d1f04dd 100644
--- a/planetstack/core/models/site.py
+++ b/planetstack/core/models/site.py
@@ -6,7 +6,7 @@
from django.contrib.contenttypes import generic
from geoposition.fields import GeopositionField
from core.acl import AccessControlList
-from planetstack.config import Config
+from xos.config import Config
config = Config()
diff --git a/planetstack/core/models/sliver.py b/planetstack/core/models/sliver.py
index 62e487b..0173887 100644
--- a/planetstack/core/models/sliver.py
+++ b/planetstack/core/models/sliver.py
@@ -13,7 +13,7 @@
from core.models import Tag
from core.models import Flavor
from django.contrib.contenttypes import generic
-from planetstack.config import Config
+from xos.config import Config
from monitor import driver as monitor
config = Config()
diff --git a/planetstack/core/views/legacyapi.py b/planetstack/core/views/legacyapi.py
index 978fd21..520f137 100644
--- a/planetstack/core/views/legacyapi.py
+++ b/planetstack/core/views/legacyapi.py
@@ -298,6 +298,6 @@
configs={}
configs[slicename] = GetConfiguration({"name": "princeton_vcoblitz"})
- file("planetstack_config","w").write(json.dumps(configs))
+ file("xos.config","w").write(json.dumps(configs))
file("planetstack_slices","w").write(json.dumps(slices))
file("planetstack_nodes","w").write(json.dumps(nodes))
diff --git a/planetstack/core/xoslib/tools/make_defaults.py b/planetstack/core/xoslib/tools/make_defaults.py
index 04fccc0..e008845 100644
--- a/planetstack/core/xoslib/tools/make_defaults.py
+++ b/planetstack/core/xoslib/tools/make_defaults.py
@@ -3,7 +3,7 @@
XOS_DIR="/opt/xos"
os.chdir(XOS_DIR)
sys.path.append(XOS_DIR)
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
import django
import core.models
from django.db import models
diff --git a/planetstack/core/xoslib/tools/make_validators.py b/planetstack/core/xoslib/tools/make_validators.py
index f627457..44ef43a 100644
--- a/planetstack/core/xoslib/tools/make_validators.py
+++ b/planetstack/core/xoslib/tools/make_validators.py
@@ -3,7 +3,7 @@
XOS_DIR="/opt/xos"
os.chdir(XOS_DIR)
sys.path.append(XOS_DIR)
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
import django
import core.models
from django.db import models
diff --git a/planetstack/dependency_walker.py b/planetstack/dependency_walker.py
index 46fe655..0b23136 100644
--- a/planetstack/dependency_walker.py
+++ b/planetstack/dependency_walker.py
@@ -2,7 +2,7 @@
import os
import imp
-from planetstack.config import Config, XOS_DIR
+from xos.config import Config, XOS_DIR
import inspect
import time
import traceback
diff --git a/planetstack/ec2_observer/__init__.py b/planetstack/ec2_observer/__init__.py
index d9a63be..f4c7743 100644
--- a/planetstack/ec2_observer/__init__.py
+++ b/planetstack/ec2_observer/__init__.py
@@ -1,4 +1,4 @@
-from planetstack.config import Config
+from xos.config import Config
try:
observer_disabled = Config().observer_disabled
diff --git a/planetstack/ec2_observer/deleter.py b/planetstack/ec2_observer/deleter.py
index e088558..f7d459d 100644
--- a/planetstack/ec2_observer/deleter.py
+++ b/planetstack/ec2_observer/deleter.py
@@ -1,6 +1,6 @@
import os
import base64
-from planetstack.config import Config
+from xos.config import Config
class Deleter:
model=None # Must be overridden
diff --git a/planetstack/ec2_observer/error_mapper.py b/planetstack/ec2_observer/error_mapper.py
index a7daa59..3039a56 100644
--- a/planetstack/ec2_observer/error_mapper.py
+++ b/planetstack/ec2_observer/error_mapper.py
@@ -1,4 +1,4 @@
-from planetstack.config import Config
+from xos.config import Config
from util.logger import Logger, logging, logger
class ErrorMapper:
diff --git a/planetstack/ec2_observer/event_loop.py b/planetstack/ec2_observer/event_loop.py
index fb5f973..fea2e3e 100644
--- a/planetstack/ec2_observer/event_loop.py
+++ b/planetstack/ec2_observer/event_loop.py
@@ -16,7 +16,7 @@
from openstack.driver import OpenStackDriver
from util.logger import Logger, logging, logger
#from timeout import timeout
-from planetstack.config import Config, XOS_DIR
+from xos.config import Config, XOS_DIR
from observer.steps import *
from syncstep import SyncStep
from toposort import toposort
diff --git a/planetstack/ec2_observer/event_manager.py b/planetstack/ec2_observer/event_manager.py
index 190d4eb..fc07f64 100644
--- a/planetstack/ec2_observer/event_manager.py
+++ b/planetstack/ec2_observer/event_manager.py
@@ -1,7 +1,7 @@
import threading
import requests, json
-from planetstack.config import Config, XOS_DIR
+from xos.config import Config, XOS_DIR
import uuid
import os
diff --git a/planetstack/ec2_observer/steps/sync_deployments.py b/planetstack/ec2_observer/steps/sync_deployments.py
index 76eeb1f..097a6e9 100644
--- a/planetstack/ec2_observer/steps/sync_deployments.py
+++ b/planetstack/ec2_observer/steps/sync_deployments.py
@@ -1,7 +1,7 @@
import os
import base64
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from ec2_observer.syncstep import SyncStep
from core.models.site import *
diff --git a/planetstack/ec2_observer/steps/sync_images.py b/planetstack/ec2_observer/steps/sync_images.py
index b494c06..c3dc5a1 100644
--- a/planetstack/ec2_observer/steps/sync_images.py
+++ b/planetstack/ec2_observer/steps/sync_images.py
@@ -1,7 +1,7 @@
import os
import base64
from django.db.models import F, Q
-from planetstack.config import Config, XOS_DIR
+from xos.config import Config, XOS_DIR
from ec2_observer.syncstep import SyncStep
from core.models.image import Image
from ec2_observer.awslib import *
diff --git a/planetstack/ec2_observer/steps/sync_site_deployments.py b/planetstack/ec2_observer/steps/sync_site_deployments.py
index 5adccb7..ef66783 100644
--- a/planetstack/ec2_observer/steps/sync_site_deployments.py
+++ b/planetstack/ec2_observer/steps/sync_site_deployments.py
@@ -1,7 +1,7 @@
import os
import base64
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from ec2_observer.syncstep import SyncStep
from core.models.site import *
from ec2_observer.awslib import *
diff --git a/planetstack/ec2_observer/steps/sync_sites.py b/planetstack/ec2_observer/steps/sync_sites.py
index 0959c71..d139cc5 100644
--- a/planetstack/ec2_observer/steps/sync_sites.py
+++ b/planetstack/ec2_observer/steps/sync_sites.py
@@ -1,7 +1,7 @@
import os
import base64
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from ec2_observer.syncstep import SyncStep
from core.models.site import *
from ec2_observer.awslib import *
diff --git a/planetstack/ec2_observer/steps/sync_slivers.py b/planetstack/ec2_observer/steps/sync_slivers.py
index 15cd5eb..a86b4c4 100644
--- a/planetstack/ec2_observer/steps/sync_slivers.py
+++ b/planetstack/ec2_observer/steps/sync_slivers.py
@@ -2,7 +2,7 @@
import json
import base64
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from ec2_observer.syncstep import SyncStep
from core.models.sliver import Sliver
from core.models.slice import SlicePrivilege, SliceDeployments
diff --git a/planetstack/ec2_observer/steps/sync_users.py b/planetstack/ec2_observer/steps/sync_users.py
index 10ebd60..5fe70c7 100644
--- a/planetstack/ec2_observer/steps/sync_users.py
+++ b/planetstack/ec2_observer/steps/sync_users.py
@@ -4,7 +4,7 @@
import time
from datetime import datetime
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from ec2_observer.syncstep import SyncStep
from core.models.user import User
from core.models.site import *
diff --git a/planetstack/ec2_observer/syncstep.py b/planetstack/ec2_observer/syncstep.py
index 31fec04..c6ed066 100644
--- a/planetstack/ec2_observer/syncstep.py
+++ b/planetstack/ec2_observer/syncstep.py
@@ -1,7 +1,7 @@
import os
import base64
from datetime import datetime
-from planetstack.config import Config
+from xos.config import Config
from util.logger import Logger, logging
from observer.steps import *
diff --git a/planetstack/hpc_observer/fsck.py b/planetstack/hpc_observer/fsck.py
index 817d616..2fbb002 100644
--- a/planetstack/hpc_observer/fsck.py
+++ b/planetstack/hpc_observer/fsck.py
@@ -4,9 +4,9 @@
import inspect
import os
import sys
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
sys.path.append("/opt/xos")
-from planetstack.config import Config, DEFAULT_CONFIG_FN, XOS_DIR
+from xos.config import Config, DEFAULT_CONFIG_FN, XOS_DIR
from util.logger import Logger, logging
from observer.syncstep import SyncStep
diff --git a/planetstack/hpc_observer/hpclib.py b/planetstack/hpc_observer/hpclib.py
index 7986540..5ec08a4 100644
--- a/planetstack/hpc_observer/hpclib.py
+++ b/planetstack/hpc_observer/hpclib.py
@@ -6,9 +6,9 @@
if __name__ == '__main__':
sys.path.append("/opt/xos")
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
-from planetstack.config import Config
+from xos.config import Config
from core.models import Service
from hpc.models import HpcService
from requestrouter.models import RequestRouterService
diff --git a/planetstack/hpc_observer/steps/garbage_collector.py b/planetstack/hpc_observer/steps/garbage_collector.py
index bf99da7..3ccffee 100644
--- a/planetstack/hpc_observer/steps/garbage_collector.py
+++ b/planetstack/hpc_observer/steps/garbage_collector.py
@@ -4,7 +4,7 @@
import traceback
from collections import defaultdict
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from util.logger import Logger, logging
from observer.syncstep import SyncStep
from hpc.models import ServiceProvider, ContentProvider, CDNPrefix, OriginServer
diff --git a/planetstack/hpc_observer/steps/sync_cdnprefix.py b/planetstack/hpc_observer/steps/sync_cdnprefix.py
index dfa6ef8..8333448 100644
--- a/planetstack/hpc_observer/steps/sync_cdnprefix.py
+++ b/planetstack/hpc_observer/steps/sync_cdnprefix.py
@@ -2,7 +2,7 @@
import sys
import base64
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.syncstep import SyncStep
from core.models import Service
from hpc.models import ServiceProvider, ContentProvider, CDNPrefix
diff --git a/planetstack/hpc_observer/steps/sync_contentprovider.py b/planetstack/hpc_observer/steps/sync_contentprovider.py
index b3c2f66..39c15de 100644
--- a/planetstack/hpc_observer/steps/sync_contentprovider.py
+++ b/planetstack/hpc_observer/steps/sync_contentprovider.py
@@ -2,7 +2,7 @@
import sys
import base64
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.syncstep import SyncStep
from core.models import Service
from hpc.models import ServiceProvider, ContentProvider
diff --git a/planetstack/hpc_observer/steps/sync_hpcservices.py b/planetstack/hpc_observer/steps/sync_hpcservices.py
index d8d7ba5..c5e2679 100644
--- a/planetstack/hpc_observer/steps/sync_hpcservices.py
+++ b/planetstack/hpc_observer/steps/sync_hpcservices.py
@@ -2,7 +2,7 @@
import sys
import base64
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.syncstep import SyncStep
from core.models import Service
from hpc.models import HpcService
diff --git a/planetstack/hpc_observer/steps/sync_originserver.py b/planetstack/hpc_observer/steps/sync_originserver.py
index d18c672..405a8a5 100644
--- a/planetstack/hpc_observer/steps/sync_originserver.py
+++ b/planetstack/hpc_observer/steps/sync_originserver.py
@@ -3,7 +3,7 @@
import base64
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.syncstep import SyncStep
from core.models import Service
from hpc.models import ServiceProvider, ContentProvider, CDNPrefix, OriginServer
diff --git a/planetstack/hpc_observer/steps/sync_serviceprovider.py b/planetstack/hpc_observer/steps/sync_serviceprovider.py
index ca0ba6a..ac1fc69 100644
--- a/planetstack/hpc_observer/steps/sync_serviceprovider.py
+++ b/planetstack/hpc_observer/steps/sync_serviceprovider.py
@@ -2,7 +2,7 @@
import sys
import base64
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.syncstep import SyncStep
from core.models import Service
from hpc.models import ServiceProvider
diff --git a/planetstack/hpc_wizard/planetstack_analytics.py b/planetstack/hpc_wizard/planetstack_analytics.py
index 06a083b..2728f27 100644
--- a/planetstack/hpc_wizard/planetstack_analytics.py
+++ b/planetstack/hpc_wizard/planetstack_analytics.py
@@ -11,7 +11,7 @@
# XXX hardcoded path
sys.path.append("/opt/xos")
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
from django.conf import settings
from django import db
from django.db import connection
diff --git a/planetstack/importer/plclassic/importer.py b/planetstack/importer/plclassic/importer.py
index 3a65dc3..864f4b9 100644
--- a/planetstack/importer/plclassic/importer.py
+++ b/planetstack/importer/plclassic/importer.py
@@ -1,5 +1,5 @@
import os
-#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
import sys
from optparse import OptionParser
from getpass import getpass
diff --git a/planetstack/manage.py b/planetstack/manage.py
index 4a7e2df..0ddd014 100644
--- a/planetstack/manage.py
+++ b/planetstack/manage.py
@@ -3,7 +3,7 @@
import sys
if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
from django.core.management import execute_from_command_line
diff --git a/planetstack/monitor/__init__.py b/planetstack/monitor/__init__.py
index d29d017..6debf82 100644
--- a/planetstack/monitor/__init__.py
+++ b/planetstack/monitor/__init__.py
@@ -1,4 +1,4 @@
-from planetstack.settings import STATISTICS_DRIVER
+from xos.settings import STATISTICS_DRIVER
if (STATISTICS_DRIVER=="ceilometer"):
from observer import ceilometer
diff --git a/planetstack/openstack/client.py b/planetstack/openstack/client.py
index 0aa6c7d..4962e06 100644
--- a/planetstack/openstack/client.py
+++ b/planetstack/openstack/client.py
@@ -9,7 +9,7 @@
except:
has_openstack = False
-from planetstack.config import Config
+from xos.config import Config
def require_enabled(callable):
def wrapper(*args, **kwds):
diff --git a/planetstack/openstack/driver.py b/planetstack/openstack/driver.py
index 2edf10e..02d49f9 100644
--- a/planetstack/openstack/driver.py
+++ b/planetstack/openstack/driver.py
@@ -1,6 +1,6 @@
import commands
import hashlib
-from planetstack.config import Config
+from xos.config import Config
from core.models import Controller
try:
diff --git a/planetstack/openstack/manager.py b/planetstack/openstack/manager.py
index c1647e8..441a18e 100644
--- a/planetstack/openstack/manager.py
+++ b/planetstack/openstack/manager.py
@@ -1,15 +1,15 @@
import os
-#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
import string
import random
import hashlib
from datetime import datetime
from netaddr import IPAddress, IPNetwork
-from planetstack import settings
+from xos import settings
from django.core import management
from core.models import *
-from planetstack.config import Config
+from xos.config import Config
try:
from openstack.client import OpenStackClient
from openstack.driver import OpenStackDriver
diff --git a/planetstack/openstack/reservationagent.py b/planetstack/openstack/reservationagent.py
index 0fe406b..cee5269 100644
--- a/planetstack/openstack/reservationagent.py
+++ b/planetstack/openstack/reservationagent.py
@@ -1,7 +1,7 @@
import datetime
import os
import sys
-#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
import time
import django.utils
from core.models.sliver import Sliver
diff --git a/planetstack/openstack/sliveragent.py b/planetstack/openstack/sliveragent.py
index b2f29cf..4aea44d 100644
--- a/planetstack/openstack/sliveragent.py
+++ b/planetstack/openstack/sliveragent.py
@@ -1,6 +1,6 @@
import os
import sys
-#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
import time
from core.models.sliver import Sliver
from openstack.manager import OpenStackManager
diff --git a/planetstack/openstack_observer/__init__.py b/planetstack/openstack_observer/__init__.py
index 5d6ea79..e56cd39 100644
--- a/planetstack/openstack_observer/__init__.py
+++ b/planetstack/openstack_observer/__init__.py
@@ -1,4 +1,4 @@
-from planetstack.config import Config
+from xos.config import Config
try:
observer_disabled = Config().observer_disabled
diff --git a/planetstack/openstack_observer/ansible.py b/planetstack/openstack_observer/ansible.py
index 0459cb9..f8ed547 100644
--- a/planetstack/openstack_observer/ansible.py
+++ b/planetstack/openstack_observer/ansible.py
@@ -9,7 +9,7 @@
import re
# XXX hardcoded path
-# is there any reason why we aren't importing planetstack.config ?
+# is there any reason why we aren't importing xos.config ?
XOS_DIR="/opt/xos"
try:
diff --git a/planetstack/openstack_observer/deleter.py b/planetstack/openstack_observer/deleter.py
index e088558..f7d459d 100644
--- a/planetstack/openstack_observer/deleter.py
+++ b/planetstack/openstack_observer/deleter.py
@@ -1,6 +1,6 @@
import os
import base64
-from planetstack.config import Config
+from xos.config import Config
class Deleter:
model=None # Must be overridden
diff --git a/planetstack/openstack_observer/error_mapper.py b/planetstack/openstack_observer/error_mapper.py
index a7daa59..3039a56 100644
--- a/planetstack/openstack_observer/error_mapper.py
+++ b/planetstack/openstack_observer/error_mapper.py
@@ -1,4 +1,4 @@
-from planetstack.config import Config
+from xos.config import Config
from util.logger import Logger, logging, logger
class ErrorMapper:
diff --git a/planetstack/openstack_observer/event_loop.py b/planetstack/openstack_observer/event_loop.py
index 0d1486d..752cb86 100644
--- a/planetstack/openstack_observer/event_loop.py
+++ b/planetstack/openstack_observer/event_loop.py
@@ -20,7 +20,7 @@
from openstack.driver import OpenStackDriver
from util.logger import Logger, logging, logger
#from timeout import timeout
-from planetstack.config import Config, XOS_DIR
+from xos.config import Config, XOS_DIR
from observer.steps import *
from syncstep import SyncStep
from toposort import toposort
diff --git a/planetstack/openstack_observer/event_manager.py b/planetstack/openstack_observer/event_manager.py
index 190d4eb..fc07f64 100644
--- a/planetstack/openstack_observer/event_manager.py
+++ b/planetstack/openstack_observer/event_manager.py
@@ -1,7 +1,7 @@
import threading
import requests, json
-from planetstack.config import Config, XOS_DIR
+from xos.config import Config, XOS_DIR
import uuid
import os
diff --git a/planetstack/openstack_observer/steps/sync_controller_images.py b/planetstack/openstack_observer/steps/sync_controller_images.py
index e076d81..fa4bd35 100644
--- a/planetstack/openstack_observer/steps/sync_controller_images.py
+++ b/planetstack/openstack_observer/steps/sync_controller_images.py
@@ -2,7 +2,7 @@
import base64
from collections import defaultdict
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models import Controller
from core.models import Image, ControllerImages
diff --git a/planetstack/openstack_observer/steps/sync_controller_networks.py b/planetstack/openstack_observer/steps/sync_controller_networks.py
index 83cf8ea..242073d 100644
--- a/planetstack/openstack_observer/steps/sync_controller_networks.py
+++ b/planetstack/openstack_observer/steps/sync_controller_networks.py
@@ -3,7 +3,7 @@
from collections import defaultdict
from netaddr import IPAddress, IPNetwork
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models.network import *
from core.models.slice import *
diff --git a/planetstack/openstack_observer/steps/sync_controller_site_privileges.py b/planetstack/openstack_observer/steps/sync_controller_site_privileges.py
index 0ea86e1..e58f9a1 100644
--- a/planetstack/openstack_observer/steps/sync_controller_site_privileges.py
+++ b/planetstack/openstack_observer/steps/sync_controller_site_privileges.py
@@ -2,7 +2,7 @@
import base64
from collections import defaultdict
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models.site import Controller, SitePrivilege
from core.models.user import User
diff --git a/planetstack/openstack_observer/steps/sync_controller_sites.py b/planetstack/openstack_observer/steps/sync_controller_sites.py
index f7905c9..9aa6c5b 100644
--- a/planetstack/openstack_observer/steps/sync_controller_sites.py
+++ b/planetstack/openstack_observer/steps/sync_controller_sites.py
@@ -1,7 +1,7 @@
import os
import base64
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from openstack_observer.openstacksyncstep import OpenStackSyncStep
from core.models.site import *
from observer.ansible import *
diff --git a/planetstack/openstack_observer/steps/sync_controller_slice_privileges.py b/planetstack/openstack_observer/steps/sync_controller_slice_privileges.py
index 99000ea..96156f7 100644
--- a/planetstack/openstack_observer/steps/sync_controller_slice_privileges.py
+++ b/planetstack/openstack_observer/steps/sync_controller_slice_privileges.py
@@ -2,7 +2,7 @@
import base64
from collections import defaultdict
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models.slice import Controller, SlicePrivilege
from core.models.user import User
diff --git a/planetstack/openstack_observer/steps/sync_controller_slices.py b/planetstack/openstack_observer/steps/sync_controller_slices.py
index 0c24ae1..df44fa5 100644
--- a/planetstack/openstack_observer/steps/sync_controller_slices.py
+++ b/planetstack/openstack_observer/steps/sync_controller_slices.py
@@ -3,7 +3,7 @@
from collections import defaultdict
from netaddr import IPAddress, IPNetwork
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models.slice import Slice, ControllerSlice
from core.models.controlleruser import ControllerUser
diff --git a/planetstack/openstack_observer/steps/sync_controller_users.py b/planetstack/openstack_observer/steps/sync_controller_users.py
index 08123fe..43053b7 100644
--- a/planetstack/openstack_observer/steps/sync_controller_users.py
+++ b/planetstack/openstack_observer/steps/sync_controller_users.py
@@ -2,7 +2,7 @@
import base64
from collections import defaultdict
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models.site import Controller, SiteDeployment, SiteDeployment
from core.models.user import User
diff --git a/planetstack/openstack_observer/steps/sync_images.py b/planetstack/openstack_observer/steps/sync_images.py
new file mode 100644
index 0000000..f5764a1
--- /dev/null
+++ b/planetstack/openstack_observer/steps/sync_images.py
@@ -0,0 +1,43 @@
+import os
+import base64
+from django.db.models import F, Q
+from xos.config import Config
+from observer.openstacksyncstep import OpenStackSyncStep
+from core.models.image import Image
+
+class SyncImages(OpenStackSyncStep):
+ provides=[Image]
+ requested_interval=0
+ observes=Image
+
+ def fetch_pending(self, deleted):
+ # Images come from the back end
+ # You can't delete them
+ if (deleted):
+ return []
+
+ # get list of images on disk
+ images_path = Config().observer_images_directory
+ available_images = {}
+ for f in os.listdir(images_path):
+ if os.path.isfile(os.path.join(images_path ,f)):
+ available_images[f] = os.path.join(images_path ,f)
+
+ images = Image.objects.all()
+ image_names = [image.name for image in images]
+
+ for image_name in available_images:
+ #remove file extension
+ clean_name = ".".join(image_name.split('.')[:-1])
+ if clean_name not in image_names:
+ image = Image(name=clean_name,
+ disk_format='raw',
+ container_format='bare',
+ path = available_images[image_name])
+ image.save()
+
+
+ return Image.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
+
+ def sync_record(self, image):
+ image.save()
diff --git a/planetstack/openstack_observer/steps/sync_network_slivers.py b/planetstack/openstack_observer/steps/sync_network_slivers.py
index 7406fb2..535e7a4 100644
--- a/planetstack/openstack_observer/steps/sync_network_slivers.py
+++ b/planetstack/openstack_observer/steps/sync_network_slivers.py
@@ -1,7 +1,7 @@
import os
import base64
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models import Controller
from core.models.network import *
diff --git a/planetstack/openstack_observer/steps/sync_roles.py b/planetstack/openstack_observer/steps/sync_roles.py
new file mode 100644
index 0000000..0bd26c6
--- /dev/null
+++ b/planetstack/openstack_observer/steps/sync_roles.py
@@ -0,0 +1,42 @@
+import os
+import base64
+from django.db.models import F, Q
+from xos.config import Config
+from observer.openstacksyncstep import OpenStackSyncStep
+from core.models.role import Role
+from core.models.site import SiteRole, Controller, ControllerRole
+from core.models.slice import SliceRole
+
+class SyncRoles(OpenStackSyncStep):
+ provides=[Role]
+ requested_interval=0
+ observes=Role
+
+ def fetch_pending(self, deleted):
+ # Deleting roles is not supported yet
+ if (deleted):
+ return []
+
+ site_roles = SiteRole.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
+ slice_roles = SliceRole.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
+ controller_roles = ControllerRole.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
+
+ roles = []
+ for site_role in site_roles:
+ roles.append(site_role)
+ for slice_role in slice_roles:
+ roles.append(slice_role)
+ for controller_role in controller_roles:
+ roles.append(controller_role)
+
+ return roles
+
+
+ def sync_record(self, role):
+ if not role.enacted:
+ controllers = Controller.objects.all()
+ for controller in controllers:
+ driver = self.driver.admin_driver(controller=controller)
+ driver.create_role(role.role)
+ role.save()
+
diff --git a/planetstack/openstack_observer/steps/sync_slivers.py b/planetstack/openstack_observer/steps/sync_slivers.py
index 9a25c19..00e1691 100644
--- a/planetstack/openstack_observer/steps/sync_slivers.py
+++ b/planetstack/openstack_observer/steps/sync_slivers.py
@@ -2,7 +2,7 @@
import base64
import socket
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.openstacksyncstep import OpenStackSyncStep
from core.models.sliver import Sliver
from core.models.slice import Slice, SlicePrivilege, ControllerSlice
diff --git a/planetstack/openstack_observer/syncstep.py b/planetstack/openstack_observer/syncstep.py
index 2f75a32..0541c67 100644
--- a/planetstack/openstack_observer/syncstep.py
+++ b/planetstack/openstack_observer/syncstep.py
@@ -1,7 +1,7 @@
import os
import base64
from datetime import datetime
-from planetstack.config import Config
+from xos.config import Config
from util.logger import Logger, logging
from observer.steps import *
from django.db.models import F, Q
diff --git a/planetstack/rr_observer/deleters/servicemap_deleter.py b/planetstack/rr_observer/deleters/servicemap_deleter.py
index 60fe337..d0a707f 100644
--- a/planetstack/rr_observer/deleters/servicemap_deleter.py
+++ b/planetstack/rr_observer/deleters/servicemap_deleter.py
@@ -4,7 +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
+from xos.config import Config, XOS_DIR
parentdir = os.path.join(os.path.dirname(__file__),"..")
sys.path.insert(0,parentdir)
diff --git a/planetstack/rr_observer/rrlib.py b/planetstack/rr_observer/rrlib.py
index ed5a836..20c2341 100644
--- a/planetstack/rr_observer/rrlib.py
+++ b/planetstack/rr_observer/rrlib.py
@@ -6,9 +6,9 @@
from sets import Set
if __name__ == '__main__':
sys.path.append("/opt/xos")
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
-from planetstack.config import Config
+from xos.config import Config
from core.models import Service
from requestrouter.models import RequestRouterService, ServiceMap
from util.logger import Logger, logging
diff --git a/planetstack/rr_observer/steps/sync_requestrouterservices.py b/planetstack/rr_observer/steps/sync_requestrouterservices.py
index 546b45d..db63c5b 100644
--- a/planetstack/rr_observer/steps/sync_requestrouterservices.py
+++ b/planetstack/rr_observer/steps/sync_requestrouterservices.py
@@ -3,7 +3,7 @@
import base64
import traceback
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.syncstep import SyncStep
from core.models import Service
from requestrouter.models import RequestRouterService
diff --git a/planetstack/rr_observer/steps/sync_servicemap.py b/planetstack/rr_observer/steps/sync_servicemap.py
index f276bc4..1ec54aa 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, XOS_DIR
+from xos.config import Config, XOS_DIR
from observer.syncstep import SyncStep
from core.models import Service
from requestrouter.models import ServiceMap
diff --git a/planetstack/syndicate_observer/steps/sync_volume.py b/planetstack/syndicate_observer/steps/sync_volume.py
index 20060ca..726908c 100644
--- a/planetstack/syndicate_observer/steps/sync_volume.py
+++ b/planetstack/syndicate_observer/steps/sync_volume.py
@@ -12,11 +12,11 @@
else:
print >> sys.stderr, "No OPENCLOUD_PYTHONPATH variable set. Assuming that OpenCloud is in PYTHONPATH"
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.syncstep import SyncStep
from core.models import Service
from syndicate_storage.models import Volume
diff --git a/planetstack/syndicate_observer/steps/sync_volumeaccessright.py b/planetstack/syndicate_observer/steps/sync_volumeaccessright.py
index c1fef1c..e68b6af 100644
--- a/planetstack/syndicate_observer/steps/sync_volumeaccessright.py
+++ b/planetstack/syndicate_observer/steps/sync_volumeaccessright.py
@@ -12,10 +12,10 @@
else:
print >> sys.stderr, "No OPENCLOUD_PYTHONPATH variable set. Assuming that OpenCloud is in PYTHONPATH"
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.syncstep import SyncStep
from core.models import Service
diff --git a/planetstack/syndicate_observer/steps/sync_volumeslice.py b/planetstack/syndicate_observer/steps/sync_volumeslice.py
index 63b5e53..3217d7a 100644
--- a/planetstack/syndicate_observer/steps/sync_volumeslice.py
+++ b/planetstack/syndicate_observer/steps/sync_volumeslice.py
@@ -12,10 +12,10 @@
else:
print >> sys.stderr, "No OPENCLOUD_PYTHONPATH variable set. Assuming that OpenCloud is in PYTHONPATH"
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
from django.db.models import F, Q
-from planetstack.config import Config
+from xos.config import Config
from observer.syncstep import SyncStep
from core.models import Service, Slice
diff --git a/planetstack/syndicate_observer/syndicate-backend.py b/planetstack/syndicate_observer/syndicate-backend.py
index 7d94b67..32670d9 100644
--- a/planetstack/syndicate_observer/syndicate-backend.py
+++ b/planetstack/syndicate_observer/syndicate-backend.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
import os
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
from observer.backend import Backend
if __name__ == '__main__':
diff --git a/planetstack/syndicate_observer/syndicatelib.py b/planetstack/syndicate_observer/syndicatelib.py
index 09953cb..331e925 100644
--- a/planetstack/syndicate_observer/syndicatelib.py
+++ b/planetstack/syndicate_observer/syndicatelib.py
@@ -55,7 +55,7 @@
logger.warning("No OPENCLOUD_PYTHONPATH set. Assuming Syndicate models are in your PYTHONPATH")
try:
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
# get our models
import syndicate_storage.models as models
@@ -1333,7 +1333,7 @@
# run functional tests
if __name__ == "__main__":
sys.path.append("/opt/xos")
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
if len(sys.argv) < 2:
print "Usage: %s testname [args]" % sys.argv[0]
diff --git a/planetstack/tests/GetConfiguration.py b/planetstack/tests/GetConfiguration.py
index d0d36d2..74d9844 100644
--- a/planetstack/tests/GetConfiguration.py
+++ b/planetstack/tests/GetConfiguration.py
@@ -6,7 +6,7 @@
sys.path.append("/opt/xos")
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
from openstack.manager import OpenStackManager
from core.models import Slice, Sliver, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice
@@ -253,6 +253,6 @@
for slicename in ["princeton_vcoblitz"]:
configs[slicename] = GetConfiguration({"name": slicename})
- file("planetstack_config","w").write(json.dumps(configs))
+ file("xos.config","w").write(json.dumps(configs))
file("planetstack_slices","w").write(json.dumps(slices))
file("planetstack_nodes","w").write(json.dumps(nodes))
diff --git a/planetstack/tests/generate_billing_sample.py b/planetstack/tests/generate_billing_sample.py
index 01b8919..a8d3aae 100644
--- a/planetstack/tests/generate_billing_sample.py
+++ b/planetstack/tests/generate_billing_sample.py
@@ -23,7 +23,7 @@
# XXX hardcoded path
sys.path.append("/opt/xos")
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
#from openstack.manager import OpenStackManager
from core.models import Slice, Sliver, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice
from core.models import Invoice, Charge, Account, UsableObject, Payment
diff --git a/planetstack/tests/networktest.py b/planetstack/tests/networktest.py
index 131db5a..5390f0f 100644
--- a/planetstack/tests/networktest.py
+++ b/planetstack/tests/networktest.py
@@ -17,7 +17,7 @@
sys.path.append("/opt/xos")
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
from openstack.manager import OpenStackManager
from core.models import Slice, Sliver, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice
diff --git a/planetstack/tests/planetstacktest.py b/planetstack/tests/planetstacktest.py
index 7174331..99bd730 100644
--- a/planetstack/tests/planetstacktest.py
+++ b/planetstack/tests/planetstacktest.py
@@ -5,7 +5,7 @@
sys.path.append("/opt/xos")
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
from openstack.manager import OpenStackManager
from core.models import Slice, Sliver, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice
diff --git a/planetstack/tests/slivertest.py b/planetstack/tests/slivertest.py
index c0fea7e..60124fd 100644
--- a/planetstack/tests/slivertest.py
+++ b/planetstack/tests/slivertest.py
@@ -12,7 +12,7 @@
sys.path.append("/opt/xos")
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
from openstack.manager import OpenStackManager
from core.models import Slice, Sliver, ServiceClass, Reservation, Tag, Network, User, Node, Image, Deployment, Site, NetworkTemplate, NetworkSlice
diff --git a/planetstack/tools/init-xos.py b/planetstack/tools/init-xos.py
index de7d183..6860a62 100644
--- a/planetstack/tools/init-xos.py
+++ b/planetstack/tools/init-xos.py
@@ -1,7 +1,7 @@
import os
import sys
sys.path.append("/opt/xos")
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
import django
from core.models import *
django.setup()
diff --git a/planetstack/util/logger.py b/planetstack/util/logger.py
index e4137e7..b88d233 100644
--- a/planetstack/util/logger.py
+++ b/planetstack/util/logger.py
@@ -39,7 +39,7 @@
# default is to locate loggername from the logfile if avail.
if not logfile:
try:
- from planetstack.config import Config
+ from xos.config import Config
logfile = Config().observer_log_file
except:
logfile = "/var/log/planetstack.log"
diff --git a/planetstack/xos-config.py b/planetstack/xos-config.py
index e6f3d60..66f48f8 100755
--- a/planetstack/xos-config.py
+++ b/planetstack/xos-config.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
import sys
-from planetstack.config import Config
+from xos.config import Config
def help():
print "syntax: %s get name [default]" % sys.argv[0]
diff --git a/planetstack/xos-observer.py b/planetstack/xos-observer.py
index 1347e44..83a392a 100644
--- a/planetstack/xos-observer.py
+++ b/planetstack/xos-observer.py
@@ -1,9 +1,9 @@
#!/usr/bin/env python
import os
import argparse
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
from observer.backend import Backend
-from planetstack.config import Config, DEFAULT_CONFIG_FN
+from xos.config import Config, DEFAULT_CONFIG_FN
try:
from django import setup as django_setup # django 1.7
diff --git a/planetstack/planetstack/__init__.py b/planetstack/xos/__init__.py
similarity index 100%
rename from planetstack/planetstack/__init__.py
rename to planetstack/xos/__init__.py
diff --git a/planetstack/planetstack/config.py b/planetstack/xos/config.py
similarity index 100%
rename from planetstack/planetstack/config.py
rename to planetstack/xos/config.py
diff --git a/planetstack/planetstack/settings.py b/planetstack/xos/settings.py
similarity index 98%
rename from planetstack/planetstack/settings.py
rename to planetstack/xos/settings.py
index cae61aa..07fd850 100644
--- a/planetstack/planetstack/settings.py
+++ b/planetstack/xos/settings.py
@@ -114,10 +114,10 @@
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
-ROOT_URLCONF = 'planetstack.urls'
+ROOT_URLCONF = 'xos.urls'
# Python dotted path to the WSGI application used by Django's runserver.
-WSGI_APPLICATION = 'planetstack.wsgi.application'
+WSGI_APPLICATION = 'xos.wsgi.application'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
diff --git a/planetstack/planetstack/tests.py b/planetstack/xos/tests.py
similarity index 100%
rename from planetstack/planetstack/tests.py
rename to planetstack/xos/tests.py
diff --git a/planetstack/planetstack/urls.py b/planetstack/xos/urls.py
similarity index 100%
rename from planetstack/planetstack/urls.py
rename to planetstack/xos/urls.py
diff --git a/planetstack/planetstack/wsgi.py b/planetstack/xos/wsgi.py
similarity index 90%
rename from planetstack/planetstack/wsgi.py
rename to planetstack/xos/wsgi.py
index 6e03e11..1e27e10 100644
--- a/planetstack/planetstack/wsgi.py
+++ b/planetstack/xos/wsgi.py
@@ -18,8 +18,8 @@
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
-# os.environ["DJANGO_SETTINGS_MODULE"] = "planetstack.settings"
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+# os.environ["DJANGO_SETTINGS_MODULE"] = "xos.settings"
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION