Merge and update to new Dockerfile formats
diff --git a/containers/synchronizer/Dockerfile b/containers/synchronizer/Dockerfile
index 2f1e092..1ad43e1 100644
--- a/containers/synchronizer/Dockerfile
+++ b/containers/synchronizer/Dockerfile
@@ -2,5 +2,4 @@
# Supervisor
COPY conf/synchronizer.conf /etc/supervisor/conf.d/
-
CMD /usr/bin/supervisord -c /etc/supervisor/conf.d/synchronizer.conf
diff --git a/containers/xos/Dockerfile.base b/containers/xos/Dockerfile.base
index e430dc8..bb94ee2 100644
--- a/containers/xos/Dockerfile.base
+++ b/containers/xos/Dockerfile.base
@@ -1,7 +1,7 @@
# Dockerfile.base
# This image isn't used, but installs the prereqs for the other XOS images
-FROM ubuntu:14.04.3
+FROM ubuntu:14.04.4
# XXX Workaround for docker bug:
# https://github.com/docker/docker/issues/6345
@@ -33,6 +33,7 @@
python-httplib2 \
python-jinja2 \
python-keystoneclient \
+ python-netaddr \
python-neutronclient \
python-novaclient \
python-paramiko \
@@ -42,6 +43,7 @@
python-setuptools \
python-yaml \
rsync \
+ software-properties-common \
supervisor \
tar \
wget \
@@ -49,27 +51,32 @@
# Install python pacakges with pip
RUN pip install \
- django==1.7 \
+ ca-certs-locater \
+ "django>=1.8,<1.8.99" \
django-bitfield \
django-crispy-forms \
django-encrypted-fields \
django-extensions \
- django-filter==0.11.0 \
+ django-filter \
django-geoposition \
django-ipware \
- django_rest_swagger \
- django-suit==0.3a1 \
+ django-suit==0.3a3 \
django-timezones \
+ django_rest_swagger \
djangorestframework==3.3.3 \
dnslib \
+ google-api-python-client \
+ httplib2 \
jinja2 \
lxml \
markdown \
netaddr \
- pyOpenSSL \
psycopg2 \
+ pyOpenSSL \
+ pygraphviz \
python-ceilometerclient \
python-dateutil \
+ python-gflags \
python-keyczar \
python-logstash \
pygraphviz \
@@ -77,26 +84,26 @@
pyyaml \
requests
-# Upgrade jinja2
-RUN pip install -U \
- jinja2
+# Required for ansible 2.x OpenStack os_* modules
+RUN pip install --upgrade pbr && \
+ pip install --upgrade six && \
+ pip install shade
-# Installs with Easy install (should be incorporated into pip?)
-RUN easy_install --upgrade httplib2
+# Install ansible 2.x (has to be done after installing `software-properties-common`)
+RUN add-apt-repository ppa:ansible/ansible
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
+ ansible \
+ && rm -rf /var/lib/apt/lists/*
-RUN easy_install \
- python_gflags \
- google_api_python_client \
- httplib2.ca_certs_locater
+COPY ansible-hosts /etc/ansible/hosts
# jQuery download w/checksum
-ENV JQUERY_VERSION jquery-1.9.1.min.js
-ENV JQUERY_DL_URL http://code.jquery.com/jquery-1.9.1.min.js
-ENV JQUERY_SHA256 c12f6098e641aaca96c60215800f18f5671039aecf812217fab3c0d152f6adb4
+ENV JQUERY_DL_URL http://code.jquery.com/jquery-1.12.4.min.js
+ENV JQUERY_SHA256 668b046d12db350ccba6728890476b3efee53b2f42dbb84743e5e9f1ae0cc404
-RUN wget $JQUERY_DL_URL && \
- echo "$JQUERY_SHA256 $JQUERY_VERSION" | sha256sum -c - && \
- mv $JQUERY_VERSION /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
+RUN wget $JQUERY_DL_URL -o jquery.min.js && \
+ echo "$JQUERY_SHA256 jquery.min.js" | sha256sum -c - && \
+ mv jquery.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/jquery.min.js
# Install heat-translator for TOSCA support
ENV HT_REPO_URL https://github.com/openstack/heat-translator.git
@@ -110,24 +117,9 @@
echo > /opt/tosca/translator/__init__.py && \
rm -rf /tmp/heat-translator
-# Install custom Ansible
-RUN \
- git clone -b release1.8.2 git://github.com/ansible/ansible.git /opt/ansible && \
- git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/lib/ansible/modules/extras && \
- git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/v2/ansible/modules/extras && \
- git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/lib/ansible/modules/core && \
- git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/v2/ansible/modules/core && \
- # git clone uses cached copy, doesn't pick up latest
- git -C /opt/ansible pull && \
- git -C /opt/ansible/lib/ansible/modules/core pull && \
- git -C /opt/ansible/v2/ansible/modules/core pull && \
- mkdir -p /usr/local/share /bin /etc/ansible
-
-COPY ansible-hosts /etc/ansible/hosts
-
# For Synchronizer
-ENV PHANTOMJS_DL_URL http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-x86_64.tar.bz2
-ENV PHANTOMJS_SHA256 a7658f5f2d9464f86891afdb979eb60b754d5f404801db624368ac11e16724d4
+ENV PHANTOMJS_DL_URL https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
+ENV PHANTOMJS_SHA256 86dd9a4bf4aee45f1a84c9f61cf1947c1d6dce9b9e8d2a907105da7852460d2f
RUN curl -fLsS $PHANTOMJS_DL_URL -o phantomjs.tar.bz2 && \
echo "$PHANTOMJS_SHA256 phantomjs.tar.bz2" | sha256sum -c - && \
@@ -136,7 +128,3 @@
ln -s /usr/local/share/phantomjs/bin/phantomjs /bin/phantomjs && \
rm phantomjs.tar.bz2
-RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum && \
- cd /tmp/fofum; python setup.py install && \
- rm -rf /tmp/fofum
-
diff --git a/xos/configurations/common/Dockerfile.common b/xos/configurations/common/Dockerfile.common
deleted file mode 100644
index aedd245..0000000
--- a/xos/configurations/common/Dockerfile.common
+++ /dev/null
@@ -1,144 +0,0 @@
-FROM ubuntu:14.04.2
-MAINTAINER Andy Bavier <acb@cs.princeton.edu>
-
-# XXX Workaround for docker bug:
-# https://github.com/docker/docker/issues/6345
-# Kernel 3.15 breaks docker, uss the line below as a workaround
-# until there is a fix
-RUN ln -s -f /bin/true /usr/bin/chfn
-# XXX End workaround
-
-# Install.
-RUN apt-get update && apt-get install -y \
- git \
- postgresql \
- python-psycopg2 \
- graphviz \
- graphviz-dev \
- libxslt1.1 \
- libxslt1-dev \
- python-pip \
- tar \
- gcc \
- python-httplib2 \
- geoip-database \
- libgeoip1 \
- wget \
- curl \
- python-dev \
- libyaml-dev \
- pkg-config \
- python-pycurl
-
-RUN pip install django==1.7
-RUN pip install djangorestframework==2.4.4
-RUN pip install markdown # Markdown support for the browseable API.
-RUN pip install pyyaml # YAML content-type support.
-RUN pip install django-filter==0.11.0 # Filtering support
-RUN pip install lxml # XML manipulation library
-RUN pip install netaddr # IP Addr library
-RUN pip install pytz
-RUN pip install django-timezones
-RUN pip install requests
-RUN pip install python-logstash
-RUN pip install django-crispy-forms
-RUN pip install django-geoposition
-RUN pip install django-extensions
-RUN pip install django-suit==0.3a1
-RUN pip install django-bitfield
-RUN pip install django-ipware
-RUN pip install django-encrypted-fields
-RUN pip install python-keyczar
-RUN pip install pygraphviz --install-option="--include-path=/usr/include/graphviz" --install-option="--library-path=/usr/lib/graphviz/"
-RUN pip install dnslib
-
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-keystoneclient
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-novaclient
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-neutronclient
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-glanceclient
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-ceilometerclient
-
-RUN pip install django_rest_swagger
-
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-setuptools
-RUN easy_install python_gflags
-RUN easy_install --upgrade httplib2
-RUN easy_install google_api_python_client
-RUN easy_install httplib2.ca_certs_locater
-
-# Install custom Ansible
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-crypto
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-yaml
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-client
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-paramiko
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-jinja2
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-httplib2
-RUN git clone -b release1.8.2 git://github.com/ansible/ansible.git /opt/ansible
-RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/lib/ansible/modules/extras
-RUN git clone -b release1.8.2 git://github.com/ansible/ansible-modules-extras.git /opt/ansible/v2/ansible/modules/extras
-RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/lib/ansible/modules/core
-RUN git clone git://github.com/sb98052/ansible-modules-core.git /opt/ansible/v2/ansible/modules/core
-ADD ansible-hosts /etc/ansible/hosts
-
-ADD http://code.jquery.com/jquery-1.9.1.min.js /usr/local/lib/python2.7/dist-packages/suit/static/suit/js/
-
-# For Observer
-RUN git clone git://git.planet-lab.org/fofum.git /tmp/fofum
-RUN cd /tmp/fofum; python setup.py install
-RUN rm -rf /tmp/fofum
-
-RUN mkdir -p /usr/local/share /bin
-ADD http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-x86_64.tar.bz2 /usr/local/share/
-RUN tar jxvf /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2 -C /usr/local/share/
-RUN rm -f /usr/local/share/phantomjs-1.7.0-linux-x86_64.tar.bz2
-RUN ln -s /usr/local/share/phantomjs-1.7.0-linux-x86_64 /usr/local/share/phantomjs
-RUN ln -s /usr/local/share/phantomjs/bin/phantomjs /bin/phantomjs
-
-# Supervisor
-RUN DEBIAN_FRONTEND=noninteractive apt-get install -y supervisor
-ADD observer.conf /etc/supervisor/conf.d/
-
-# Get XOS
-ADD xos /opt/xos
-
-# Initscript is broken in Ubuntu
-#ADD observer-initscript /etc/init.d/xosobserver
-
-RUN chmod +x /opt/xos/tools/xos-manage
-RUN /opt/xos/tools/xos-manage genkeys
-
-# Workaround for AUFS issue
-# https://github.com/docker/docker/issues/783#issuecomment-56013588
-RUN mkdir /etc/ssl/private-copy; mv /etc/ssl/private/* /etc/ssl/private-copy/; rm -r /etc/ssl/private; mv /etc/ssl/private-copy /etc/ssl/private; chmod -R 0700 /etc/ssl/private; chown -R postgres /etc/ssl/private
-
-# Set postgres password to match default value in settings.py
-RUN service postgresql start; sudo -u postgres psql -c "alter user postgres with password 'password';"
-
-# Turn DEBUG on so that devel server will serve static files
-# (not necessary if --insecure is passed to 'manage.py runserver')
-# RUN sed -i 's/DEBUG = False/DEBUG = True/' /opt/xos/xos/settings.py
-
-# Cruft to workaround problems with migrations, should go away...
-RUN /opt/xos/tools/xos-manage remigrate
-
-# git clone uses cached copy, doesn't pick up latest
-RUN git -C /opt/ansible pull
-RUN git -C /opt/ansible/lib/ansible/modules/core pull
-RUN git -C /opt/ansible/v2/ansible/modules/core pull
-
-# install Tosca engine
-RUN apt-get install -y m4
-RUN pip install python-dateutil
-RUN bash /opt/xos/tosca/install_tosca.sh
-
-EXPOSE 8000
-
-# Set environment variables.
-ENV HOME /root
-
-# Define working directory.
-WORKDIR /root
-
-# Define default command.
-#CMD ["/bin/bash"]
-#CMD /opt/xos/tools/docker_start_xos
diff --git a/xos/configurations/cord-pod/xos_cord_config b/xos/configurations/cord-pod/xos_cord_config
index a5448f7..4d2d13b 100644
--- a/xos/configurations/cord-pod/xos_cord_config
+++ b/xos/configurations/cord-pod/xos_cord_config
@@ -4,3 +4,7 @@
branding_icon=/static/cord-logo.png
branding_favicon=/static/cord-favicon.png
branding_bg=/static/cord-bg.jpg
+
+[nova]
+admin_role=Admin
+
diff --git a/xos/configurations/devel/Makefile b/xos/configurations/devel/Makefile
index cc29f53..29719bb 100644
--- a/xos/configurations/devel/Makefile
+++ b/xos/configurations/devel/Makefile
@@ -29,7 +29,7 @@
sudo MYIP=$(MYIP) docker-compose logs
rm: stop
- sudo MYIP=$(MYIP) docker-compose rm
+ sudo MYIP=$(MYIP) docker-compose rm -f
ps:
sudo MYIP=$(MYIP) docker-compose ps
diff --git a/xos/configurations/devel/docker-compose.yml b/xos/configurations/devel/docker-compose.yml
index 9ef6fc7..6582b15 100644
--- a/xos/configurations/devel/docker-compose.yml
+++ b/xos/configurations/devel/docker-compose.yml
@@ -17,6 +17,20 @@
- ../common/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
- ./images:/opt/xos/images:ro
+xos_synchronizer_exampleservice:
+ image: xosproject/xos-synchronizer-openstack
+ command: bash -c "sleep 120; python /opt/xos/synchronizers/exampleservice/exampleservice-synchronizer.py -C /opt/xos/synchronizers/exampleservice/exampleservice_config"
+ labels:
+ org.xosproject.kind: synchronizer
+ org.xosproject.target: exampleservice
+ links:
+ - xos_db
+ extra_hosts:
+ - ctl:${MYIP}
+ volumes:
+ - ../common/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
+ - ../setup/id_rsa:/opt/xos/synchronizers/exampleservice/exampleservice_private_key:ro
+
# FUTURE
#xos_swarm_synchronizer:
# image: xosproject/xos-swarm-synchronizer
diff --git a/xos/core/admin.py b/xos/core/admin.py
index 200bb5c..015a87e 100644
--- a/xos/core/admin.py
+++ b/xos/core/admin.py
@@ -12,7 +12,7 @@
ReadOnlyPasswordHashField)
from django.contrib.auth.models import Group
from django.contrib.auth.signals import user_logged_in
-from django.contrib.contenttypes import generic
+from django.contrib.contenttypes.admin import GenericTabularInline
from django.core.exceptions import PermissionDenied, ValidationError
from django.core.urlresolvers import NoReverseMatch, resolve, reverse
from django.forms.utils import flatatt, to_current_timezone
@@ -21,7 +21,7 @@
from django.utils.html import conditional_escape, format_html
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
-from openstack.manager import OpenStackManager
+from openstack_xos.manager import OpenStackManager
from suit.widgets import LinkedSelect
# thread locals necessary to work around a django-suit issue
@@ -415,7 +415,7 @@
backend_status_icon.short_description = ""
-class PlStackGenericTabularInline(generic.GenericTabularInline):
+class PlStackGenericTabularInline(GenericTabularInline):
def has_add_permission(self, request):
return not request.user.isReadOnlyUser()
@@ -723,6 +723,7 @@
class Meta:
model = Deployment
many_to_many = ["flavors", ]
+ fields = '__all__'
def __init__(self, *args, **kwargs):
request = kwargs.pop('request', None)
@@ -857,6 +858,7 @@
class Meta:
model = Controller
+ fields = '__all__'
def __init__(self, *args, **kwargs):
request = kwargs.pop('request', None)
@@ -1194,6 +1196,7 @@
widgets = {
'service': LinkedSelect
}
+ fields = '__all__'
def clean(self):
cleaned_data = super(SliceForm, self).clean()
@@ -1422,6 +1425,7 @@
'site': LinkedSelect,
'deployment': LinkedSelect
}
+ fields = '__all__'
def __init__(self, *args, **kwargs):
request = kwargs.pop('request', None)
@@ -1491,6 +1495,7 @@
'node': LinkedSelect,
'image': LinkedSelect
}
+ fields = '__all__'
class TagAdmin(XOSBaseAdmin):
@@ -1703,6 +1708,7 @@
class Meta:
model = User
widgets = {'public_key': UploadTextareaWidget, }
+ fields = '__all__'
def clean_password(self):
# Regardless of what the user provides, return the initial value.
@@ -1737,6 +1743,7 @@
class Meta:
app_label = "core"
+ fields = '__all__'
# The forms to add and change user instances
form = UserChangeForm
@@ -1899,6 +1906,7 @@
widgets = {
'slice': LinkedSelect
}
+ fields = '__all__'
class ReservationAddForm(forms.ModelForm):
@@ -1923,6 +1931,7 @@
widgets = {
'slice': LinkedSelect
}
+ fields = '__all__'
class ReservationAddRefreshForm(ReservationAddForm):
@@ -2088,6 +2097,7 @@
'topologyParameters': UploadTextareaWidget,
'controllerParameters': UploadTextareaWidget,
}
+ fields = '__all__'
class NetworkAdmin(XOSBaseAdmin):
@@ -2313,6 +2323,7 @@
'messages': forms.Textarea(attrs={'rows': 20, 'cols': 80, 'class': 'input-xxlarge'}),
'output': forms.Textarea(attrs={'rows': 3, 'cols': 80, 'class': 'input-xxlarge'})
}
+ fields = '__all__'
class ProgramAdmin(XOSBaseAdmin):
@@ -2353,6 +2364,7 @@
widgets = {
'addresses': UploadTextareaWidget(attrs={'rows': 20, 'cols': 80, 'class': "input-xxlarge"}),
}
+ fields = '__all__'
class AddressPoolAdmin(XOSBaseAdmin):
diff --git a/xos/core/models/billing.py b/xos/core/models/billing.py
index 6e517b4..48c8a38 100644
--- a/xos/core/models/billing.py
+++ b/xos/core/models/billing.py
@@ -5,7 +5,6 @@
from core.models import PlCoreBase, Site, Slice, Instance, Deployment
from core.models.plcorebase import StrippedCharField
from django.contrib.contenttypes.models import ContentType
-from django.contrib.contenttypes import generic
from django.db.models import Sum
from django.utils import timezone
diff --git a/xos/core/models/dashboard.py b/xos/core/models/dashboard.py
index 5228381..42f51e5 100644
--- a/xos/core/models/dashboard.py
+++ b/xos/core/models/dashboard.py
@@ -3,14 +3,13 @@
from core.models import PlCoreBase, Controller, Deployment
from core.models.plcorebase import StrippedCharField
from core.models.site import ControllerLinkManager, ControllerLinkDeletionManager
-from django.contrib.contenttypes import generic
class DashboardView(PlCoreBase):
name = StrippedCharField(max_length=200, unique=True, help_text="Name of the View")
url = StrippedCharField(max_length=1024, help_text="URL of Dashboard")
controllers = models.ManyToManyField(Controller, blank=True, related_name="dashboardviews", through='ControllerDashboardView')
enabled = models.BooleanField(default=True)
- deployments = models.ManyToManyField(Deployment, blank=True, null=True, related_name="dashboardviews", help_text="Deployments that should be included in this view")
+ deployments = models.ManyToManyField(Deployment, blank=True, related_name="dashboardviews", help_text="Deployments that should be included in this view")
def __unicode__(self): return u'%s' % (self.name)
diff --git a/xos/core/models/flavor.py b/xos/core/models/flavor.py
index 8251eb1..693a5f8 100644
--- a/xos/core/models/flavor.py
+++ b/xos/core/models/flavor.py
@@ -4,7 +4,6 @@
from core.models import PlCoreBase, Deployment
from core.models.plcorebase import StrippedCharField
from django.contrib.contenttypes.models import ContentType
-from django.contrib.contenttypes import generic
class Flavor(PlCoreBase):
name = StrippedCharField(max_length=32, help_text="name of this flavor, as displayed to users")
diff --git a/xos/core/models/instance.py b/xos/core/models/instance.py
index 8cd889a..6e73af8 100644
--- a/xos/core/models/instance.py
+++ b/xos/core/models/instance.py
@@ -13,7 +13,7 @@
from core.models import User
from core.models import Tag
from core.models import Flavor
-from django.contrib.contenttypes import generic
+from django.contrib.contenttypes.fields import GenericRelation
from xos.config import Config
from django.core.exceptions import PermissionDenied, ValidationError
@@ -95,7 +95,7 @@
node = models.ForeignKey(Node, related_name='instances')
numberCores = models.IntegerField(verbose_name="Number of Cores", help_text="Number of cores for instance", default=0)
flavor = models.ForeignKey(Flavor, help_text="Flavor of this instance", default=get_default_flavor)
- tags = generic.GenericRelation(Tag)
+ tags = GenericRelation(Tag)
userData = models.TextField(blank=True, null=True, help_text="user_data passed to instance during creation")
isolation = models.CharField(null=False, blank=False, max_length=30, choices=ISOLATION_CHOICES, default="vm")
volumes = models.TextField(null=True, blank=True, help_text="Comma-separated list of directories to expose to parent context")
diff --git a/xos/core/models/network.py b/xos/core/models/network.py
index 37f4cfe..b5269ad 100644
--- a/xos/core/models/network.py
+++ b/xos/core/models/network.py
@@ -5,7 +5,7 @@
from core.models import PlCoreBase, Site, Slice, Instance, Controller, Service
from core.models import ControllerLinkManager,ControllerLinkDeletionManager
from django.contrib.contenttypes.models import ContentType
-from django.contrib.contenttypes import generic
+from django.contrib.contenttypes.fields import GenericForeignKey
from django.core.exceptions import ValidationError
from django.db.models import Q
@@ -347,7 +347,7 @@
# The required fields to do a ObjectType lookup, and object_id assignment
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
- content_object = generic.GenericForeignKey('content_type', 'object_id')
+ content_object = GenericForeignKey('content_type', 'object_id')
def __unicode__(self):
return self.parameter.name
diff --git a/xos/core/models/node.py b/xos/core/models/node.py
index f3ea303..cefb48d 100644
--- a/xos/core/models/node.py
+++ b/xos/core/models/node.py
@@ -4,7 +4,7 @@
from core.models.plcorebase import StrippedCharField
from core.models.site import Site, SiteDeployment, SitePrivilege
from core.models import Tag
-from django.contrib.contenttypes import generic
+from django.contrib.contenttypes.fields import GenericRelation
# Create your models here.
@@ -12,7 +12,7 @@
name = StrippedCharField(max_length=200, unique=True, help_text="Name of the Node")
site_deployment = models.ForeignKey(SiteDeployment, related_name='nodes')
site = models.ForeignKey(Site, null=True, blank=True, related_name='nodes')
- tags = generic.GenericRelation(Tag)
+ tags = GenericRelation(Tag)
def __unicode__(self): return u'%s' % (self.name)
diff --git a/xos/core/models/role.py b/xos/core/models/role.py
index 353139e..b259410 100644
--- a/xos/core/models/role.py
+++ b/xos/core/models/role.py
@@ -2,7 +2,6 @@
import datetime
from django.db import models
from django.contrib.contenttypes.models import ContentType
-from django.contrib.contenttypes import generic
from core.models import PlCoreBase
from core.models.plcorebase import StrippedCharField
diff --git a/xos/core/models/serviceclass.py b/xos/core/models/serviceclass.py
index ccc3180..a51b476 100644
--- a/xos/core/models/serviceclass.py
+++ b/xos/core/models/serviceclass.py
@@ -16,7 +16,7 @@
membershipFee = models.IntegerField(default=0)
membershipFeeMonths = models.IntegerField(default=12)
upgradeRequiresApproval = models.BooleanField(default=False)
- upgradeFrom = models.ManyToManyField('self', blank=True, null=True)
+ upgradeFrom = models.ManyToManyField('self', blank=True)
class Meta(PlCoreBase.Meta):
verbose_name_plural = "Service classes"
diff --git a/xos/core/models/site.py b/xos/core/models/site.py
index 77b96ac..31e69a6 100644
--- a/xos/core/models/site.py
+++ b/xos/core/models/site.py
@@ -1,7 +1,7 @@
import os
from django.db import models
from django.db.models import Q
-from django.contrib.contenttypes import generic
+from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import PermissionDenied
from geoposition.fields import GeopositionField
from core.models import PlCoreBase,PlCoreBaseManager,PlCoreBaseDeletionManager
@@ -110,7 +110,7 @@
#deployments = models.ManyToManyField('Deployment', blank=True, related_name='sites')
deployments = models.ManyToManyField('Deployment', through='SiteDeployment', blank=True, help_text="Select which sites are allowed to host nodes in this deployment", related_name='sites')
- tags = generic.GenericRelation(Tag)
+ tags = GenericRelation(Tag)
def __unicode__(self): return u'%s' % (self.name)
diff --git a/xos/core/models/slice.py b/xos/core/models/slice.py
index 73fa121..33e5521 100644
--- a/xos/core/models/slice.py
+++ b/xos/core/models/slice.py
@@ -9,7 +9,7 @@
from core.models import ServiceClass
#from core.models.serviceclass import get_default_serviceclass
from core.models import Tag
-from django.contrib.contenttypes import generic
+from django.contrib.contenttypes.fields import GenericRelation
from core.models import Service
from core.models import Controller
from core.models.node import Node
@@ -34,7 +34,7 @@
service = models.ForeignKey(Service, related_name='slices', null=True, blank=True)
network = models.CharField(null=True, blank=True, max_length=256, choices=NETWORK_CHOICES)
exposed_ports = models.CharField(null=True, blank=True, max_length=256)
- tags = generic.GenericRelation(Tag)
+ tags = GenericRelation(Tag)
serviceClass = models.ForeignKey(ServiceClass, related_name = "slices", null=True, blank=True) # DEPRECATED
creator = models.ForeignKey(User, related_name='slices', blank=True, null=True)
diff --git a/xos/core/models/tag.py b/xos/core/models/tag.py
index 76a4e2e..7bd7aea 100644
--- a/xos/core/models/tag.py
+++ b/xos/core/models/tag.py
@@ -4,7 +4,7 @@
from core.models import Service
from core.models.plcorebase import StrippedCharField
from django.contrib.contenttypes.models import ContentType
-from django.contrib.contenttypes import generic
+from django.contrib.contenttypes.fields import GenericForeignKey
# Create your models here.
@@ -18,7 +18,7 @@
# The required fields to do a ObjectType lookup, and object_id assignment
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
- content_object = generic.GenericForeignKey('content_type', 'object_id')
+ content_object = GenericForeignKey('content_type', 'object_id')
def __unicode__(self):
return self.name
diff --git a/xos/core/models/user.py b/xos/core/models/user.py
index 715c670..d85c58c 100644
--- a/xos/core/models/user.py
+++ b/xos/core/models/user.py
@@ -85,7 +85,11 @@
class DeletedUserManager(UserManager):
def get_queryset(self):
- return super(UserManager, self).get_query_set().filter(deleted=True)
+ parent = super(UserManager, self)
+ if hasattr(parent, "get_queryset"):
+ return parent.get_queryset().filter(deleted=True)
+ else:
+ return parent.get_query_set().filter(deleted=True)
# deprecated in django 1.7 in favor of get_queryset()
def get_query_set(self):
@@ -294,7 +298,7 @@
def can_update_root(self):
"""
- Return True if user has root (global) write access.
+ Return True if user has root (global) write access.
"""
if self.is_readonly:
return False
@@ -386,15 +390,15 @@
return readable_objects
def get_permissions(self, filter_by=None):
- """ Return a list of objects for which the user has read or read/write
- access. The object will be an instance of a django model object.
+ """ Return a list of objects for which the user has read or read/write
+ access. The object will be an instance of a django model object.
Permissions will be either 'r' or 'rw'.
e.g.
[{'object': django_object_instance, 'permissions': 'rw'}, ...]
Returns:
- list of dicts
+ list of dicts
"""
from core.models import Deployment, Flavor, Image, Network, NetworkTemplate, Node, PlModelMixIn, Site, Slice, SliceTag, Instance, Tag, User, DeploymentPrivilege, SitePrivilege, SlicePrivilege
diff --git a/xos/openstack/__init__.py b/xos/openstack_xos/__init__.py
similarity index 100%
rename from xos/openstack/__init__.py
rename to xos/openstack_xos/__init__.py
diff --git a/xos/openstack/client.py b/xos/openstack_xos/client.py
similarity index 87%
rename from xos/openstack/client.py
rename to xos/openstack_xos/client.py
index c500204..6ec7bc2 100644
--- a/xos/openstack/client.py
+++ b/xos/openstack_xos/client.py
@@ -3,8 +3,8 @@
from keystoneclient.v2_0 import client as keystone_client
#from glance import client as glance_client
import glanceclient
- from novaclient.v1_1 import client as nova_client
- from neutronclient.v2_0 import client as quantum_client
+ from novaclient.v2 import client as nova_client
+ from neutronclient.v2_0 import client as neutron_client
has_openstack = True
except:
has_openstack = False
@@ -117,15 +117,17 @@
def __init__(self, *args, **kwds):
Client.__init__(self, *args, **kwds)
if has_openstack:
- self.client = nova_client.Client(username=self.username,
- api_key=self.password,
- project_id=self.tenant,
- auth_url=self.url,
- region_name='',
- extensions=[],
- service_type='compute',
- service_name='',
- )
+ self.client = nova_client.client.Client(
+ "2",
+ username=self.username,
+ api_key=self.password,
+ project_id=self.tenant,
+ auth_url=self.url,
+ region_name='',
+ extensions=[],
+ service_type='compute',
+ service_name='',
+ )
@require_enabled
def connect(self, *args, **kwds):
@@ -152,11 +154,11 @@
def __getattr__(self, name):
return getattr(self.client, name)
-class QuantumClient(Client):
+class NeutronClient(Client):
def __init__(self, *args, **kwds):
Client.__init__(self, *args, **kwds)
if has_openstack:
- self.client = quantum_client.Client(username=self.username,
+ self.client = neutron_client.Client(username=self.username,
password=self.password,
tenant_name=self.tenant,
auth_url=self.url,
@@ -186,7 +188,7 @@
self.glanceclient = GlanceClient('1', endpoint=glance_endpoint, token=token.id, **kwds)
self.nova = NovaClient(*args, **kwds)
# self.nova_db = NovaDB(*args, **kwds)
- self.quantum = QuantumClient(*args, **kwds)
+ self.neutron = NeutronClient(*args, **kwds)
@require_enabled
diff --git a/xos/openstack/driver.py b/xos/openstack_xos/driver.py
similarity index 82%
rename from xos/openstack/driver.py
rename to xos/openstack_xos/driver.py
index 15668b9..3064eb2 100644
--- a/xos/openstack/driver.py
+++ b/xos/openstack_xos/driver.py
@@ -4,7 +4,7 @@
from core.models import Controller
try:
- from openstack.client import OpenStackClient
+ from openstack_xos.client import OpenStackClient
has_openstack = True
except:
has_openstack = False
@@ -51,7 +51,7 @@
driver = OpenStackDriver(client=client)
driver.admin_user = client.keystone.users.find(name=controller.admin_user)
driver.controller = controller
- return driver
+ return driver
def create_role(self, name):
roles = self.shell.keystone.roles.findall(name=name)
@@ -70,17 +70,17 @@
return 1
def create_tenant(self, tenant_name, enabled, description):
- """Create keystone tenant. Suggested fields: name, description, enabled"""
+ """Create keystone tenant. Suggested fields: name, description, enabled"""
tenants = self.shell.keystone.tenants.findall(name=tenant_name)
if not tenants:
- fields = {'tenant_name': tenant_name, 'enabled': enabled,
- 'description': description}
+ fields = {'tenant_name': tenant_name, 'enabled': enabled,
+ 'description': description}
tenant = self.shell.keystone.tenants.create(**fields)
else:
tenant = tenants[0]
- # always give the admin user the admin role to any tenant created
- # by the driver.
+ # always give the admin user the admin role to any tenant created
+ # by the driver.
self.add_user_role(self.admin_user.id, tenant.id, 'admin')
return tenant
@@ -88,17 +88,20 @@
return self.shell.keystone.tenants.update(id, **kwds)
def delete_tenant(self, id):
- ctx = self.shell.nova_db.ctx
+ # FIXME: nova_db is commented out in clients.py, throws errors.
+ # Commenting this out for the time being until actually fixed
+
+ #ctx = self.shell.nova_db.ctx
tenants = self.shell.keystone.tenants.findall(id=id)
for tenant in tenants:
# nova does not automatically delete the tenant's instances
- # so we manually delete instances before deleteing the tenant
- instances = self.shell.nova_db.instance_get_all_by_filters(ctx,
- {'project_id': tenant.id}, 'id', 'asc')
- client = OpenStackClient(tenant=tenant.name)
- driver = OpenStackDriver(client=client)
- for instance in instances:
- driver.destroy_instance(instance.id)
+ # so we manually delete instances before deleting the tenant
+ #instances = self.shell.nova_db.instance_get_all_by_filters(ctx,
+ # {'project_id': tenant.id}, 'id', 'asc')
+ #client = OpenStackClient(tenant=tenant.name)
+ #driver = OpenStackDriver(client=client)
+ #for instance in instances:
+ # driver.destroy_instance(instance.id)
self.shell.keystone.tenants.delete(tenant)
return 1
@@ -108,7 +111,7 @@
fields = {'name': name, 'email': email, 'password': password,
'enabled': enabled}
user = self.shell.keystone.users.create(**fields)
- else:
+ else:
user = users[0]
return user
@@ -129,7 +132,7 @@
if roles:
role = roles[0]
break
- return role
+ return role
def add_user_role(self, kuser_id, tenant_id, role_name):
user = self.shell.keystone.users.find(id=kuser_id)
@@ -139,8 +142,8 @@
if role_name.lower() == 'admin':
role = self.get_admin_role()
else:
- # look up non admin role or force exception when admin role isnt found
- role = self.shell.keystone.roles.find(name=role_name)
+ # look up non admin role or force exception when admin role isnt found
+ role = self.shell.keystone.roles.find(name=role_name)
role_found = False
user_roles = user.list_roles(tenant.id)
@@ -171,63 +174,63 @@
if role_found:
tenant.remove_user(user, role)
- return 1
+ return 1
def update_user(self, id, fields):
if 'password' in fields:
self.shell.keystone.users.update_password(id, fields['password'])
if 'enabled' in fields:
- self.shell.keystone.users.update_enabled(id, fields['enabled'])
- return 1
+ self.shell.keystone.users.update_enabled(id, fields['enabled'])
+ return 1
def create_router(self, name, set_gateway=True):
- routers = self.shell.quantum.list_routers(name=name)['routers']
+ routers = self.shell.neutron.list_routers(name=name)['routers']
if routers:
router = routers[0]
else:
- router = self.shell.quantum.create_router({'router': {'name': name}})['router']
+ router = self.shell.neutron.create_router({'router': {'name': name}})['router']
# add router to external network
if set_gateway:
- nets = self.shell.quantum.list_networks()['networks']
+ nets = self.shell.neutron.list_networks()['networks']
for net in nets:
- if net['router:external'] == True:
- self.shell.quantum.add_gateway_router(router['id'],
+ if net['router:external'] == True:
+ self.shell.neutron.add_gateway_router(router['id'],
{'network_id': net['id']})
-
+
return router
def delete_router(self, id):
- routers = self.shell.quantum.list_routers(id=id)['routers']
+ routers = self.shell.neutron.list_routers(id=id)['routers']
for router in routers:
- self.shell.quantum.delete_router(router['id'])
+ self.shell.neutron.delete_router(router['id'])
# remove router form external network
- #nets = self.shell.quantum.list_networks()['networks']
+ #nets = self.shell.neutron.list_networks()['networks']
#for net in nets:
# if net['router:external'] == True:
- # self.shell.quantum.remove_gateway_router(router['id'])
+ # self.shell.neutron.remove_gateway_router(router['id'])
def add_router_interface(self, router_id, subnet_id):
- router = self.shell.quantum.show_router(router_id)['router']
- subnet = self.shell.quantum.show_subnet(subnet_id)['subnet']
+ router = self.shell.neutron.show_router(router_id)['router']
+ subnet = self.shell.neutron.show_subnet(subnet_id)['subnet']
if router and subnet:
- self.shell.quantum.add_interface_router(router_id, {'subnet_id': subnet_id})
+ self.shell.neutron.add_interface_router(router_id, {'subnet_id': subnet_id})
def delete_router_interface(self, router_id, subnet_id):
- router = self.shell.quantum.show_router(router_id)
- subnet = self.shell.quantum.show_subnet(subnet_id)
+ router = self.shell.neutron.show_router(router_id)
+ subnet = self.shell.neutron.show_subnet(subnet_id)
if router and subnet:
- self.shell.quantum.remove_interface_router(router_id, {'subnet_id': subnet_id})
-
+ self.shell.neutron.remove_interface_router(router_id, {'subnet_id': subnet_id})
+
def create_network(self, name, shared=False):
- nets = self.shell.quantum.list_networks(name=name)['networks']
- if nets:
+ nets = self.shell.neutron.list_networks(name=name)['networks']
+ if nets:
net = nets[0]
else:
- net = self.shell.quantum.create_network({'network': {'name': name, 'shared': shared}})['network']
+ net = self.shell.neutron.create_network({'network': {'name': name, 'shared': shared}})['network']
return net
-
+
def delete_network(self, id):
- nets = self.shell.quantum.list_networks()['networks']
+ nets = self.shell.neutron.list_networks()['networks']
for net in nets:
if net['id'] == id:
# delete_all ports
@@ -235,18 +238,18 @@
# delete all subnets:
for subnet_id in net['subnets']:
self.delete_subnet(subnet_id)
- self.shell.quantum.delete_network(net['id'])
+ self.shell.neutron.delete_network(net['id'])
return 1
def delete_network_ports(self, network_id):
- ports = self.shell.quantum.list_ports()['ports']
+ ports = self.shell.neutron.list_ports()['ports']
for port in ports:
if port['network_id'] == network_id:
- self.shell.quantum.delete_port(port['id'])
- return 1
+ self.shell.neutron.delete_port(port['id'])
+ return 1
def delete_subnet_ports(self, subnet_id):
- ports = self.shell.quantum.list_ports()['ports']
+ ports = self.shell.neutron.list_ports()['ports']
for port in ports:
delete = False
for fixed_ip in port['fixed_ips']:
@@ -254,17 +257,17 @@
delete=True
break
if delete:
- self.shell.quantum.delete_port(port['id'])
+ self.shell.neutron.delete_port(port['id'])
return 1
-
+
def create_subnet(self, name, network_id, cidr_ip, ip_version, start, end):
- #nets = self.shell.quantum.list_networks(name=network_name)['networks']
+ #nets = self.shell.neutron.list_networks(name=network_name)['networks']
#if not nets:
- # raise Exception, "No such network: %s" % network_name
+ # raise Exception, "No such network: %s" % network_name
#net = nets[0]
- subnet = None
- subnets = self.shell.quantum.list_subnets()['subnets']
+ subnet = None
+ subnets = self.shell.neutron.list_subnets()['subnets']
for snet in subnets:
if snet['cidr'] == cidr_ip and snet['network_id'] == network_id:
subnet = snet
@@ -282,22 +285,22 @@
'host_routes': [{'destination':'169.254.169.254/32','nexthop':metadata_ip}],
'gateway_ip': None,
'allocation_pools': allocation_pools}}
- subnet = self.shell.quantum.create_subnet(subnet)['subnet']
+ subnet = self.shell.neutron.create_subnet(subnet)['subnet']
# self.add_external_route(subnet)
return subnet
def update_subnet(self, id, fields):
- return self.shell.quantum.update_subnet(id, fields)
+ return self.shell.neutron.update_subnet(id, fields)
def delete_subnet(self, id):
- #return self.shell.quantum.delete_subnet(id=id)
+ #return self.shell.neutron.delete_subnet(id=id)
# inefficient but fault tolerant
- subnets = self.shell.quantum.list_subnets()['subnets']
+ subnets = self.shell.neutron.list_subnets()['subnets']
for subnet in subnets:
if subnet['id'] == id:
self.delete_subnet_ports(subnet['id'])
- self.shell.quantum.delete_subnet(id)
+ self.shell.neutron.delete_subnet(id)
self.delete_external_route(subnet)
return 1
@@ -309,8 +312,8 @@
def add_external_route(self, subnet, routes=[]):
if not routes:
routes = self.get_external_routes()
-
- ports = self.shell.quantum.list_ports()['ports']
+
+ ports = self.shell.neutron.list_ports()['ports']
gw_ip = subnet['gateway_ip']
subnet_id = subnet['id']
@@ -325,7 +328,7 @@
if fixed_ip['subnet_id'] == subnet_id and fixed_ip['ip_address'] == gw_ip:
gw_port = port
router_id = gw_port['device_id']
- router = self.shell.quantum.show_router(router_id)['router']
+ router = self.shell.neutron.show_router(router_id)['router']
if router and router.get('external_gateway_info'):
ext_net = router['external_gateway_info']['network_id']
for port in ports:
@@ -347,7 +350,7 @@
return 1
def delete_external_route(self, subnet):
- ports = self.shell.quantum.list_ports()['ports']
+ ports = self.shell.neutron.list_ports()['ports']
gw_ip = subnet['gateway_ip']
subnet_id = subnet['id']
@@ -362,7 +365,7 @@
if fixed_ip['subnet_id'] == subnet_id and fixed_ip['ip_address'] == gw_ip:
gw_port = port
router_id = gw_port['device_id']
- router = self.shell.quantum.show_router(router_id)['router']
+ router = self.shell.neutron.show_router(router_id)['router']
ext_net = router['external_gateway_info']['network_id']
for port in ports:
if port['device_id'] == router_id and port['network_id'] == ext_net:
@@ -371,14 +374,14 @@
if ip_address:
cmd = "route delete -net %s" % (subnet['cidr'])
commands.getstatusoutput(cmd)
-
+
return 1
-
+
def create_keypair(self, name, public_key):
keys = self.shell.nova.keypairs.findall(name=name)
if keys:
key = keys[0]
- # update key
+ # update key
if key.public_key != public_key:
self.delete_keypair(key.id)
key = self.shell.nova.keypairs.create(name=name, public_key=public_key)
@@ -389,7 +392,7 @@
def delete_keypair(self, id):
keys = self.shell.nova.keypairs.findall(id=id)
for key in keys:
- self.shell.nova.keypairs.delete(key)
+ self.shell.nova.keypairs.delete(key)
return 1
def get_private_networks(self, tenant=None):
@@ -397,24 +400,24 @@
tenant = self.shell.nova.tenant
tenant = self.shell.keystone.tenants.find(name=tenant)
search_opts = {"tenant_id": tenant.id, "shared": False}
- private_networks = self.shell.quantum.list_networks(**search_opts)
+ private_networks = self.shell.neutron.list_networks(**search_opts)
return private_networks
def get_shared_networks(self):
search_opts = {"shared": True}
- shared_networks = self.shell.quantum.list_networks(**search_opts)
+ shared_networks = self.shell.neutron.list_networks(**search_opts)
return shared_networks
def get_network_subnet(self, network_id):
subnet_id = None
subnet = None
if network_id:
- os_networks = self.shell.quantum.list_networks(id=network_id)["networks"]
+ os_networks = self.shell.neutron.list_networks(id=network_id)["networks"]
if os_networks:
os_network = os_networks[0]
if os_network['subnets']:
subnet_id = os_network['subnets'][0]
- os_subnets = self.shell.quantum.list_subnets(id=subnet_id)['subnets']
+ os_subnets = self.shell.neutron.list_subnets(id=subnet_id)['subnets']
if os_subnets:
subnet = os_subnets[0]['cidr']
@@ -433,12 +436,12 @@
#if pubkeys:
# files["/root/.ssh/authorized_keys"] = "\n".join(pubkeys).encode('base64')
hints = {}
-
- # determine availability zone and compute host
+
+ # determine availability zone and compute host
availability_zone_filter = None
if availability_zone is None or not availability_zone:
availability_zone_filter = 'nova'
- else:
+ else:
availability_zone_filter = availability_zone
if hostname:
availability_zone_filter += ':%s' % hostname
diff --git a/xos/openstack/get_token.sh b/xos/openstack_xos/get_token.sh
similarity index 100%
rename from xos/openstack/get_token.sh
rename to xos/openstack_xos/get_token.sh
diff --git a/xos/openstack/instanceagent.py b/xos/openstack_xos/instanceagent.py
similarity index 96%
rename from xos/openstack/instanceagent.py
rename to xos/openstack_xos/instanceagent.py
index 8e50cf3..e3fd58d 100644
--- a/xos/openstack/instanceagent.py
+++ b/xos/openstack_xos/instanceagent.py
@@ -3,7 +3,7 @@
#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings")
import time
from core.models.instance import Instance
-from openstack.manager import OpenStackManager
+from openstack_xos.manager import OpenStackManager
class InstanceAgent:
diff --git a/xos/openstack/manager.py b/xos/openstack_xos/manager.py
similarity index 97%
rename from xos/openstack/manager.py
rename to xos/openstack_xos/manager.py
index ba163c7..193ec75 100644
--- a/xos/openstack/manager.py
+++ b/xos/openstack_xos/manager.py
@@ -12,8 +12,8 @@
from core.models import *
from xos.config import Config
try:
- from openstack.client import OpenStackClient
- from openstack.driver import OpenStackDriver
+ from openstack_xos.client import OpenStackClient
+ from openstack_xos.driver import OpenStackDriver
has_openstack = True
except:
has_openstack = False
@@ -240,7 +240,7 @@
self.driver.delete_tenant(slice.tenant_id)
# delete external route
subnet = None
- subnets = self.driver.shell.quantum.list_subnets()['subnets']
+ subnets = self.driver.shell.neutron.list_subnets()['subnets']
for snet in subnets:
if snet['id'] == slice.subnet_id:
subnet = snet
@@ -269,7 +269,7 @@
def get_next_subnet(self):
# limit ourself to 10.0.x.x for now
valid_subnet = lambda net: net.startswith('10.0')
- subnets = self.driver.shell.quantum.list_subnets()['subnets']
+ subnets = self.driver.shell.neutron.list_subnets()['subnets']
ints = [int(IPNetwork(subnet['cidr']).ip) for subnet in subnets \
if valid_subnet(subnet['cidr'])]
ints.sort()
@@ -281,13 +281,13 @@
@require_enabled
def save_subnet(self, subnet):
if not subnet.subnet_id:
- quantum_subnet = self.driver.create_subnet(name= subnet.slice.name,
+ neutron_subnet = self.driver.create_subnet(name= subnet.slice.name,
network_id=subnet.slice.network_id,
cidr_ip = subnet.cidr,
ip_version=subnet.ip_version,
start = subnet.start,
end = subnet.end)
- subnet.subnet_id = quantum_subnet['id']
+ subnet.subnet_id = neutron_subnet['id']
# add subnet as interface to slice's router
self.driver.add_router_interface(subnet.slice.router_id, subnet.subnet_id)
#add_route = 'route add -net %s dev br-ex gw 10.100.0.5' % self.cidr
@@ -473,7 +473,7 @@
def save_network_template(self, template):
if (template.shared_network_name) and (not template.shared_network_id):
- os_networks = self.driver.shell.quantum.list_networks(name=template.shared_network_name)['networks']
+ os_networks = self.driver.shell.neutron.list_networks(name=template.shared_network_name)['networks']
if os_networks:
template.shared_network_id = os_networks[0]["id"]
@@ -522,7 +522,7 @@
# Get a list of all shared networks in OS
- os_networks = self.driver.shell.quantum.list_networks()['networks']
+ os_networks = self.driver.shell.neutron.list_networks()['networks']
os_networks_by_name = {}
os_networks_by_id = {}
for os_network in os_networks:
diff --git a/xos/openstack/reservationagent.py b/xos/openstack_xos/reservationagent.py
similarity index 100%
rename from xos/openstack/reservationagent.py
rename to xos/openstack_xos/reservationagent.py
diff --git a/xos/services/ceilometer/admin.py b/xos/services/ceilometer/admin.py
index 062a2ae..a226bef 100644
--- a/xos/services/ceilometer/admin.py
+++ b/xos/services/ceilometer/admin.py
@@ -8,7 +8,6 @@
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.contrib.auth.signals import user_logged_in
from django.utils import timezone
-from django.contrib.contenttypes import generic
from suit.widgets import LinkedSelect
from core.admin import ServiceAppAdmin,SliceInline,ServiceAttrAsTabInline, ReadOnlyAwareAdmin, XOSTabularInline, ServicePrivilegeInline, TenantRootTenantInline, TenantRootPrivilegeInline, TenantAttrAsTabInline
from core.middleware import get_request
@@ -33,6 +32,7 @@
class Meta:
model = CeilometerService
+ fields = '__all__'
class CeilometerServiceAdmin(ReadOnlyAwareAdmin):
model = CeilometerService
@@ -59,7 +59,7 @@
suit_form_includes = (('ceilometeradmin.html', 'top', 'administration'),
)
- def queryset(self, request):
+ def get_queryset(self, request):
return CeilometerService.get_service_objects_by_user(request.user)
class MonitoringChannelForm(forms.ModelForm):
@@ -86,6 +86,7 @@
class Meta:
model = MonitoringChannel
+ fields = '__all__'
class MonitoringChannelAdmin(ReadOnlyAwareAdmin):
list_display = ('backend_status_icon', 'id', )
@@ -111,7 +112,7 @@
obj.delete()
delete_selected_objects.short_description = "Delete Selected MonitoringChannel Objects"
- def queryset(self, request):
+ def get_queryset(self, request):
return MonitoringChannel.get_tenant_objects_by_user(request.user)
class SFlowServiceForm(forms.ModelForm):
@@ -136,6 +137,7 @@
class Meta:
model = SFlowService
+ fields = '__all__'
class SFlowServiceAdmin(ReadOnlyAwareAdmin):
model = SFlowService
@@ -162,7 +164,7 @@
suit_form_includes = (('sflowadmin.html', 'top', 'administration'),
)
- def queryset(self, request):
+ def get_queryset(self, request):
return SFlowService.get_service_objects_by_user(request.user)
class SFlowTenantForm(forms.ModelForm):
@@ -191,6 +193,7 @@
class Meta:
model = SFlowTenant
+ fields = '__all__'
class SFlowTenantAdmin(ReadOnlyAwareAdmin):
list_display = ('backend_status_icon', 'creator', 'listening_endpoint' )
@@ -204,7 +207,7 @@
suit_form_tabs = (('general','Details'), ('tenantattrs', 'Attributes'))
- def queryset(self, request):
+ def get_queryset(self, request):
return SFlowTenant.get_tenant_objects_by_user(request.user)
admin.site.register(CeilometerService, CeilometerServiceAdmin)
diff --git a/xos/services/cord/admin.py b/xos/services/cord/admin.py
index e7704d3..7fa174f 100644
--- a/xos/services/cord/admin.py
+++ b/xos/services/cord/admin.py
@@ -8,7 +8,6 @@
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.contrib.auth.signals import user_logged_in
from django.utils import timezone
-from django.contrib.contenttypes import generic
from suit.widgets import LinkedSelect
from core.admin import ServiceAppAdmin,SliceInline,ServiceAttrAsTabInline, ReadOnlyAwareAdmin, XOSTabularInline, ServicePrivilegeInline, TenantRootTenantInline, TenantRootPrivilegeInline
from core.middleware import get_request
@@ -47,7 +46,7 @@
suit_form_includes = (('voltadmin.html', 'top', 'administration'),
) #('hpctools.html', 'top', 'tools') )
- def queryset(self, request):
+ def get_queryset(self, request):
return VOLTService.get_service_objects_by_user(request.user)
class VOLTTenantForm(forms.ModelForm):
@@ -79,6 +78,7 @@
class Meta:
model = VOLTTenant
+ fields = '__all__'
class VOLTTenantAdmin(ReadOnlyAwareAdmin):
list_display = ('backend_status_icon', 'id', 'service_specific_id', 's_tag', 'c_tag', 'subscriber_root' )
@@ -91,7 +91,7 @@
suit_form_tabs = (('general','Details'),)
- def queryset(self, request):
+ def get_queryset(self, request):
return VOLTTenant.get_tenant_objects_by_user(request.user)
#-----------------------------------------------------------------------------
@@ -133,6 +133,7 @@
class Meta:
model = VSGService
+ fields = '__all__'
class VSGServiceAdmin(ReadOnlyAwareAdmin):
model = VSGService
@@ -167,7 +168,7 @@
suit_form_includes = (('vcpeadmin.html', 'top', 'administration'),
) #('hpctools.html', 'top', 'tools') )
- def queryset(self, request):
+ def get_queryset(self, request):
return VSGService.get_service_objects_by_user(request.user)
class VSGTenantForm(forms.ModelForm):
@@ -205,6 +206,8 @@
class Meta:
model = VSGTenant
+ fields = '__all__'
+
class VSGTenantAdmin(ReadOnlyAwareAdmin):
list_display = ('backend_status_icon', 'id', 'subscriber_tenant' )
@@ -217,7 +220,7 @@
suit_form_tabs = (('general','Details'),)
- def queryset(self, request):
+ def get_queryset(self, request):
return VSGTenant.get_tenant_objects_by_user(request.user)
#-----------------------------------------------------------------------------
@@ -238,6 +241,8 @@
class Meta:
model = VBNGService
+ fields = '__all__'
+
class VBNGServiceAdmin(ReadOnlyAwareAdmin):
model = VBNGService
@@ -267,7 +272,7 @@
suit_form_includes = (('vbngadmin.html', 'top', 'administration'),
) #('hpctools.html', 'top', 'tools') )
- def queryset(self, request):
+ def get_queryset(self, request):
return VBNGService.get_service_objects_by_user(request.user)
class VBNGTenantForm(forms.ModelForm):
@@ -301,6 +306,7 @@
class Meta:
model = VBNGTenant
+ fields = '__all__'
class VBNGTenantAdmin(ReadOnlyAwareAdmin):
list_display = ('backend_status_icon', 'id', 'subscriber_tenant' )
@@ -313,7 +319,7 @@
suit_form_tabs = (('general','Details'),)
- def queryset(self, request):
+ def get_queryset(self, request):
return VBNGTenant.get_tenant_objects_by_user(request.user)
#-----------------------------------------------------------------------------
@@ -335,7 +341,7 @@
def selflink_reverse_path(self):
return "admin:cord_volttenant_change"
- def queryset(self, request):
+ def get_queryset(self, request):
qs = super(VOLTTenantInline, self).queryset(request)
return qs.filter(kind=VOLT_KIND)
@@ -377,6 +383,8 @@
class Meta:
model = CordSubscriberRoot
+ fields = '__all__'
+
class CordSubscriberRootAdmin(ReadOnlyAwareAdmin):
list_display = ('backend_status_icon', 'id', 'name', )
@@ -393,7 +401,7 @@
('tenantrootprivileges','Privileges')
)
- def queryset(self, request):
+ def get_queryset(self, request):
return CordSubscriberRoot.get_tenant_objects_by_user(request.user)
admin.site.register(VOLTService, VOLTServiceAdmin)
diff --git a/xos/services/exampleservice/admin.py b/xos/services/exampleservice/admin.py
index f679e4e..f4bf20d 100644
--- a/xos/services/exampleservice/admin.py
+++ b/xos/services/exampleservice/admin.py
@@ -13,6 +13,7 @@
class Meta:
model = ExampleService
+ fields = '__all__'
def __init__(self, *args, **kwargs):
super(ExampleServiceForm, self).__init__(*args, **kwargs)
@@ -64,6 +65,7 @@
class Meta:
model = ExampleTenant
+ fields = '__all__'
creator = forms.ModelChoiceField(queryset=User.objects.all())
diff --git a/xos/services/fabric/admin.py b/xos/services/fabric/admin.py
index 5dc5923..47fefd9 100644
--- a/xos/services/fabric/admin.py
+++ b/xos/services/fabric/admin.py
@@ -8,7 +8,6 @@
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.contrib.auth.signals import user_logged_in
from django.utils import timezone
-from django.contrib.contenttypes import generic
from suit.widgets import LinkedSelect
from core.models import AddressPool
from core.admin import ServiceAppAdmin,SliceInline,ServiceAttrAsTabInline, ReadOnlyAwareAdmin, XOSTabularInline, ServicePrivilegeInline, TenantRootTenantInline, TenantRootPrivilegeInline
@@ -28,6 +27,7 @@
class Meta:
model = FabricService
+ fields = '__all__'
class FabricServiceAdmin(ReadOnlyAwareAdmin):
model = FabricService
@@ -56,7 +56,7 @@
suit_form_includes = (('fabricadmin.html', 'top', 'administration'),
)
- def queryset(self, request):
+ def get_queryset(self, request):
return FabricService.get_service_objects_by_user(request.user)
admin.site.register(FabricService, FabricServiceAdmin)
diff --git a/xos/services/hpc/admin.py b/xos/services/hpc/admin.py
index d9f28c6..19f5190 100644
--- a/xos/services/hpc/admin.py
+++ b/xos/services/hpc/admin.py
@@ -8,7 +8,6 @@
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.contrib.auth.signals import user_logged_in
from django.utils import timezone
-from django.contrib.contenttypes import generic
from suit.widgets import LinkedSelect
from core.admin import ServiceAppAdmin,SliceInline,ServiceAttrAsTabInline, ReadOnlyAwareAdmin, XOSTabularInline, SliderWidget, ServicePrivilegeInline
from core.middleware import get_request
@@ -125,6 +124,7 @@
widgets = {
'serviceProvider' : LinkedSelect
}
+ fields = '__all__'
def __init__(self, *args, **kwargs):
request = kwargs.pop('request', None)
@@ -180,6 +180,7 @@
widgets = {
'contentProvider' : LinkedSelect
}
+ fields = '__all__'
class CDNPrefixAdmin(HPCAdmin):
form = CDNPrefixForm
diff --git a/xos/services/onos/admin.py b/xos/services/onos/admin.py
index fb0f1d7..285e751 100644
--- a/xos/services/onos/admin.py
+++ b/xos/services/onos/admin.py
@@ -8,7 +8,6 @@
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.contrib.auth.signals import user_logged_in
from django.utils import timezone
-from django.contrib.contenttypes import generic
from suit.widgets import LinkedSelect
from core.admin import ServiceAppAdmin,SliceInline,ServiceAttrAsTabInline, ReadOnlyAwareAdmin, XOSTabularInline, ServicePrivilegeInline, TenantRootTenantInline, TenantRootPrivilegeInline, TenantAttrAsTabInline
from core.middleware import get_request
@@ -45,6 +44,7 @@
class Meta:
model = ONOSService
+ fields = '__all__'
class ONOSServiceAdmin(ReadOnlyAwareAdmin):
model = ONOSService
@@ -71,7 +71,7 @@
suit_form_includes = (('onosadmin.html', 'top', 'administration'),
)
- def queryset(self, request):
+ def get_queryset(self, request):
return ONOSService.get_service_objects_by_user(request.user)
class ONOSAppForm(forms.ModelForm):
@@ -103,6 +103,7 @@
class Meta:
model = ONOSApp
+ fields = '__all__'
class ONOSAppAdmin(ReadOnlyAwareAdmin):
list_display = ('backend_status_icon', 'name', )
@@ -116,7 +117,7 @@
suit_form_tabs = (('general','Details'), ('tenantattrs', 'Attributes'))
- def queryset(self, request):
+ def get_queryset(self, request):
return ONOSApp.get_tenant_objects_by_user(request.user)
admin.site.register(ONOSService, ONOSServiceAdmin)
diff --git a/xos/services/openvpn/admin.py b/xos/services/openvpn/admin.py
index 28e778d..ddfe510 100644
--- a/xos/services/openvpn/admin.py
+++ b/xos/services/openvpn/admin.py
@@ -64,6 +64,7 @@
class Meta:
model = OpenVPNService
+ fields = '__all__'
class OpenVPNServiceAdmin(ReadOnlyAwareAdmin):
@@ -92,7 +93,7 @@
suit_form_tabs = (('general', 'VPN Service Details'),
('slices', 'Slices'),)
- def queryset(self, request):
+ def get_queryset(self, request):
return OpenVPNService.get_service_objects_by_user(request.user)
@@ -198,6 +199,7 @@
class Meta:
model = OpenVPNTenant
+ fields = '__all__'
class OpenVPNTenantAdmin(ReadOnlyAwareAdmin):
@@ -220,7 +222,7 @@
suit_form_tabs = (('general', 'Details'),
('tenantprivileges', 'Privileges'))
- def queryset(self, request):
+ def get_queryset(self, request):
return OpenVPNTenant.get_tenant_objects_by_user(request.user)
diff --git a/xos/services/requestrouter/admin.py b/xos/services/requestrouter/admin.py
index 6d9e2fe..a17bc44 100644
--- a/xos/services/requestrouter/admin.py
+++ b/xos/services/requestrouter/admin.py
@@ -8,7 +8,6 @@
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.contrib.auth.signals import user_logged_in
from django.utils import timezone
-from django.contrib.contenttypes import generic
from suit.widgets import LinkedSelect
from core.admin import ServiceAppAdmin,SliceInline,ServiceAttrAsTabInline, ReadOnlyAwareAdmin, ServicePrivilegeInline
diff --git a/xos/services/syndicate_storage/admin.py b/xos/services/syndicate_storage/admin.py
index 779f83b..afe4de9 100644
--- a/xos/services/syndicate_storage/admin.py
+++ b/xos/services/syndicate_storage/admin.py
@@ -8,7 +8,6 @@
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.contrib.auth.signals import user_logged_in
from django.utils import timezone
-from django.contrib.contenttypes import generic
from suit.widgets import LinkedSelect
from core.admin import ReadOnlyAwareAdmin,ServiceAppAdmin,SliceInline,ServiceAttrAsTabInline,XOSBaseAdmin, XOSTabularInline
from suit.widgets import LinkedSelect
diff --git a/xos/services/vrouter/admin.py b/xos/services/vrouter/admin.py
index 4bd99b6..d72148e 100644
--- a/xos/services/vrouter/admin.py
+++ b/xos/services/vrouter/admin.py
@@ -8,7 +8,6 @@
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.contrib.auth.signals import user_logged_in
from django.utils import timezone
-from django.contrib.contenttypes import generic
from suit.widgets import LinkedSelect
from core.models import AddressPool
from core.admin import ServiceAppAdmin,SliceInline,ServiceAttrAsTabInline, ReadOnlyAwareAdmin, XOSTabularInline, ServicePrivilegeInline, AddressPoolInline
@@ -28,6 +27,7 @@
class Meta:
model = VRouterService
+ fields = '__all__'
class VRouterServiceAdmin(ReadOnlyAwareAdmin):
model = VRouterService
@@ -57,7 +57,7 @@
suit_form_includes = (('vrouteradmin.html', 'top', 'administration'),
) #('hpctools.html', 'top', 'tools') )
- def queryset(self, request):
+ def get_queryset(self, request):
return VRouterService.get_service_objects_by_user(request.user)
class VRouterTenantForm(forms.ModelForm):
@@ -94,6 +94,7 @@
class Meta:
model = VRouterTenant
+ fields = '__all__'
class VRouterTenantAdmin(ReadOnlyAwareAdmin):
list_display = ('backend_status_icon', 'id', 'subscriber_tenant', 'public_ip' )
@@ -106,7 +107,7 @@
suit_form_tabs = (('general','Details'),)
- def queryset(self, request):
+ def get_queryset(self, request):
return VRouterTenant.get_tenant_objects_by_user(request.user)
admin.site.register(VRouterService, VRouterServiceAdmin)
diff --git a/xos/services/vtn/admin.py b/xos/services/vtn/admin.py
index 03ff5cd..bf829c3 100644
--- a/xos/services/vtn/admin.py
+++ b/xos/services/vtn/admin.py
@@ -8,7 +8,6 @@
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.contrib.auth.signals import user_logged_in
from django.utils import timezone
-from django.contrib.contenttypes import generic
from suit.widgets import LinkedSelect
from core.admin import ServiceAppAdmin,SliceInline,ServiceAttrAsTabInline, ReadOnlyAwareAdmin, XOSTabularInline, ServicePrivilegeInline, TenantRootTenantInline, TenantRootPrivilegeInline
from core.middleware import get_request
@@ -62,6 +61,7 @@
class Meta:
model = VTNService
+ fields = '__all__'
class VTNServiceAdmin(ReadOnlyAwareAdmin):
model = VTNService
@@ -89,7 +89,7 @@
suit_form_includes = ( # ('vtnadmin.html', 'top', 'administration'),
) #('hpctools.html', 'top', 'tools') )
- def queryset(self, request):
+ def get_queryset(self, request):
return VTNService.get_service_objects_by_user(request.user)
admin.site.register(VTNService, VTNServiceAdmin)
diff --git a/xos/services/vtr/admin.py b/xos/services/vtr/admin.py
index 5015fc8..96074a7 100644
--- a/xos/services/vtr/admin.py
+++ b/xos/services/vtr/admin.py
@@ -8,7 +8,6 @@
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.contrib.auth.signals import user_logged_in
from django.utils import timezone
-from django.contrib.contenttypes import generic
from suit.widgets import LinkedSelect
from core.admin import ServiceAppAdmin,SliceInline,ServiceAttrAsTabInline, ReadOnlyAwareAdmin, XOSTabularInline, ServicePrivilegeInline, TenantRootTenantInline, TenantRootPrivilegeInline
from core.middleware import get_request
@@ -45,7 +44,7 @@
suit_form_includes = (('vtradmin.html', 'top', 'administration'),
) #('hpctools.html', 'top', 'tools') )
- def queryset(self, request):
+ def get_queryset(self, request):
return VTRService.get_service_objects_by_user(request.user)
class VTRTenantForm(forms.ModelForm):
@@ -89,6 +88,7 @@
class Meta:
model = VTRTenant
+ fields = '__all__'
class VTRTenantAdmin(ReadOnlyAwareAdmin):
list_display = ('backend_status_icon', 'id', 'target', 'test', 'argument' )
@@ -104,7 +104,7 @@
def is_synced(self, obj):
return (obj.enacted is not None) and (obj.enacted >= obj.updated)
- def queryset(self, request):
+ def get_queryset(self, request):
return VTRTenant.get_tenant_objects_by_user(request.user)
admin.site.register(VTRService, VTRServiceAdmin)
diff --git a/xos/synchronizers/base/backend.py b/xos/synchronizers/base/backend.py
index af51e73..206c27f 100644
--- a/xos/synchronizers/base/backend.py
+++ b/xos/synchronizers/base/backend.py
@@ -3,7 +3,7 @@
import threading
import time
from synchronizers.base.event_loop import XOSObserver
-from synchronizers.base.event_manager import EventListener
+#from synchronizers.base.event_manager import EventListener
from xos.logger import Logger, logging
from synchronizers.model_policy import run_policy
from xos.config import Config
diff --git a/xos/synchronizers/base/event_loop.py b/xos/synchronizers/base/event_loop.py
index 37ec4ca..b67663c 100644
--- a/xos/synchronizers/base/event_loop.py
+++ b/xos/synchronizers/base/event_loop.py
@@ -17,8 +17,8 @@
from django.db.models import F, Q
from django.db import connection
from django.db import reset_queries
-#from openstack.manager import OpenStackManager
-from openstack.driver import OpenStackDriver
+#from openstack_xos.manager import OpenStackManager
+from openstack_xos.driver import OpenStackDriver
from xos.logger import Logger, logging, logger
#from timeout import timeout
from xos.config import Config, XOS_DIR
diff --git a/xos/synchronizers/base/run_ansible b/xos/synchronizers/base/run_ansible
index a504ec3..4e724fc 100755
--- a/xos/synchronizers/base/run_ansible
+++ b/xos/synchronizers/base/run_ansible
@@ -1,4 +1,3 @@
#!/bin/bash
-source /opt/ansible/hacking/env-setup >> /dev/null
ansible-playbook -v "$@"
diff --git a/xos/synchronizers/base/steps/sync_controller_networks.py b/xos/synchronizers/base/steps/sync_controller_networks.py
index 990cb87..f209f01 100644
--- a/xos/synchronizers/base/steps/sync_controller_networks.py
+++ b/xos/synchronizers/base/steps/sync_controller_networks.py
@@ -11,7 +11,7 @@
from core.models.instance import Instance
from xos.logger import observer_logger as logger
from synchronizers.base.ansible import *
-from openstack.driver import OpenStackDriver
+from openstack_xos.driver import OpenStackDriver
from xos.config import Config
import json
diff --git a/xos/synchronizers/base/steps/sync_controller_slices.py b/xos/synchronizers/base/steps/sync_controller_slices.py
index 97d8c29..2f36441 100644
--- a/xos/synchronizers/base/steps/sync_controller_slices.py
+++ b/xos/synchronizers/base/steps/sync_controller_slices.py
@@ -8,7 +8,7 @@
from synchronizers.base.syncstep import *
from core.models import *
from synchronizers.base.ansible import *
-from openstack.driver import OpenStackDriver
+from openstack_xos.driver import OpenStackDriver
from xos.logger import observer_logger as logger
import json
diff --git a/xos/synchronizers/base/steps/sync_instances.py b/xos/synchronizers/base/steps/sync_instances.py
index 335ca4a..2862474 100644
--- a/xos/synchronizers/base/steps/sync_instances.py
+++ b/xos/synchronizers/base/steps/sync_instances.py
@@ -75,7 +75,7 @@
#driver = self.driver.client_driver(caller=instance.creator, tenant=instance.slice.name, controller=instance.controllerNetwork)
driver = self.driver.admin_driver(tenant='admin', controller=instance.node.site_deployment.controller)
- nets = driver.shell.quantum.list_networks()['networks']
+ nets = driver.shell.neutron.list_networks()['networks']
for net in nets:
if net['name'] in network_templates:
nics.append(net['id'])
diff --git a/xos/synchronizers/base/steps/sync_instances.yaml b/xos/synchronizers/base/steps/sync_instances.yaml
index a61e5cf..70da32d 100644
--- a/xos/synchronizers/base/steps/sync_instances.yaml
+++ b/xos/synchronizers/base/steps/sync_instances.yaml
@@ -2,28 +2,26 @@
- hosts: 127.0.0.1
connection: local
tasks:
- - nova_compute:
- auth_url: {{ endpoint }}
- login_username: {{ admin_user }}
- login_password: {{ admin_password }}
- login_tenant_name: {{ admin_tenant }}
+ - os_server:
name: {{ name }}
+ auth:
+ auth_url: {{ endpoint }}
+ username: {{ admin_user }}
+ password: {{ admin_password }}
+ project_name: {{ project_name }}
{% if delete -%}
state: absent
{% else -%}
state: present
- availability_zone: {{ availability_zone }}
- image_name: {{ image_name }}
- wait_for: 200
- flavor_name: {{ flavor_name }}
- user_data: "{{ user_data }}"
+ availability_zone: "{{ availability_zone }}"
+ image: {{ image_name }}
+ flavor: {{ flavor_name }}
+ timeout: 200
+ userdata: "{{ user_data }}"
config_drive: yes
nics:
- {% for net in nics %}
- - net-id: {{ net }}
- {% endfor %}
- {% for port in ports %}
- - port-id: {{ port }}
+ {% for nic in nics %}
+ - {{ nic.kind }}-id: {{ nic.value }}
{% endfor %}
{% if meta %}
@@ -33,3 +31,4 @@
{% endfor %}
{% endif %}
{% endif %}
+
diff --git a/xos/synchronizers/base/steps/sync_object.py b/xos/synchronizers/base/steps/sync_object.py
index a6a939f..aaf2f25 100644
--- a/xos/synchronizers/base/steps/sync_object.py
+++ b/xos/synchronizers/base/steps/sync_object.py
@@ -7,7 +7,7 @@
from synchronizers.base.syncstep import *
from core.models import *
from synchronizers.base.ansible import *
-from openstack.driver import OpenStackDriver
+from openstack_xos.driver import OpenStackDriver
from xos.logger import observer_logger as logger
import json
diff --git a/xos/synchronizers/base/steps/sync_ports.py b/xos/synchronizers/base/steps/sync_ports.py
index 21376e5..8f2b66d 100644
--- a/xos/synchronizers/base/steps/sync_ports.py
+++ b/xos/synchronizers/base/steps/sync_ports.py
@@ -12,7 +12,7 @@
provides=[Port]
observes=Port
- # The way it works is to enumerate the all of the ports that quantum
+ # The way it works is to enumerate the all of the ports that neutron
# has, and then work backward from each port's network-id to determine
# which Network is associated from the port.
@@ -51,7 +51,7 @@
continue
try:
driver = self.driver.admin_driver(controller = controller)
- ports = driver.shell.quantum.list_ports()["ports"]
+ ports = driver.shell.neutron.list_ports()["ports"]
except:
logger.log_exc("failed to get ports from controller %s" % controller)
continue
@@ -63,7 +63,7 @@
# in the data model, so build up a list of which ids map to which network
# templates.
try:
- neutron_networks = driver.shell.quantum.list_networks()["networks"]
+ neutron_networks = driver.shell.neutron.list_networks()["networks"]
except:
print "failed to get networks from controller %s" % controller
continue
@@ -109,7 +109,7 @@
if network.template.shared_network_name:
# If it's a shared network template, then more than one network
- # object maps to the quantum network. We have to do a whole bunch
+ # object maps to the neutron network. We have to do a whole bunch
# of extra work to find the right one.
networks = network.template.network_set.all()
network = None
@@ -171,8 +171,8 @@
# A bunch of stuff to compensate for OpenStackDriver.client_driveR()
# not being in working condition.
- from openstack.client import OpenStackClient
- from openstack.driver import OpenStackDriver
+ from openstack_xos.client import OpenStackClient
+ from openstack_xos.driver import OpenStackDriver
caller = port.network.owner.creator
auth = {'username': caller.email,
'password': caller.remote_password,
@@ -180,7 +180,7 @@
client = OpenStackClient(controller=controller, **auth) # cacert=self.config.nova_ca_ssl_cert,
driver = OpenStackDriver(client=client)
- neutron_port = driver.shell.quantum.create_port({"port": {"network_id": cn.net_id}})["port"]
+ neutron_port = driver.shell.neutron.create_port({"port": {"network_id": cn.net_id}})["port"]
port.port_id = neutron_port["id"]
if neutron_port["fixed_ips"]:
port.ip = neutron_port["fixed_ips"][0]["ip_address"]
diff --git a/xos/synchronizers/model_policy.py b/xos/synchronizers/model_policy.py
index ef31d41..f59a9cc 100644
--- a/xos/synchronizers/model_policy.py
+++ b/xos/synchronizers/model_policy.py
@@ -1,16 +1,17 @@
+from core.models import *
+from datetime import datetime
+from django.db import reset_queries
+from django.db.models import F, Q
from django.db.models.signals import post_save
+from django.db.transaction import atomic
from django.dispatch import receiver
-import pdb
+from django.utils import timezone
from generate.dependency_walker import *
from synchronizers.openstack import model_policies
from xos.logger import logger
-from datetime import datetime
-from django.utils import timezone
+
+import pdb
import time
-from core.models import *
-from django.db import reset_queries
-from django.db.transaction import atomic
-from django.db.models import F, Q
modelPolicyEnabled = True
bad_instances=[]
@@ -91,7 +92,7 @@
instance.policed=timezone.now()
instance.save(update_fields=['policed'])
except:
- logging.error('Object %r is defective'%instance)
+ logger.error('Object %r is defective'%instance)
bad_instances.append(instance)
def noop(o,p):
@@ -138,3 +139,4 @@
except:
# this shouldn't happen, but in case it does, catch it...
logger.log_exc("exception in reset_queries")
+
diff --git a/xos/synchronizers/monitoring_channel/steps/sync_sflowtenant.yaml b/xos/synchronizers/monitoring_channel/steps/sync_sflowtenant.yaml
index 701ce5c..704cadf 100644
--- a/xos/synchronizers/monitoring_channel/steps/sync_sflowtenant.yaml
+++ b/xos/synchronizers/monitoring_channel/steps/sync_sflowtenant.yaml
@@ -24,5 +24,5 @@
uri:
url: http://{{ '{{' }} sflowserviceaddr.stdout {{ '}}' }}:{{ sflow_api_port }}/subscribe
body: "{{ listening_endpoint }}"
- body_format: raw
+ body_format: json
method: POST
diff --git a/xos/synchronizers/onos/steps/sync_onosapp.yaml b/xos/synchronizers/onos/steps/sync_onosapp.yaml
index 8235286..ee8846c 100644
--- a/xos/synchronizers/onos/steps/sync_onosapp.yaml
+++ b/xos/synchronizers/onos/steps/sync_onosapp.yaml
@@ -92,7 +92,7 @@
uri:
url: http://{{ '{{' }} onosaddr.stdout {{ '}}' }}:8181/{{ '{{' }} item.endpoint {{ '}}' }}
body: "{{ '{{' }} item.body {{ '}}' }}"
- body_format: raw
+ body_format: json
method: POST
user: karaf
password: karaf
@@ -164,7 +164,7 @@
uri:
url: http://{{ '{{' }} onosaddr.stdout {{ '}}' }}:8181/{{ '{{' }} item.endpoint {{ '}}' }} #http://localhost:8181/onos/v1/network/configuration/
body: "{{ '{{' }} item.body {{ '}}' }}"
- body_format: raw
+ body_format: json
method: POST
user: karaf
password: karaf
diff --git a/xos/synchronizers/onos/steps/sync_onosapp_nocontainer.yaml b/xos/synchronizers/onos/steps/sync_onosapp_nocontainer.yaml
index 5aad569..bb74dae 100644
--- a/xos/synchronizers/onos/steps/sync_onosapp_nocontainer.yaml
+++ b/xos/synchronizers/onos/steps/sync_onosapp_nocontainer.yaml
@@ -49,7 +49,7 @@
uri:
url: http://{{ '{{' }} rest_hostname {{ '}}' }}:{{ '{{' }} rest_port {{ '}}' }}/{{ '{{' }} item.endpoint {{ '}}' }} #http://localhost:8181/onos/v1/network/configuration/
body: "{{ '{{' }} item.body {{ '}}' }}"
- body_format: raw
+ body_format: json
method: POST
user: karaf
password: karaf
diff --git a/xos/synchronizers/openstack/steps/sync_controller_networks.py b/xos/synchronizers/openstack/steps/sync_controller_networks.py
index cf855c6..b61ef7b 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_networks.py
+++ b/xos/synchronizers/openstack/steps/sync_controller_networks.py
@@ -13,7 +13,7 @@
from core.models.instance import Instance
from xos.logger import observer_logger as logger
from synchronizers.base.ansible import *
-from openstack.driver import OpenStackDriver
+from openstack_xos.driver import OpenStackDriver
from xos.config import Config
import json
@@ -77,8 +77,8 @@
network_fields = {'endpoint':controller_network.controller.auth_url,
'endpoint_v3': controller_network.controller.auth_url_v3,
'admin_user':slice.creator.email,
- 'tenant_name':slice.name,
'admin_password':slice.creator.remote_password,
+ 'admin_project':slice.name,
'domain': controller_network.controller.domain,
'name':network_name,
'subnet_name':subnet_name,
@@ -93,8 +93,8 @@
return network_fields
def map_sync_outputs(self, controller_network,res):
- network_id = res[0]['id']
- subnet_id = res[1]['id']
+ network_id = res[0]['network']['id']
+ subnet_id = res[1]['subnet']['id']
controller_network.net_id = network_id
controller_network.subnet = self.cidr
controller_network.subnet_id = subnet_id
diff --git a/xos/synchronizers/openstack/steps/sync_controller_networks.yaml b/xos/synchronizers/openstack/steps/sync_controller_networks.yaml
index 6fb9a92..b11c575 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_networks.yaml
+++ b/xos/synchronizers/openstack/steps/sync_controller_networks.yaml
@@ -2,44 +2,44 @@
- hosts: 127.0.0.1
connection: local
tasks:
- - quantum_network:
- auth_url={{ endpoint }}
- login_username={{ admin_user }}
- login_tenant_name={{ tenant_name }}
- login_password={{ admin_password }}
- tenant_name={{ tenant_name }}
- name={{ name }}
- {% if delete %}
- state=absent
- {% else %}
- state=present
- {% endif %}
- shared=true
- {% if not delete %}
- - quantum_subnet:
- auth_url={{ endpoint }}
- login_username={{ admin_user }}
- login_tenant_name={{ tenant_name }}
- login_password={{ admin_password }}
- tenant_name={{ tenant_name }}
- name={{ subnet_name }}
- network_name={{ name }}
- {% if delete %}
- state=absent
- {% else %}
- state=present
- {% if use_vtn %}
- gateway_ip={{ gateway }}
- {% else %}
- no_gateway=true
- {% endif %}
- dns_nameservers=8.8.8.8
- cidr={{ cidr }}
- {% if start_ip %}
- allocation_pool_start={{ start_ip }}
- {% endif %}
- {% if end_ip %}
- allocation_pool_end={{ end_ip }}
- {% endif %}
- {% endif %}
- {% endif %}
+ - os_network:
+ name: {{ name }}
+ shared: true
+ {% if not delete -%}
+ state: present
+ {% else -%}
+ state: absent
+ {% endif -%}
+ auth:
+ auth_url: {{ endpoint }}
+ username: {{ admin_user }}
+ password: {{ admin_password }}
+ project_name: {{ admin_project }}
+
+{% if not delete %}
+ - os_subnet:
+ name: {{ subnet_name }}
+ network_name: {{ name }}
+ {% if not delete -%}
+ state: present
+ cidr: {{ cidr }}
+ dns_nameservers: 8.8.8.8
+ {% if use_vtn -%}
+ gateway_ip: {{ gateway }}
+ {% endif -%}
+ {% if start_ip -%}
+ allocation_pool_start: {{ start_ip }}
+ {% endif -%}
+ {% if end_ip -%}
+ allocation_pool_end: {{ end_ip }}
+ {% endif -%}
+ {% else -%}
+ state: absent
+ {% endif -%}
+ auth:
+ auth_url: {{ endpoint }}
+ username: {{ admin_user }}
+ password: {{ admin_password }}
+ project_name: {{ admin_project }}
+{% endif %}
+
diff --git a/xos/synchronizers/openstack/steps/sync_controller_slices.py b/xos/synchronizers/openstack/steps/sync_controller_slices.py
index 97d8c29..081a384 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_slices.py
+++ b/xos/synchronizers/openstack/steps/sync_controller_slices.py
@@ -8,7 +8,7 @@
from synchronizers.base.syncstep import *
from core.models import *
from synchronizers.base.ansible import *
-from openstack.driver import OpenStackDriver
+from openstack_xos.driver import OpenStackDriver
from xos.logger import observer_logger as logger
import json
@@ -31,7 +31,8 @@
raise Exception("slice createor %s has not accout at controller %s" % (controller_slice.slice.creator, controller_slice.controller.name))
else:
controller_user = controller_users[0]
- roles = ['admin']
+ admin_role = getattr(Config(), "nova_admin_role", "admin")
+ roles = [admin_role]
max_instances=int(controller_slice.slice.max_instances)
tenant_fields = {'endpoint':controller_slice.controller.auth_url,
diff --git a/xos/synchronizers/openstack/steps/sync_controller_users.py b/xos/synchronizers/openstack/steps/sync_controller_users.py
index 9af48e5..3b1e8a1 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_users.py
+++ b/xos/synchronizers/openstack/steps/sync_controller_users.py
@@ -25,9 +25,10 @@
# All users will have at least the 'user' role at their home site/tenant.
# We must also check if the user should have the admin role
+ admin_role = getattr(Config(), "nova_admin_role", "admin")
roles = ['user']
if controller_user.user.is_admin:
- roles.append('admin')
+ roles.append(admin_role)
# setup user home site roles at controller
if not controller_user.user.site:
@@ -52,14 +53,14 @@
'admin_user': controller_user.controller.admin_user,
'admin_password': controller_user.controller.admin_password,
'ansible_tag':'%s@%s'%(controller_user.user.email.replace('@','-at-'),controller_user.controller.name),
- 'admin_tenant': controller_user.controller.admin_tenant,
+ 'admin_project': controller_user.controller.admin_tenant,
'roles':roles,
- 'tenant':controller_user.user.site.login_base
+ 'project':controller_user.user.site.login_base
}
return user_fields
def map_sync_outputs(self, controller_user, res):
- controller_user.kuser_id = res[0]['id']
+ controller_user.kuser_id = res[0]['user']['id']
controller_user.backend_status = '1 - OK'
controller_user.save()
diff --git a/xos/synchronizers/openstack/steps/sync_controller_users.yaml b/xos/synchronizers/openstack/steps/sync_controller_users.yaml
index 4f2db5e..7a8b1c6 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_users.yaml
+++ b/xos/synchronizers/openstack/steps/sync_controller_users.yaml
@@ -2,15 +2,48 @@
- hosts: 127.0.0.1
connection: local
tasks:
- - keystone_user:
- endpoint={{ endpoint }}
- login_user={{ admin_user }}
- login_password={{ admin_password }}
- login_tenant_name={{ admin_tenant }}
- user="{{ name }}"
- email={{ email }}
- password={{ password }}
- tenant={{ tenant }}
- {% for role in roles %}
- - keystone_user: endpoint={{ endpoint}} login_user={{ admin_user }} login_password={{ admin_password }} login_tenant_name={{ admin_tenant }} user="{{ name }}" role={{ role }} tenant={{ tenant }}
- {% endfor %}
+
+ - name: Create user account for "{{ name }}"
+ os_user:
+ name: "{{ name }}"
+ email: "{{ email }}"
+ password: "{{ password }}"
+ auth:
+ auth_url: {{ endpoint }}
+ username: {{ admin_user }}
+ password: {{ admin_password }}
+ project_name: {{ admin_project }}
+
+ - name: Create project for "{{ project }}"
+ os_project:
+ name: "{{ project }}"
+ auth:
+ auth_url: {{ endpoint }}
+ username: {{ admin_user }}
+ password: {{ admin_password }}
+ project_name: {{ admin_project }}
+
+{% for role in roles %}
+ - name: Creating role "{{ role }}" for "{{ name }}" on "{{ project }}"
+ keystone_user:
+ user: "{{ name }}"
+ role: "{{ role }}"
+ tenant: "{{ project }}"
+ endpoint: {{ endpoint }}
+ login_user: {{ admin_user }}
+ login_password: {{ admin_password }}
+ login_tenant_name: {{ admin_project }}
+{% endfor %}
+
+# FIXME: the below should work in Ansible 2.1
+# - name: Creating role "{{ role }}" for "{{ name }}" on "{{ project }}"
+# os_user_role:
+# user: "{{ name }}"
+# role: "{{ role }}"
+# project: "{{ project }}"
+# auth:
+# auth_url: {{ endpoint }}
+# username: {{ admin_user }}
+# password: {{ admin_password }}
+# project_name: {{ admin_project }}
+
diff --git a/xos/synchronizers/openstack/steps/sync_instances.py b/xos/synchronizers/openstack/steps/sync_instances.py
index faeb860..5cec50d 100644
--- a/xos/synchronizers/openstack/steps/sync_instances.py
+++ b/xos/synchronizers/openstack/steps/sync_instances.py
@@ -119,7 +119,7 @@
#driver = self.driver.client_driver(caller=instance.creator, tenant=instance.slice.name, controller=instance.controllerNetwork)
driver = self.driver.admin_driver(tenant='admin', controller=instance.node.site_deployment.controller)
- nets = driver.shell.quantum.list_networks()['networks']
+ nets = driver.shell.neutron.list_networks()['networks']
for net in nets:
if net['name'] in network_templates:
nics.append({"kind": "net", "value": net['id'], "network": None})
@@ -169,7 +169,7 @@
'domain': controller.domain,
'admin_user': instance.creator.email,
'admin_password': instance.creator.remote_password,
- 'admin_tenant': instance.slice.name,
+ 'project_name': instance.slice.name,
'tenant': instance.slice.name,
'tenant_description': instance.slice.description,
'name':instance_name,
@@ -184,11 +184,11 @@
def map_sync_outputs(self, instance, res):
- instance_id = res[0]['info']['OS-EXT-SRV-ATTR:instance_name']
+ instance_id = res[0]['openstack']['OS-EXT-SRV-ATTR:instance_name']
instance_uuid = res[0]['id']
try:
- hostname = res[0]['info']['OS-EXT-SRV-ATTR:hypervisor_hostname']
+ hostname = res[0]['openstack']['OS-EXT-SRV-ATTR:hypervisor_hostname']
ip = socket.gethostbyname(hostname)
instance.ip = ip
except:
diff --git a/xos/synchronizers/openstack/steps/sync_instances.yaml b/xos/synchronizers/openstack/steps/sync_instances.yaml
index 3e7182a..70da32d 100644
--- a/xos/synchronizers/openstack/steps/sync_instances.yaml
+++ b/xos/synchronizers/openstack/steps/sync_instances.yaml
@@ -2,21 +2,22 @@
- hosts: 127.0.0.1
connection: local
tasks:
- - nova_compute:
- auth_url: {{ endpoint }}
- login_username: {{ admin_user }}
- login_password: {{ admin_password }}
- login_tenant_name: {{ admin_tenant }}
+ - os_server:
name: {{ name }}
+ auth:
+ auth_url: {{ endpoint }}
+ username: {{ admin_user }}
+ password: {{ admin_password }}
+ project_name: {{ project_name }}
{% if delete -%}
state: absent
{% else -%}
state: present
- availability_zone: {{ availability_zone }}
- image_name: {{ image_name }}
- wait_for: 200
- flavor_name: {{ flavor_name }}
- user_data: "{{ user_data }}"
+ availability_zone: "{{ availability_zone }}"
+ image: {{ image_name }}
+ flavor: {{ flavor_name }}
+ timeout: 200
+ userdata: "{{ user_data }}"
config_drive: yes
nics:
{% for nic in nics %}
@@ -30,3 +31,4 @@
{% endfor %}
{% endif %}
{% endif %}
+
diff --git a/xos/synchronizers/openstack/steps/sync_object.py b/xos/synchronizers/openstack/steps/sync_object.py
index a6a939f..aaf2f25 100644
--- a/xos/synchronizers/openstack/steps/sync_object.py
+++ b/xos/synchronizers/openstack/steps/sync_object.py
@@ -7,7 +7,7 @@
from synchronizers.base.syncstep import *
from core.models import *
from synchronizers.base.ansible import *
-from openstack.driver import OpenStackDriver
+from openstack_xos.driver import OpenStackDriver
from xos.logger import observer_logger as logger
import json
diff --git a/xos/synchronizers/openstack/steps/sync_ports.py b/xos/synchronizers/openstack/steps/sync_ports.py
index 4f6ce14..afb8321 100644
--- a/xos/synchronizers/openstack/steps/sync_ports.py
+++ b/xos/synchronizers/openstack/steps/sync_ports.py
@@ -12,7 +12,7 @@
provides=[Port]
observes=Port
- # The way it works is to enumerate the all of the ports that quantum
+ # The way it works is to enumerate the all of the ports that neutron
# has, and then work backward from each port's network-id to determine
# which Network is associated from the port.
@@ -30,8 +30,8 @@
# A bunch of stuff to compensate for OpenStackDriver.client_driveR()
# not being in working condition.
- from openstack.client import OpenStackClient
- from openstack.driver import OpenStackDriver
+ from openstack_xos.client import OpenStackClient
+ from openstack_xos.driver import OpenStackDriver
controller = port.instance.node.site_deployment.controller
slice = port.instance.slice
caller = port.network.owner.creator
@@ -78,7 +78,7 @@
continue
try:
driver = self.driver.admin_driver(controller = controller)
- ports = driver.shell.quantum.list_ports()["ports"]
+ ports = driver.shell.neutron.list_ports()["ports"]
except:
logger.log_exc("failed to get ports from controller %s" % controller)
continue
@@ -90,7 +90,7 @@
# in the data model, so build up a list of which ids map to which network
# templates.
try:
- neutron_networks = driver.shell.quantum.list_networks()["networks"]
+ neutron_networks = driver.shell.neutron.list_networks()["networks"]
except:
print "failed to get networks from controller %s" % controller
continue
@@ -136,7 +136,7 @@
if network.template.shared_network_name:
# If it's a shared network template, then more than one network
- # object maps to the quantum network. We have to do a whole bunch
+ # object maps to the neutron network. We have to do a whole bunch
# of extra work to find the right one.
networks = network.template.network_set.all()
network = None
@@ -198,7 +198,7 @@
if neutron_port_name:
args["name"] = neutron_port_name
- neutron_port = driver.shell.quantum.create_port({"port": args})["port"]
+ neutron_port = driver.shell.neutron.create_port({"port": args})["port"]
port.port_id = neutron_port["id"]
if neutron_port["fixed_ips"]:
port.ip = neutron_port["fixed_ips"][0]["ip_address"]
@@ -220,7 +220,7 @@
logger.info("calling openstack to destroy port %s" % port.port_id)
try:
driver = self.get_driver(port)
- driver.shell.quantum.delete_port(port.port_id)
+ driver.shell.neutron.delete_port(port.port_id)
except:
logger.log_exc("failed to delete port %s from neutron" % port.port_id)
return
diff --git a/xos/synchronizers/vtn/steps/sync_port_addresses.py b/xos/synchronizers/vtn/steps/sync_port_addresses.py
index bbc6c99..d662ff3 100644
--- a/xos/synchronizers/vtn/steps/sync_port_addresses.py
+++ b/xos/synchronizers/vtn/steps/sync_port_addresses.py
@@ -84,7 +84,7 @@
continue
try:
driver = self.driver.admin_driver(controller = controller)
- ports = driver.shell.quantum.list_ports()["ports"]
+ ports = driver.shell.neutron.list_ports()["ports"]
except:
logger.log_exc("failed to get ports from controller %s" % controller)
continue
@@ -124,7 +124,7 @@
if changed:
logger.info("updating port %s" % port)
- driver.shell.quantum.update_port(port.port_id, {"port": {"allowed_address_pairs": aaps}})
+ driver.shell.neutron.update_port(port.port_id, {"port": {"allowed_address_pairs": aaps}})
diff --git a/xos/templates/admin/base.html b/xos/templates/admin/base.html
index 408a1e8..f29ae73 100644
--- a/xos/templates/admin/base.html
+++ b/xos/templates/admin/base.html
@@ -25,7 +25,7 @@
<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}"/>
{% endif %}
<script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% static "admin/" %}{% endfilter %}";</script>
- <script src="{% static 'suit/js/jquery-1.9.1.min.js' %}"></script>
+ <script src="{% static 'suit/js/jquery-1.12.3.min.js' %}"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script type="text/javascript" src="{% static 'log4javascript-1.4.6/log4javascript.js' %}"></script>
diff --git a/xos/templates/admin/dashboard/dashboard_base.html b/xos/templates/admin/dashboard/dashboard_base.html
index 5d510b8..6977da4 100644
--- a/xos/templates/admin/dashboard/dashboard_base.html
+++ b/xos/templates/admin/dashboard/dashboard_base.html
@@ -12,11 +12,6 @@
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
-
-
-<!-- no need to include jquery here as it's already included by base.html. Including it multiple times will break mtuity statistics. -->
-<!-- src="http://code.jquery.com/jquery-1.9.1.js" -->
-
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="{% static 'log4javascript-1.4.6/log4javascript.js' %}"></script>
diff --git a/xos/templates/admin/login.html b/xos/templates/admin/login.html
index 386d579..34b7415 100644
--- a/xos/templates/admin/login.html
+++ b/xos/templates/admin/login.html
@@ -6,7 +6,7 @@
{% if XOS_BRANDING_CSS %}
<link rel="stylesheet" type="text/css" href="{{ XOS_BRANDING_CSS }}">
{% endif %}
-<script src="{% static 'suit/js/jquery-1.9.1.min.js' %}"></script>
+<script src="{% static 'suit/js/jquery-1.12.3.min.js' %}"></script>
<script src="http://code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
{% endblock %}
diff --git a/xos/templates/admin/wholePage.html b/xos/templates/admin/wholePage.html
index 156c8aa..1df13c9 100644
--- a/xos/templates/admin/wholePage.html
+++ b/xos/templates/admin/wholePage.html
@@ -5,7 +5,7 @@
<link rel="stylesheet" type="text/css" href="{% static 'suit/bootstrap/css/bootstrap.min.css' %}" media="all"/>
<link rel="stylesheet" type="text/css" href="{% static 'suit/css/suit.css' %}" media="all">
<link rel="stylesheet" type="text/css" href="{% static 'xos.css' %}" media="all">
-<script src="{% static 'suit/js/jquery-1.9.1.min.js' %}"></script>
+<script src="{% static 'suit/js/jquery-1.12.3.min.js' %}"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
{% block extrahead %}{% endblock %}
</head>
diff --git a/xos/tools/xos-manage b/xos/tools/xos-manage
index a4705d9..594a9c3 100755
--- a/xos/tools/xos-manage
+++ b/xos/tools/xos-manage
@@ -128,7 +128,7 @@
mkdir -p private_keys
echo "Generating keys"
keyczart create --location=private_keys --name="OpenCloud" --purpose=crypt --asymmetric=rsa
- keyczart addkey --location=private_keys --status=primary --size=1024
+ keyczart addkey --location=private_keys --status=primary --size=2048
keyczart pubkey --location=private_keys --destination=public_keys
if [[ ! -f public_keys/1 ]]; then
echo "FAILED to create keys"
@@ -145,6 +145,7 @@
python ./manage.py makemigrations cord
python ./manage.py makemigrations mcord
python ./manage.py makemigrations ceilometer
+ python ./manage.py makemigrations exampleservice
python ./manage.py makemigrations onos
python ./manage.py makemigrations openvpn
python ./manage.py makemigrations vtr
diff --git a/xos/xos/settings.py b/xos/xos/settings.py
index 2f8fa27..a4f44ba 100644
--- a/xos/xos/settings.py
+++ b/xos/xos/settings.py
@@ -32,7 +32,7 @@
GEOIP_PATH = "/usr/share/GeoIP"
XOS_DIR = "/opt/xos"
-DEBUG = True
+DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
@@ -186,6 +186,7 @@
'services.mcord',
'services.onos',
'services.ceilometer',
+ 'services.exampleservice',
'services.requestrouter',
'services.syndicate_storage',
'services.openvpn',