Merge branch 'feature/vRouter'
diff --git a/apiary.apib b/apiary.apib
new file mode 100644
index 0000000..43a81c7
--- /dev/null
+++ b/apiary.apib
@@ -0,0 +1,461 @@
+FORMAT: 1A
+
+# XOS
+
+
+# Group ONOS Services
+
+## ONOS Services Collection [/api/service/onos/]
+
+### List all ONOS Services [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "service_ONOS_vBNG",
+ "id": 5,
+ "rest_hostname": "",
+ "rest_port": "8181",
+ "no_container": false,
+ "node_key": ""
+ }
+ ]
+
+
+# Group vSG
+
+## vSG Collection [/api/service/vsg/]
+
+### List all vSGs [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "service_vsg",
+ "id": 2,
+ "wan_container_gateway_ip": "",
+ "wan_container_gateway_mac": "",
+ "dns_servers": "8.8.8.8",
+ "url_filter_kind": null,
+ "node_label": null
+ }
+ ]
+
+
+# Group Subscribers
+
+Resource related to the CORD Subscribers.
+
+## Subscribers Collection [/api/tenant/cord/subscriber/]
+
+### List All Subscribers [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "cordSubscriber-1",
+ "id": 1,
+ "features": {
+ "cdn": false,
+ "uplink_speed": 1000000000,
+ "downlink_speed": 1000000000,
+ "uverse": false,
+ "status": "enabled"
+ },
+ "identity": {
+ "account_num": "123",
+ "name": "My House"
+ },
+ "related": {
+ "instance_name": "mysite_vcpe",
+ "vsg_id": 4,
+ "compute_node_name": "node2.opencloud.us",
+ "c_tag": "432",
+ "instance_id": 1,
+ "wan_container_ip": null,
+ "volt_id": 3,
+ "s_tag": "222"
+ }
+ }
+ ]
+
+## Subscriber Detail [/api/tenant/cord/subscriber/{subscriber_id}/]
+
++ Parameters
+ + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer
+
+### View a Subscriber Detail [GET]
+
++ Response 200 (application/json)
+
+ {
+ "humanReadableName": "cordSubscriber-1",
+ "id": 1,
+ "features": {
+ "cdn": false,
+ "uplink_speed": 1000000000,
+ "downlink_speed": 1000000000,
+ "uverse": false,
+ "status": "enabled"
+ },
+ "identity": {
+ "account_num": "123",
+ "name": "My House"
+ },
+ "related": {
+ "instance_name": "mysite_vcpe",
+ "vsg_id": 4,
+ "compute_node_name": "node2.opencloud.us",
+ "c_tag": "432",
+ "instance_id": 1,
+ "wan_container_ip": null,
+ "volt_id": 3,
+ "s_tag": "222"
+ }
+ }
+
+### Delete a Subscriber [DELETE]
+
++ Response 204
+
+### Subscriber features [/api/tenant/cord/subscriber/{subscriber_id}/features/]
+
++ Parameters
+ + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer
+
+### View a Subscriber Features Detail [GET]
+
++ Response 200 (application/json)
+
+ {
+ "cdn": false,
+ "uplink_speed": 1000000000,
+ "downlink_speed": 1000000000,
+ "uverse": true,
+ "status": "enabled"
+ }
+
+#### Subscriber features uplink_speed [/api/tenant/cord/subscriber/{subscriber_id}/features/uplink_speed/]
+
++ Parameters
+ + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer
+
+#### Read Subscriber uplink_speed [GET]
+
++ Response 200 (application/json)
+
+ {
+ "uplink_speed": 1000000000
+ }
+
+#### Update Subscriber uplink_speed [PUT]
+
++ Request 200 (application/json)
+
+ {
+ "uplink_speed": 1000000000
+ }
+
++ Response 200 (application/json)
+
+ {
+ "uplink_speed": 1000000000
+ }
+
+#### Subscriber features downlink_speed [/api/tenant/cord/subscriber/{subscriber_id}/features/downlink_speed/]
+
++ Parameters
+ + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer
+
+#### Read Subscriber downlink_speed [GET]
+
++ Response 200 (application/json)
+
+ {
+ "downlink_speed": 1000000000
+ }
+
+#### Update Subscriber downlink_speed [PUT]
+
++ Request 200 (application/json)
+
+ {
+ "downlink_speed": 1000000000
+ }
+
++ Response 200 (application/json)
+
+ {
+ "downlink_speed": 1000000000
+ }
+
+#### Subscriber features cdn [/api/tenant/cord/subscriber/{subscriber_id}/features/cdn/]
+
++ Parameters
+ + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer
+
+#### Read Subscriber cdn [GET]
+
++ Response 200 (application/json)
+
+ {
+ "cdn": false
+ }
+
+#### Update Subscriber cdn [PUT]
+
++ Request 200 (application/json)
+
+ {
+ "cdn": false
+ }
+
++ Response 200 (application/json)
+
+ {
+ "cdn": false
+ }
+
+#### Subscriber features uverse [/api/tenant/cord/subscriber/{subscriber_id}/features/uverse/]
+
++ Parameters
+ + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer
+
+#### Read Subscriber uverse [GET]
+
++ Response 200 (application/json)
+
+ {
+ "uverse": false
+ }
+
+#### Update Subscriber uverse [PUT]
+
++ Request 200 (application/json)
+
+ {
+ "uverse": false
+ }
+
++ Response 200 (application/json)
+
+ {
+ "uverse": false
+ }
+
+#### Subscriber features status [/api/tenant/cord/subscriber/{subscriber_id}/features/status/]
+
++ Parameters
+ + subscriber_id: 1 (number) - ID of the Subscriber in the form of an integer
+
+#### Read Subscriber status [GET]
+
++ Response 200 (application/json)
+
+ {
+ "status": "enabled"
+ }
+
+#### Update Subscriber status [PUT]
+
++ Request 200 (application/json)
+
+ {
+ "status": "enabled"
+ }
+
++ Response 200 (application/json)
+
+ {
+ "status": "enabled"
+ }
+
+
+# Group Truckroll
+
+Virtual Truckroll, enable to perform basic test on user connectivity such as ping, traceroute and tcpdump.
+
+## Truckroll Collection [/api/tenant/truckroll/]
+
+### List all Truckroll [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "vTR-tenant-9",
+ "id": 9,
+ "provider_service": 6,
+ "target_id": 2,
+ "scope": "container",
+ "test": "ping",
+ "argument": "8.8.8.8",
+ "result": "",
+ "result_code": "",
+ "is_synced": false,
+ "backend_status": "2 - Exception('Unreachable results in ansible recipe',)"
+ }
+ ]
+
+### Create a Truckroll [POST]
+
++ Request (application/json)
+
+ {
+ "target_id": 2,
+ "scope": "container",
+ "test": "ping",
+ "argument": "8.8.8.8"
+ }
+
++ Response 201 (application/json)
+
+ {
+ "humanReadableName": "vTR-tenant-1",
+ "id": 1,
+ "provider_service": 6,
+ "target_id": 2,
+ "scope": "container",
+ "test": "ping",
+ "argument": "8.8.8.8",
+ "result": null,
+ "result_code": null,
+ "is_synced": false,
+ "backend_status": "0 - Provisioning in progress"
+ }
+
+## Truckroll Detail [/api/tenant/truckroll/{truckroll_id}/]
+
+A virtual truckroll is complete once is_synced equal true
+
++ Parameters
+ + truckroll_id: 1 (number) - ID of the Truckroll in the form of an integer
+
+### View a Truckroll Detail [GET]
+
++ Response 200 (application/json)
+
+ {
+ "humanReadableName": "vTR-tenant-10",
+ "id": 10,
+ "provider_service": 6,
+ "target_id": 2,
+ "scope": "container",
+ "test": "ping",
+ "argument": "8.8.8.8",
+ "result": null,
+ "result_code": null,
+ "is_synced": false,
+ "backend_status": "0 - Provisioning in progress"
+ }
+
+### Delete a Truckroll Detail [DELETE]
+
++ Response 204
+
+
+
+# Group vOLT
+
+OLT devices aggregate a set of subscriber connections
+
+## vOLT Collection [/api/tenant/cord/volt/]
+
+### List all vOLT [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "vOLT-tenant-1",
+ "id": 1,
+ "service_specific_id": "123",
+ "s_tag": "222",
+ "c_tag": "432",
+ "subscriber": 1,
+ "related": {
+ "instance_id": 1,
+ "instance_name": "mysite_vcpe",
+ "vsg_id": 4,
+ "wan_container_ip": null,
+ "compute_node_name": "node2.opencloud.us"
+ }
+ }
+ ]
+
+### Create a vOLT [POST]
+
++ Request (application/json)
+
+ {
+ "s_tag": "222",
+ "c_tag": "432",
+ "subscriber": 1
+ }
+
++ Response 201 (application/json)
+
+ {
+ "humanReadableName": "vOLT-tenant-1",
+ "id": 1,
+ "service_specific_id": "123",
+ "s_tag": "222",
+ "c_tag": "432",
+ "subscriber": 1,
+ "related": {
+ "instance_id": 1,
+ "instance_name": "mysite_vcpe",
+ "vsg_id": 4,
+ "wan_container_ip": null,
+ "compute_node_name": "node2.opencloud.us"
+ }
+ }
+
+## vOLT Detail [/api/tenant/cord/volt/{volt_id}/]
+
+A virtual volt is complete once is_synced equal true
+
++ Parameters
+ + volt_id: 1 (number) - ID of the vOLT in the form of an integer
+
+### View a vOLT Detail [GET]
+
++ Response 200 (application/json)
+
+ {
+ "humanReadableName": "vOLT-tenant-1",
+ "id": 1,
+ "service_specific_id": "123",
+ "s_tag": "222",
+ "c_tag": "432",
+ "subscriber": 1,
+ "related": {
+ "instance_id": 1,
+ "instance_name": "mysite_vcpe",
+ "vsg_id": 4,
+ "wan_container_ip": null,
+ "compute_node_name": "node2.opencloud.us"
+ }
+ }
+
+
+
+# Group ONOS Apps
+
+## app Collection [/api/tenant/onos/app/]
+
+### List all apps [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "onos-tenant-7",
+ "id": 7,
+ "name": "vBNG_ONOS_app",
+ "dependencies": "org.onosproject.proxyarp, org.onosproject.virtualbng, org.onosproject.openflow, org.onosproject.fwd"
+ }
+ ]
\ No newline at end of file
diff --git a/xos/configurations/cord/Dockerfile.cord b/xos/configurations/cord-deprecated/Dockerfile.cord
similarity index 100%
rename from xos/configurations/cord/Dockerfile.cord
rename to xos/configurations/cord-deprecated/Dockerfile.cord
diff --git a/xos/configurations/cord/Makefile b/xos/configurations/cord-deprecated/Makefile
similarity index 100%
rename from xos/configurations/cord/Makefile
rename to xos/configurations/cord-deprecated/Makefile
diff --git a/xos/configurations/cord/Makefile.inside b/xos/configurations/cord-deprecated/Makefile.inside
similarity index 100%
rename from xos/configurations/cord/Makefile.inside
rename to xos/configurations/cord-deprecated/Makefile.inside
diff --git a/xos/configurations/cord/README-VTN.md b/xos/configurations/cord-deprecated/README-VTN.md
similarity index 100%
rename from xos/configurations/cord/README-VTN.md
rename to xos/configurations/cord-deprecated/README-VTN.md
diff --git a/xos/configurations/cord/README.md b/xos/configurations/cord-deprecated/README.md
similarity index 100%
rename from xos/configurations/cord/README.md
rename to xos/configurations/cord-deprecated/README.md
diff --git a/xos/configurations/cord/ceilometer.yaml b/xos/configurations/cord-deprecated/ceilometer.yaml
similarity index 100%
rename from xos/configurations/cord/ceilometer.yaml
rename to xos/configurations/cord-deprecated/ceilometer.yaml
diff --git a/xos/configurations/cord/cord.yaml b/xos/configurations/cord-deprecated/cord.yaml
similarity index 100%
rename from xos/configurations/cord/cord.yaml
rename to xos/configurations/cord-deprecated/cord.yaml
diff --git a/xos/configurations/cord/dataplane/ansible.cfg b/xos/configurations/cord-deprecated/dataplane/ansible.cfg
similarity index 100%
rename from xos/configurations/cord/dataplane/ansible.cfg
rename to xos/configurations/cord-deprecated/dataplane/ansible.cfg
diff --git a/xos/configurations/cord/dataplane/change_controller.sh b/xos/configurations/cord-deprecated/dataplane/change_controller.sh
similarity index 100%
rename from xos/configurations/cord/dataplane/change_controller.sh
rename to xos/configurations/cord-deprecated/dataplane/change_controller.sh
diff --git a/xos/configurations/cord/dataplane/cleanup.sh b/xos/configurations/cord-deprecated/dataplane/cleanup.sh
similarity index 100%
rename from xos/configurations/cord/dataplane/cleanup.sh
rename to xos/configurations/cord-deprecated/dataplane/cleanup.sh
diff --git a/xos/configurations/cord/dataplane/dataplane-bm.yaml b/xos/configurations/cord-deprecated/dataplane/dataplane-bm.yaml
similarity index 100%
rename from xos/configurations/cord/dataplane/dataplane-bm.yaml
rename to xos/configurations/cord-deprecated/dataplane/dataplane-bm.yaml
diff --git a/xos/configurations/cord/dataplane/dataplane-vtn.yaml b/xos/configurations/cord-deprecated/dataplane/dataplane-vtn.yaml
similarity index 100%
rename from xos/configurations/cord/dataplane/dataplane-vtn.yaml
rename to xos/configurations/cord-deprecated/dataplane/dataplane-vtn.yaml
diff --git a/xos/configurations/cord/dataplane/dataplane.yaml b/xos/configurations/cord-deprecated/dataplane/dataplane.yaml
similarity index 100%
rename from xos/configurations/cord/dataplane/dataplane.yaml
rename to xos/configurations/cord-deprecated/dataplane/dataplane.yaml
diff --git a/xos/configurations/cord/dataplane/gen-etc-hosts.sh b/xos/configurations/cord-deprecated/dataplane/gen-etc-hosts.sh
similarity index 100%
rename from xos/configurations/cord/dataplane/gen-etc-hosts.sh
rename to xos/configurations/cord-deprecated/dataplane/gen-etc-hosts.sh
diff --git a/xos/configurations/cord/dataplane/gen-inventory.sh b/xos/configurations/cord-deprecated/dataplane/gen-inventory.sh
similarity index 100%
rename from xos/configurations/cord/dataplane/gen-inventory.sh
rename to xos/configurations/cord-deprecated/dataplane/gen-inventory.sh
diff --git a/xos/configurations/cord/dataplane/generate-bm.sh b/xos/configurations/cord-deprecated/dataplane/generate-bm.sh
similarity index 100%
rename from xos/configurations/cord/dataplane/generate-bm.sh
rename to xos/configurations/cord-deprecated/dataplane/generate-bm.sh
diff --git a/xos/configurations/cord/dataplane/scripts/if_from_ip.py b/xos/configurations/cord-deprecated/dataplane/scripts/if_from_ip.py
similarity index 100%
rename from xos/configurations/cord/dataplane/scripts/if_from_ip.py
rename to xos/configurations/cord-deprecated/dataplane/scripts/if_from_ip.py
diff --git a/xos/configurations/cord/dataplane/scripts/restart-vcpes.sh b/xos/configurations/cord-deprecated/dataplane/scripts/restart-vcpes.sh
similarity index 100%
rename from xos/configurations/cord/dataplane/scripts/restart-vcpes.sh
rename to xos/configurations/cord-deprecated/dataplane/scripts/restart-vcpes.sh
diff --git a/xos/configurations/cord/docker-compose.yml b/xos/configurations/cord-deprecated/docker-compose.yml
similarity index 100%
rename from xos/configurations/cord/docker-compose.yml
rename to xos/configurations/cord-deprecated/docker-compose.yml
diff --git a/xos/configurations/cord/make-virtualbng-json.sh b/xos/configurations/cord-deprecated/make-virtualbng-json.sh
similarity index 100%
rename from xos/configurations/cord/make-virtualbng-json.sh
rename to xos/configurations/cord-deprecated/make-virtualbng-json.sh
diff --git a/xos/configurations/cord/make-vtn-networkconfig-json.sh b/xos/configurations/cord-deprecated/make-vtn-networkconfig-json.sh
similarity index 100%
rename from xos/configurations/cord/make-vtn-networkconfig-json.sh
rename to xos/configurations/cord-deprecated/make-vtn-networkconfig-json.sh
diff --git a/xos/configurations/cord/xos_cord_config b/xos/configurations/cord-deprecated/xos_cord_config
similarity index 100%
copy from xos/configurations/cord/xos_cord_config
copy to xos/configurations/cord-deprecated/xos_cord_config
diff --git a/xos/configurations/cord-pod/README-Tutorial.md b/xos/configurations/cord-pod/README-Tutorial.md
index 1e3def3..805812f 100644
--- a/xos/configurations/cord-pod/README-Tutorial.md
+++ b/xos/configurations/cord-pod/README-Tutorial.md
@@ -75,24 +75,7 @@
## Bring up XOS
-Under the `cord-pod` configuration, edit file `make-vtn-networkconfig-json.sh`.
-Change the definition of `"publicGateways"` so that it looks like this (adding
- a second gatewayIp and gatewayMac):
-
-```
-"publicGateways": [
- {
- "gatewayIp": "10.168.0.1",
- "gatewayMac": "02:42:0a:a8:00:01"
- },
- {
- "gatewayIp": "10.168.1.1",
- "gatewayMac": "02:42:0a:a8:00:01"
- }
-],
-```
-
-Now run the `make` commands described in the [README.md](./README.md) file:
+Run the `make` commands described in the [README.md](./README.md) file:
```
ubuntu@xos:~/xos/xos/configurations/cord-pod$ make
diff --git a/xos/configurations/cord-pod/README.md b/xos/configurations/cord-pod/README.md
index 3d7a60f..b47a915 100644
--- a/xos/configurations/cord-pod/README.md
+++ b/xos/configurations/cord-pod/README.md
@@ -28,9 +28,13 @@
### Install OpenStack
-Follow the instructions in the [README.md](https://github.com/open-cloud/openstack-cluster-setup/blob/master/README.md)
+To set up OpenStack, follow the instructions in the
+[README.md](https://github.com/open-cloud/openstack-cluster-setup/blob/master/README.md)
file of the [open-cloud/openstack-cluster-setup](https://github.com/open-cloud/openstack-cluster-setup/)
-repository.
+repository. If you're just getting started with CORD, it's probably best to begin with the
+single-node CORD test environment to familiarize yourself with the overall setup.
+
+**NOTE: In order to use the cord-pod configuration, you must set up OpenStack using the above recipe.**
### Set up ONOS VTN
@@ -99,9 +103,11 @@
3. Modify `cord-vtn-vsg.yml` and set these parameters to the
appropriate values for the fabric:
- * `public_addresses:properties:addresses` (IP address block of fabric)
- * `service_vsg:properties:wan_container_gateway_ip` (same as `publicGateway:gatewayIp` from VTN configuration)
- * `service_vsg:properties:wan_container_gateway_mac` (same as `publicGateway:gatewayMac` from VTN configuration)
+ * `addresses_vsg:properties:addresses` (IP address block of fabric)
+ * `addresses_vsg:properties:gateway_ip`
+ * `addresses_vsg:properties:gateway_mac`
+ * `service_vsg:properties:wan_container_gateway_ip` (same as `gateway_ip` above and same as `publicGateway:gatewayIp` from VTN configuration)
+ * `service_vsg:properties:wan_container_gateway_mac` (same as `gateway_mac` above and same as `publicGateway:gatewayMac` from VTN configuration)
* `service_vsg:properties:wan_container_netbits` (bits in fabric IP address block netmask)
diff --git a/xos/configurations/cord-pod/docker-compose.yml b/xos/configurations/cord-pod/docker-compose.yml
index cb7194f..234fd43 100644
--- a/xos/configurations/cord-pod/docker-compose.yml
+++ b/xos/configurations/cord-pod/docker-compose.yml
@@ -13,7 +13,7 @@
- xos_db
volumes:
- ../common/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
- - ../cord//xos_cord_config:/opt/xos/xos_configuration/xos_cord_config:ro
+ - xos_cord_config:/opt/xos/xos_configuration/xos_cord_config:ro
- .:/root/setup:ro
- ../vtn/files/xos_vtn_config:/opt/xos/xos_configuration/xos_vtn_config:ro
- ./images:/opt/xos/images:ro
@@ -96,7 +96,7 @@
volumes:
- .:/root/setup:ro
- ../common/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
- - ../cord/xos_cord_config:/opt/xos/xos_configuration/xos_cord_config:ro
+ - xos_cord_config:/opt/xos/xos_configuration/xos_cord_config:ro
- ../vtn/files/xos_vtn_config:/opt/xos/xos_configuration/xos_vtn_config:ro
- ./id_rsa.pub:/opt/xos/synchronizers/onos/onos_key.pub:ro
- ./id_rsa.pub:/opt/xos/synchronizers/vcpe/vcpe_public_key:ro
diff --git a/xos/configurations/cord/xos_cord_config b/xos/configurations/cord-pod/xos_cord_config
similarity index 100%
rename from xos/configurations/cord/xos_cord_config
rename to xos/configurations/cord-pod/xos_cord_config
diff --git a/xos/configurations/cord/ceilometer-plugins b/xos/configurations/cord/ceilometer-plugins
deleted file mode 160000
index 87cd53b..0000000
--- a/xos/configurations/cord/ceilometer-plugins
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 87cd53b99e43b12f2a175a65440f02f53b564069
diff --git a/xos/configurations/devel/README.md b/xos/configurations/devel/README.md
index df9f999..5dbad10 100644
--- a/xos/configurations/devel/README.md
+++ b/xos/configurations/devel/README.md
@@ -4,6 +4,9 @@
XOS in three Docker containers (development GUI, Synchronizer, database) and configures XOS
to talk to an OpenStack backend. *docker-compose* is used to manage the containers.
+**NOTE: If your goal is to create a development environment for [CORD](http://opencord.org/),
+this configuration is not what you want. Look at the [cord-pod](../cord-pod) configuration instead!**
+
## How to run it
The configuration can be either run on [CloudLab](http://cloudlab.us) (controlling
@@ -41,8 +44,6 @@
This setup has been run successfully in a VirtualBox VM with 2 CPUs and 4096 GB RAM.
However it is recommended to use a dedicated server with more resources.
-**NOTE: If your goal is to create a development environment for [CORD](http://opencord.org/),
-DevStack is not what you want. Look at the [cord-pod](../cord-pod) configuration instead!**
## What you get
diff --git a/xos/core/admin.py b/xos/core/admin.py
index ee6c6bf..f14710b 100644
--- a/xos/core/admin.py
+++ b/xos/core/admin.py
@@ -1,49 +1,49 @@
-from core.models import Site
-from core.models import *
-from openstack.manager import OpenStackManager
+import threading
+from cgi import escape as html_escape
-from django.contrib import admin
-from django.contrib.auth.models import Group
+from core.models import *
+from core.models import Site
from django import forms
-from django.utils.safestring import mark_safe
+from django.contrib import admin, messages
+from django.contrib.admin.widgets import (AdminTextareaWidget,
+ FilteredSelectMultiple)
from django.contrib.auth.admin import UserAdmin
-from django.contrib.admin.widgets import FilteredSelectMultiple, AdminTextareaWidget
-from django.contrib.auth.forms import ReadOnlyPasswordHashField, AdminPasswordChangeForm
+from django.contrib.auth.forms import (AdminPasswordChangeForm,
+ ReadOnlyPasswordHashField)
+from django.contrib.auth.models import Group
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 django.core.exceptions import PermissionDenied
-from django.core.urlresolvers import reverse, resolve, NoReverseMatch
+from django.core.exceptions import PermissionDenied, ValidationError
+from django.core.urlresolvers import NoReverseMatch, resolve, reverse
+from django.forms.utils import flatatt, to_current_timezone
+from django.utils import timezone
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.html import conditional_escape, format_html
+from django.utils.safestring import mark_safe
from django.utils.text import capfirst
-from django.forms.utils import flatatt, to_current_timezone
-from django.core.exceptions import PermissionDenied, ValidationError
-from cgi import escape as html_escape
-from django.contrib import messages
-
-import threading
+from openstack.manager import OpenStackManager
+from suit.widgets import LinkedSelect
# thread locals necessary to work around a django-suit issue
_thread_locals = threading.local()
ICON_URLS = {"success": "/static/admin/img/icon_success.gif",
- "clock": "/static/admin/img/icon_clock.gif",
- "error": "/static/admin/img/icon_error.gif"}
+ "clock": "/static/admin/img/icon_clock.gif",
+ "error": "/static/admin/img/icon_error.gif"}
+
def backend_icon(obj):
(icon, tooltip) = obj.get_backend_icon()
icon_url = ICON_URLS.get(icon, "unknown")
- (exponent,last_success,last_failure,failures) = obj.get_backend_details()
+ (exponent, last_success, last_failure, failures) = obj.get_backend_details()
# FIXME: Need to clean this up by separating Javascript from Python
if (obj.pk):
script = """
<script type="text/javascript">$(document).ready(function () {$("#show_details_%d").click(function () {$("#status%d").dialog({modal: true, height: 200, width: 200 });});});</script>
- """%(obj.pk,obj.pk)
+ """ % (obj.pk, obj.pk)
div = """
<div style="display:none;" id="status%d" title="Details">
@@ -52,8 +52,8 @@
<p>Failures: %r</p>
<p>Last Failure: %r</p>
</div>
- """%(obj.pk,exponent,last_success,failures,last_failure)
- a = '<a id="show_details_%d" href="#">'%obj.pk
+ """ % (obj.pk, exponent, last_success, failures, last_failure)
+ a = '<a id="show_details_%d" href="#">' % obj.pk
astop = '</a>'
else:
div = ''
@@ -66,24 +66,30 @@
else:
return '<span style="min-width:16px;"><img src="%s"></span>' % icon_url
+
def backend_text(obj):
(icon, tooltip) = obj.get_backend_icon()
icon_url = ICON_URLS.get(icon, "unknown")
return '<img src="%s"> %s' % (icon_url, tooltip)
+
class UploadTextareaWidget(AdminTextareaWidget):
+
def render(self, name, value, attrs=None):
if value is None:
value = ''
final_attrs = self.build_attrs(attrs, name=name)
- return format_html('<input type="file" style="width: 0; height: 0" id="btn_upload_%s" onChange="uploadTextarea(event,\'%s\');">' \
- '<button onClick="$(\'#btn_upload_%s\').click(); return false;">Upload</button>' \
- '<br><textarea{0}>\r\n{1}</textarea>' % (attrs["id"], attrs["id"], attrs["id"]),
+ return format_html('<input type="file" style="width: 0; height: 0" id="btn_upload_%s" onChange="uploadTextarea(event,\'%s\');">'
+ '<button onClick="$(\'#btn_upload_%s\').click(); return false;">Upload</button>'
+ '<br><textarea{0}>\r\n{1}</textarea>' % (
+ attrs["id"], attrs["id"], attrs["id"]),
flatatt(final_attrs),
force_text(value))
+
class SliderWidget(forms.HiddenInput):
+
def render(self, name, value, attrs=None):
if value is None:
value = '0'
@@ -102,7 +108,7 @@
</script>
<input type="hidden" id="%(id)s" name="%(name)s" value="%(value)s"></input>
""" % attrs
- html = html.replace("{","{{").replace("}","}}")
+ html = html.replace("{", "{{").replace("}", "}}")
return format_html(html,
flatatt(final_attrs),
force_text(value))
@@ -116,6 +122,7 @@
value = ''
return mark_safe(str(value) + super(PlainTextWidget, self).render(name, value, attrs))
+
class XOSAdminMixin(object):
# call save_by_user and delete_by_user instead of save and delete
@@ -166,8 +173,8 @@
formset.save_m2m()
- def get_actions(self,request):
- actions = super(XOSAdminMixin,self).get_actions(request)
+ def get_actions(self, request):
+ actions = super(XOSAdminMixin, self).get_actions(request)
if self.__user_is_readonly(request):
if 'delete_selected' in actions:
@@ -181,13 +188,16 @@
def add_extra_context(self, request, extra_context):
# allow custom application breadcrumb url and name
- extra_context["custom_app_breadcrumb_url"] = getattr(self, "custom_app_breadcrumb_url", None)
- extra_context["custom_app_breadcrumb_name"] = getattr(self, "custom_app_breadcrumb_name", None)
- extra_context["custom_changelist_breadcrumb_url"] = getattr(self, "custom_changelist_breadcrumb_url", None)
+ extra_context["custom_app_breadcrumb_url"] = getattr(
+ self, "custom_app_breadcrumb_url", None)
+ extra_context["custom_app_breadcrumb_name"] = getattr(
+ self, "custom_app_breadcrumb_name", None)
+ extra_context["custom_changelist_breadcrumb_url"] = getattr(
+ self, "custom_changelist_breadcrumb_url", None)
# for Service admins to render their Administration page
if getattr(self, "extracontext_registered_admins", False):
- admins=[]
+ admins = []
for model, model_admin in admin.site._registry.items():
if model == self.model:
continue
@@ -195,11 +205,11 @@
info = {"app": model._meta.app_label,
"model": model._meta.model_name,
"name": capfirst(model._meta.verbose_name_plural),
- "url": self.url_for_model_changelist(request,model) }
+ "url": self.url_for_model_changelist(request, model)}
admins.append(info)
extra_context["registered_admins"] = admins
- def change_view(self,request,object_id, extra_context=None):
+ def change_view(self, request, object_id, extra_context=None):
extra_context = extra_context or {}
if self.__user_is_readonly(request):
@@ -208,7 +218,7 @@
self.readonly_save = self.readonly_fields
self.inlines_save = self.inlines
if hasattr(self, "user_readonly_fields"):
- self.readonly_fields=self.user_readonly_fields
+ self.readonly_fields = self.user_readonly_fields
if hasattr(self, "user_readonly_inlines"):
self.inlines = self.user_readonly_inlines
else:
@@ -244,14 +254,14 @@
request.readonly = True
return super(XOSAdminMixin, self).change_view(request, object_id, extra_context=extra_context)
- def changelist_view(self, request, extra_context = None):
+ def changelist_view(self, request, extra_context=None):
extra_context = extra_context or {}
self.add_extra_context(request, extra_context)
return super(XOSAdminMixin, self).changelist_view(request, extra_context=extra_context)
- def add_view(self, request, form_url='', extra_context = None):
+ def add_view(self, request, form_url='', extra_context=None):
extra_context = extra_context or {}
self.add_extra_context(request, extra_context)
@@ -286,16 +296,20 @@
return inlines
+
class ReadOnlyAwareAdmin(XOSAdminMixin, admin.ModelAdmin):
# Note: Make sure XOSAdminMixin is listed before
# admin.ModelAdmin in the class declaration.
pass
+
class XOSBaseAdmin(ReadOnlyAwareAdmin):
save_on_top = False
+
class SingletonAdmin (ReadOnlyAwareAdmin):
+
def has_add_permission(self, request):
if not super(SingletonAdmin, self).has_add_permission(request):
return False
@@ -306,10 +320,13 @@
else:
return True
+
class ServiceAppAdmin (SingletonAdmin):
extracontext_registered_admins = True
+
class XOSTabularInline(admin.TabularInline):
+
def __init__(self, *args, **kwargs):
super(XOSTabularInline, self).__init__(*args, **kwargs)
@@ -328,7 +345,7 @@
object instead of trying to bring up a change view of the
SliceNetwork object.
"""
- return getattr(self.model,self.selflink_fieldname).field.rel.to
+ return getattr(self.model, self.selflink_fieldname).field.rel.to
else:
return self.model
@@ -338,7 +355,7 @@
def get_change_url(self, id):
""" Get the URL to a change form in the admin for this model """
- reverse_path = self.selflink_reverse_path # "admin:%s_change" % (self.selflink_model._meta.db_table)
+ reverse_path = self.selflink_reverse_path # "admin:%s_change" % (self.selflink_model._meta.db_table)
try:
url = reverse(reverse_path, args=(id,))
except NoReverseMatch:
@@ -397,7 +414,9 @@
return mark_safe(backend_icon(obj))
backend_status_icon.short_description = ""
+
class PlStackGenericTabularInline(generic.GenericTabularInline):
+
def has_add_permission(self, request):
return not request.user.isReadOnlyUser()
@@ -413,6 +432,7 @@
return mark_safe(backend_icon(obj))
backend_status_icon.short_description = ""
+
class ReservationInline(XOSTabularInline):
model = Reservation
extra = 0
@@ -421,6 +441,7 @@
def queryset(self, request):
return Reservation.select_by_user(request.user)
+
class TagInline(PlStackGenericTabularInline):
model = Tag
extra = 0
@@ -430,12 +451,15 @@
def queryset(self, request):
return Tag.select_by_user(request.user)
+
class InstanceInline(XOSTabularInline):
model = Instance
- fields = ['backend_status_icon', 'all_ips_string', 'instance_id', 'instance_name', 'slice', 'deployment', 'flavor', 'image', 'node']
+ fields = ['backend_status_icon', 'all_ips_string', 'instance_id',
+ 'instance_name', 'slice', 'deployment', 'flavor', 'image', 'node']
extra = 0
max_num = 0
- readonly_fields = ['backend_status_icon', 'all_ips_string', 'instance_id', 'instance_name', 'slice', 'deployment', 'flavor', 'image', 'node']
+ readonly_fields = ['backend_status_icon', 'all_ips_string', 'instance_id',
+ 'instance_name', 'slice', 'deployment', 'flavor', 'image', 'node']
suit_classes = 'suit-tab suit-tab-instances'
def queryset(self, request):
@@ -443,20 +467,27 @@
def formfield_for_foreignkey(self, db_field, request=None, **kwargs):
if db_field.name == 'deployment':
- kwargs['queryset'] = Deployment.select_by_acl(request.user).filter(sitedeployments__nodes__isnull=False).distinct()
- kwargs['widget'] = forms.Select(attrs={'onChange': "instance_deployment_changed(this);"})
+ kwargs['queryset'] = Deployment.select_by_acl(request.user).filter(
+ sitedeployments__nodes__isnull=False).distinct()
+ kwargs['widget'] = forms.Select(
+ attrs={'onChange': "instance_deployment_changed(this);"})
if db_field.name == 'flavor':
- kwargs['widget'] = forms.Select(attrs={'onChange': "instance_flavor_changed(this);"})
+ kwargs['widget'] = forms.Select(
+ attrs={'onChange': "instance_flavor_changed(this);"})
- field = super(InstanceInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
+ field = super(InstanceInline, self).formfield_for_foreignkey(
+ db_field, request, **kwargs)
return field
+
class CordInstanceInline(XOSTabularInline):
model = Instance
- fields = ['backend_status_icon', 'all_ips_string', 'instance_id', 'instance_name', 'slice', 'flavor', 'image', 'node']
+ fields = ['backend_status_icon', 'all_ips_string', 'instance_id',
+ 'instance_name', 'slice', 'flavor', 'image', 'node']
extra = 0
- readonly_fields = ['backend_status_icon', 'all_ips_string', 'instance_id', 'instance_name']
+ readonly_fields = ['backend_status_icon',
+ 'all_ips_string', 'instance_id', 'instance_name']
suit_classes = 'suit-tab suit-tab-instances'
def queryset(self, request):
@@ -465,15 +496,20 @@
def formfield_for_foreignkey(self, db_field, request=None, **kwargs):
if db_field.name == 'deployment':
- kwargs['queryset'] = Deployment.select_by_acl(request.user).filter(sitedeployments__nodes__isnull=False).distinct()
- kwargs['widget'] = forms.Select(attrs={'onChange': "instance_deployment_changed(this);"})
+ kwargs['queryset'] = Deployment.select_by_acl(request.user).filter(
+ sitedeployments__nodes__isnull=False).distinct()
+ kwargs['widget'] = forms.Select(
+ attrs={'onChange': "instance_deployment_changed(this);"})
if db_field.name == 'flavor':
- kwargs['widget'] = forms.Select(attrs={'onChange': "instance_flavor_changed(this);"})
+ kwargs['widget'] = forms.Select(
+ attrs={'onChange': "instance_flavor_changed(this);"})
- field = super(CordInstanceInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
+ field = super(CordInstanceInline, self).formfield_for_foreignkey(
+ db_field, request, **kwargs)
return field
+
class SiteInline(XOSTabularInline):
model = Site
extra = 0
@@ -482,13 +518,18 @@
def queryset(self, request):
return Site.select_by_user(request.user)
+
class SiteHostsNodesInline(SiteInline):
+
def queryset(self, request):
return Site.select_by_user(request.user).filter(hosts_nodes=True)
+
class SiteHostsUsersInline(SiteInline):
+
def queryset(self, request):
- return Site.select_by_user(request.user).filter(hosts_users=True)
+ return Site.select_by_user(request.user).filter(hosts_users=True)
+
class UserInline(XOSTabularInline):
model = User
@@ -500,6 +541,7 @@
def queryset(self, request):
return User.select_by_user(request.user)
+
class SliceInline(XOSTabularInline):
model = Slice
fields = ['backend_status_icon', 'name', 'site', 'serviceClass', 'service']
@@ -510,6 +552,7 @@
def queryset(self, request):
return Slice.select_by_user(request.user)
+
class NodeInline(XOSTabularInline):
model = Node
extra = 0
@@ -517,16 +560,18 @@
fields = ['backend_status_icon', 'name', 'site_deployment']
readonly_fields = ('backend_status_icon', )
+
class DeploymentPrivilegeInline(XOSTabularInline):
model = DeploymentPrivilege
extra = 0
suit_classes = 'suit-tab suit-tab-deploymentprivileges'
- fields = ['backend_status_icon', 'user','role','deployment']
+ fields = ['backend_status_icon', 'user', 'role', 'deployment']
readonly_fields = ('backend_status_icon', )
def queryset(self, request):
return DeploymentPrivilege.select_by_user(request.user)
+
class ControllerSiteInline(XOSTabularInline):
model = ControllerSite
extra = 0
@@ -538,7 +583,7 @@
model = SitePrivilege
extra = 0
suit_classes = 'suit-tab suit-tab-siteprivileges'
- fields = ['backend_status_icon', 'user','site', 'role']
+ fields = ['backend_status_icon', 'user', 'site', 'role']
readonly_fields = ('backend_status_icon', )
def formfield_for_foreignkey(self, db_field, request, **kwargs):
@@ -557,7 +602,7 @@
model = ServicePrivilege
extra = 0
suit_classes = 'suit-tab suit-tab-serviceprivileges'
- fields = ['backend_status_icon', 'user','service', 'role']
+ fields = ['backend_status_icon', 'user', 'service', 'role']
readonly_fields = ('backend_status_icon', )
def formfield_for_foreignkey(self, db_field, request, **kwargs):
@@ -565,16 +610,17 @@
kwargs['queryset'] = Service.select_by_user(request.user)
if db_field.name == 'user':
kwargs['queryset'] = User.select_by_user(request.user)
- return super(ServicePrivilegeInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
+ return super(ServicePrivilegeInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
def queryset(self, request):
return ServicePrivilege.select_by_user(request.user)
+
class SiteDeploymentInline(XOSTabularInline):
model = SiteDeployment
extra = 0
suit_classes = 'suit-tab suit-tab-sitedeployments'
- fields = ['backend_status_icon', 'deployment','site', 'controller']
+ fields = ['backend_status_icon', 'deployment', 'site', 'controller']
readonly_fields = ('backend_status_icon', )
def formfield_for_foreignkey(self, db_field, request, **kwargs):
@@ -586,7 +632,8 @@
if db_field.name == 'controller':
if len(resolve(request.path).args) > 0:
- kwargs['queryset'] = Controller.select_by_user(request.user).filter(deployment__id=int(resolve(request.path).args[0]))
+ kwargs['queryset'] = Controller.select_by_user(request.user).filter(
+ deployment__id=int(resolve(request.path).args[0]))
return super(SiteDeploymentInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
@@ -603,16 +650,17 @@
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if db_field.name == 'slice':
- kwargs['queryset'] = Slice.select_by_user(request.user)
+ kwargs['queryset'] = Slice.select_by_user(request.user)
if db_field.name == 'user':
- # all users are available to be granted SlicePrivilege
- kwargs['queryset'] = User.objects.all()
+ # all users are available to be granted SlicePrivilege
+ kwargs['queryset'] = User.objects.all()
return super(SlicePrivilegeInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
def queryset(self, request):
return SlicePrivilege.select_by_user(request.user)
+
class SliceNetworkInline(XOSTabularInline):
model = Network.slices.through
selflink_fieldname = "network"
@@ -623,6 +671,7 @@
fields = ['backend_status_icon', 'network']
readonly_fields = ('backend_status_icon', )
+
class ImageDeploymentsInline(XOSTabularInline):
model = ImageDeployments
extra = 0
@@ -632,6 +681,7 @@
fields = ['backend_status_icon', 'image', 'deployment']
readonly_fields = ['backend_status_icon']
+
class ControllerImagesInline(XOSTabularInline):
model = ControllerImages
extra = 0
@@ -641,14 +691,17 @@
fields = ['backend_status_icon', 'image', 'controller', 'glance_image_id']
readonly_fields = ['backend_status_icon', 'glance_image_id']
+
class SliceRoleAdmin(XOSBaseAdmin):
model = SliceRole
pass
+
class SiteRoleAdmin(XOSBaseAdmin):
model = SiteRole
pass
+
class DeploymentAdminForm(forms.ModelForm):
images = forms.ModelMultipleChoiceField(
queryset=Image.objects.all(),
@@ -666,19 +719,22 @@
verbose_name=('Flavors'), is_stacked=False
)
)
+
class Meta:
model = Deployment
- many_to_many = ["flavors",]
+ many_to_many = ["flavors", ]
def __init__(self, *args, **kwargs):
- request = kwargs.pop('request', None)
- super(DeploymentAdminForm, self).__init__(*args, **kwargs)
+ request = kwargs.pop('request', None)
+ super(DeploymentAdminForm, self).__init__(*args, **kwargs)
- self.fields['accessControl'].initial = "allow site " + request.user.site.name
+ self.fields['accessControl'].initial = "allow site " + \
+ request.user.site.name
- if self.instance and self.instance.pk:
- self.fields['images'].initial = [x.image for x in self.instance.imagedeployments.all()]
- self.fields['flavors'].initial = self.instance.flavors.all()
+ if self.instance and self.instance.pk:
+ self.fields['images'].initial = [
+ x.image for x in self.instance.imagedeployments.all()]
+ self.fields['flavors'].initial = self.instance.flavors.all()
def manipulate_m2m_objs(self, this_obj, selected_objs, all_relations, relation_class, local_attrname, foreign_attrname):
""" helper function for handling m2m relations from the MultipleChoiceField
@@ -703,61 +759,70 @@
existing_dest_objs = []
for relation in list(all_relations):
if getattr(relation, foreign_attrname) not in selected_objs:
- #print "deleting site", sdp.site
+ # print "deleting site", sdp.site
relation.delete()
else:
existing_dest_objs.append(getattr(relation, foreign_attrname))
for dest_obj in selected_objs:
if dest_obj not in existing_dest_objs:
- #print "adding site", site
+ # print "adding site", site
kwargs = {foreign_attrname: dest_obj, local_attrname: this_obj}
relation = relation_class(**kwargs)
relation.save()
def save(self, commit=True):
- deployment = super(DeploymentAdminForm, self).save(commit=False)
+ deployment = super(DeploymentAdminForm, self).save(commit=False)
- if commit:
- deployment.save()
- # this has to be done after save() if/when a deployment is first created
- deployment.flavors = self.cleaned_data['flavors']
+ if commit:
+ deployment.save()
+ # this has to be done after save() if/when a deployment is first
+ # created
+ deployment.flavors = self.cleaned_data['flavors']
- if deployment.pk:
- # save_m2m() doesn't seem to work with 'through' relations. So we
- # create/destroy the through models ourselves. There has to be
- # a better way...
+ if deployment.pk:
+ # save_m2m() doesn't seem to work with 'through' relations. So we
+ # create/destroy the through models ourselves. There has to be
+ # a better way...
- self.manipulate_m2m_objs(deployment, self.cleaned_data['images'], deployment.imagedeployments.all(), ImageDeployments, "deployment", "image")
- # manipulate_m2m_objs doesn't work for Flavor/Deployment relationship
- # so well handle that manually here
- for flavor in deployment.flavors.all():
- if getattr(flavor, 'name') not in self.cleaned_data['flavors']:
- deployment.flavors.remove(flavor)
- for flavor in self.cleaned_data['flavors']:
- if flavor not in deployment.flavors.all():
- flavor.deployments.add(deployment)
+ self.manipulate_m2m_objs(deployment, self.cleaned_data[
+ 'images'], deployment.imagedeployments.all(), ImageDeployments, "deployment", "image")
+ # manipulate_m2m_objs doesn't work for Flavor/Deployment relationship
+ # so well handle that manually here
+ for flavor in deployment.flavors.all():
+ if getattr(flavor, 'name') not in self.cleaned_data['flavors']:
+ deployment.flavors.remove(flavor)
+ for flavor in self.cleaned_data['flavors']:
+ if flavor not in deployment.flavors.all():
+ flavor.deployments.add(deployment)
- self.save_m2m()
+ self.save_m2m()
- return deployment
+ return deployment
+
class DeploymentAdminROForm(DeploymentAdminForm):
+
def save(self, commit=True):
raise PermissionDenied
+
class SiteAssocInline(XOSTabularInline):
model = Site.deployments.through
extra = 0
suit_classes = 'suit-tab suit-tab-sites'
+
class DeploymentAdmin(XOSBaseAdmin):
model = Deployment
- fieldList = ['backend_status_text', 'name', 'images', 'flavors', 'accessControl']
- fieldsets = [(None, {'fields': fieldList, 'classes':['suit-tab suit-tab-general']})]
+ fieldList = ['backend_status_text', 'name',
+ 'images', 'flavors', 'accessControl']
+ fieldsets = [
+ (None, {'fields': fieldList, 'classes': ['suit-tab suit-tab-general']})]
# node no longer directly connected to deployment
#inlines = [DeploymentPrivilegeInline,NodeInline,TagInline,ImageDeploymentsInline]
- inlines = [DeploymentPrivilegeInline,TagInline,ImageDeploymentsInline,SiteDeploymentInline]
+ inlines = [DeploymentPrivilegeInline, TagInline,
+ ImageDeploymentsInline, SiteDeploymentInline]
list_display = ['backend_status_icon', 'name']
list_display_links = ('backend_status_icon', 'name', )
readonly_fields = ('backend_status_text', )
@@ -765,48 +830,58 @@
user_readonly_fields = ['name']
# nodes no longer direclty connected to deployments
- suit_form_tabs =(('general','Deployment Details'),('deploymentprivileges','Privileges'), ('sitedeployments', 'Sites'))
+ suit_form_tabs = (('general', 'Deployment Details'),
+ ('deploymentprivileges', 'Privileges'), ('sitedeployments', 'Sites'))
def get_form(self, request, obj=None, **kwargs):
if request.user.isReadOnlyUser() or not request.user.is_admin:
kwargs["form"] = DeploymentAdminROForm
else:
kwargs["form"] = DeploymentAdminForm
- adminForm = super(DeploymentAdmin,self).get_form(request, obj, **kwargs)
+ adminForm = super(DeploymentAdmin, self).get_form(
+ request, obj, **kwargs)
# from stackexchange: pass the request object into the form
class AdminFormMetaClass(adminForm):
- def __new__(cls, *args, **kwargs):
- kwargs['request'] = request
- return adminForm(*args, **kwargs)
+
+ def __new__(cls, *args, **kwargs):
+ kwargs['request'] = request
+ return adminForm(*args, **kwargs)
return AdminFormMetaClass
+
class ControllerAdminForm(forms.ModelForm):
backend_disabled = forms.BooleanField(required=False)
+
class Meta:
model = Controller
def __init__(self, *args, **kwargs):
- request = kwargs.pop('request', None)
- super(ControllerAdminForm, self).__init__(*args, **kwargs)
+ request = kwargs.pop('request', None)
+ super(ControllerAdminForm, self).__init__(*args, **kwargs)
- if self.instance and self.instance.pk:
- self.fields['backend_disabled'].initial = self.instance.get_backend_register('disabled', False)
- else:
- # defaults when adding new controller
- self.fields['backend_disabled'].initial = False
+ if self.instance and self.instance.pk:
+ self.fields['backend_disabled'].initial = self.instance.get_backend_register(
+ 'disabled', False)
+ else:
+ # defaults when adding new controller
+ self.fields['backend_disabled'].initial = False
def save(self, commit=True):
- self.instance.set_backend_register("disabled", self.cleaned_data["backend_disabled"])
- return super(ControllerAdminForm, self).save(commit=commit)
+ self.instance.set_backend_register(
+ "disabled", self.cleaned_data["backend_disabled"])
+ return super(ControllerAdminForm, self).save(commit=commit)
+
class ControllerAdmin(XOSBaseAdmin):
model = Controller
- fieldList = ['deployment', 'name', 'backend_type', 'backend_disabled', 'version', 'auth_url', 'admin_user', 'admin_tenant','admin_password', 'domain', 'rabbit_host', 'rabbit_user', 'rabbit_password']
- fieldsets = [(None, {'fields': fieldList, 'classes':['suit-tab suit-tab-general']})]
- inlines = [ControllerSiteInline] # ,ControllerImagesInline]
+ fieldList = ['deployment', 'name', 'backend_type', 'backend_disabled', 'version', 'auth_url', 'admin_user',
+ 'admin_tenant', 'admin_password', 'domain', 'rabbit_host', 'rabbit_user', 'rabbit_password']
+ fieldsets = [
+ (None, {'fields': fieldList, 'classes': ['suit-tab suit-tab-general']})]
+ inlines = [ControllerSiteInline] # ,ControllerImagesInline]
list_display = ['backend_status_icon', 'name', 'version', 'backend_type']
list_display_links = ('backend_status_icon', 'name', )
readonly_fields = ('backend_status_text',)
@@ -815,47 +890,52 @@
user_readonly_fields = []
def save_model(self, request, obj, form, change):
- # update openstack connection to use this site/tenant
+ # update openstack connection to use this site/tenant
obj.save_by_user(request.user)
-
+
def delete_model(self, request, obj):
obj.delete_by_user(request.user)
def queryset(self, request):
- return Controller.select_by_user(request.user)
+ return Controller.select_by_user(request.user)
@property
def suit_form_tabs(self):
tabs = [('general', 'Controller Details'),
- ]
+ ]
- request=getattr(_thread_locals, "request", None)
+ request = getattr(_thread_locals, "request", None)
if request and request.user.is_admin:
- tabs.append( ('admin-only', 'Admin-Only') )
+ tabs.append(('admin-only', 'Admin-Only'))
return tabs
+
class TenantAttributeAdmin(XOSBaseAdmin):
model = TenantAttribute
list_display = ('backend_status_icon', 'tenant', 'name', 'value')
list_display_links = ('backend_status_icon', 'name')
fieldList = ('backend_status_text', 'tenant', 'name', 'value', )
- fieldsets = [(None, {'fields': fieldList, 'classes':['suit-tab suit-tab-general']})]
+ fieldsets = [
+ (None, {'fields': fieldList, 'classes': ['suit-tab suit-tab-general']})]
readonly_fields = ('backend_status_text', )
- suit_form_tabs =(('general', 'Tenant Root Details'),
- )
+ suit_form_tabs = (('general', 'Tenant Root Details'),
+ )
+
class TenantAttrAsTabInline(XOSTabularInline):
model = TenantAttribute
- fields = ['name','value']
+ fields = ['name', 'value']
extra = 0
suit_classes = 'suit-tab suit-tab-tenantattrs'
+
class TenantRootRoleAdmin(XOSBaseAdmin):
model = TenantRootRole
fields = ('role',)
+
class TenantRootTenantInline(XOSTabularInline):
model = Tenant
fields = ['provider_service', 'subscriber_root']
@@ -865,10 +945,11 @@
verbose_name = 'subscribed tenant'
verbose_name_plural = 'subscribed tenants'
- #def queryset(self, request):
+ # def queryset(self, request):
# qs = super(TenantRootTenantInline, self).queryset(request)
# return qs.filter(kind="coarse")
+
class TenantRootPrivilegeInline(XOSTabularInline):
model = TenantRootPrivilege
extra = 0
@@ -879,19 +960,22 @@
def queryset(self, request):
return TenantRootPrivilege.select_by_user(request.user)
+
class TenantRootAdmin(XOSBaseAdmin):
model = TenantRoot
list_display = ('backend_status_icon', 'name', 'kind')
list_display_links = ('backend_status_icon', 'name')
fieldList = ('backend_status_text', 'name', 'kind', )
- fieldsets = [(None, {'fields': fieldList, 'classes':['suit-tab suit-tab-general']})]
+ fieldsets = [
+ (None, {'fields': fieldList, 'classes': ['suit-tab suit-tab-general']})]
inlines = (TenantRootTenantInline, TenantRootPrivilegeInline)
readonly_fields = ('backend_status_text', )
- suit_form_tabs =(('general', 'Tenant Root Details'),
- ('tenantroots','Tenancy'),
- ('tenantrootprivileges','Privileges')
- )
+ suit_form_tabs = (('general', 'Tenant Root Details'),
+ ('tenantroots', 'Tenancy'),
+ ('tenantrootprivileges', 'Privileges')
+ )
+
class ProviderTenantInline(XOSTabularInline):
model = CoarseTenant
@@ -906,6 +990,7 @@
qs = super(ProviderTenantInline, self).queryset(request)
return qs.filter(kind="coarse")
+
class SubscriberTenantInline(XOSTabularInline):
model = CoarseTenant
fields = ['provider_service', 'subscriber_service', 'connect_method']
@@ -919,28 +1004,35 @@
qs = super(SubscriberTenantInline, self).queryset(request)
return qs.filter(kind="coarse")
+
class ServiceAttrAsTabInline(XOSTabularInline):
model = ServiceAttribute
- fields = ['name','value']
+ fields = ['name', 'value']
extra = 0
suit_classes = 'suit-tab suit-tab-serviceattrs'
+
class ServiceAdmin(XOSBaseAdmin):
- list_display = ("backend_status_icon","name","kind","versionNumber","enabled","published")
+ list_display = ("backend_status_icon", "name", "kind",
+ "versionNumber", "enabled", "published")
list_display_links = ('backend_status_icon', 'name', )
- fieldList = ["backend_status_text","name","kind","description","versionNumber","enabled","published","view_url","icon_url","public_key","private_key_fn","service_specific_attribute","service_specific_id"]
- fieldsets = [(None, {'fields': fieldList, 'classes':['suit-tab suit-tab-general']})]
- inlines = [ServiceAttrAsTabInline,SliceInline,ProviderTenantInline,SubscriberTenantInline,ServicePrivilegeInline]
+ fieldList = ["backend_status_text", "name", "kind", "description", "versionNumber", "enabled", "published",
+ "view_url", "icon_url", "public_key", "private_key_fn", "service_specific_attribute", "service_specific_id"]
+ fieldsets = [
+ (None, {'fields': fieldList, 'classes': ['suit-tab suit-tab-general']})]
+ inlines = [ServiceAttrAsTabInline, SliceInline, ProviderTenantInline,
+ SubscriberTenantInline, ServicePrivilegeInline]
readonly_fields = ('backend_status_text', )
user_readonly_fields = fieldList
- suit_form_tabs =(('general', 'Service Details'),
- ('slices','Slices'),
- ('serviceattrs','Additional Attributes'),
- ('servicetenants','Tenancy'),
- ('serviceprivileges','Privileges')
- )
+ suit_form_tabs = (('general', 'Service Details'),
+ ('slices', 'Slices'),
+ ('serviceattrs', 'Additional Attributes'),
+ ('servicetenants', 'Tenancy'),
+ ('serviceprivileges', 'Privileges')
+ )
+
class SiteNodeInline(XOSTabularInline):
model = Node
@@ -950,43 +1042,50 @@
def formfield_for_foreignkey(self, db_field, request, **kwargs):
# only display site deployments associated with this site
- if db_field.name == 'site_deployment':
- kwargs['queryset'] = SiteDeployment.objects.filter(site__id=int(request.path.split('/')[-2]))
+ if db_field.name == 'site_deployment':
+ kwargs['queryset'] = SiteDeployment.objects.filter(
+ site__id=int(request.path.split('/')[-2]))
return super(SiteNodeInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
+
class SiteAdmin(XOSBaseAdmin):
#fieldList = ['backend_status_text', 'name', 'site_url', 'enabled', 'is_public', 'login_base', 'accountLink','location']
- fieldList = ['backend_status_text', 'name', 'site_url', 'enabled', 'login_base', 'location', 'is_public', 'hosts_nodes', 'hosts_users']
+ fieldList = ['backend_status_text', 'name', 'site_url', 'enabled',
+ 'login_base', 'location', 'is_public', 'hosts_nodes', 'hosts_users']
fieldsets = [
- (None, {'fields': fieldList, 'classes':['suit-tab suit-tab-general']}),
+ (None, {'fields': fieldList, 'classes': [
+ 'suit-tab suit-tab-general']}),
#('Deployment Networks', {'fields': ['deployments'], 'classes':['suit-tab suit-tab-deployments']}),
]
#readonly_fields = ['backend_status_text', 'accountLink']
readonly_fields = ['backend_status_text']
#user_readonly_fields = ['name', 'deployments','site_url', 'enabled', 'is_public', 'login_base', 'accountLink']
- user_readonly_fields = ['name', 'deployments','site_url', 'enabled', 'is_public', 'login_base', 'hosts_nodes', 'hosts_users']
+ user_readonly_fields = ['name', 'deployments', 'site_url',
+ 'enabled', 'is_public', 'login_base', 'hosts_nodes', 'hosts_users']
- list_display = ('backend_status_icon', 'name', 'login_base','site_url', 'enabled')
+ list_display = ('backend_status_icon', 'name',
+ 'login_base', 'site_url', 'enabled')
list_display_links = ('backend_status_icon', 'name', )
filter_horizontal = ('deployments',)
- inlines = [SliceInline,UserInline,TagInline, SitePrivilegeInline, SiteNodeInline]
+ inlines = [SliceInline, UserInline, TagInline,
+ SitePrivilegeInline, SiteNodeInline]
admin_inlines = [ControllerSiteInline]
search_fields = ['name']
@property
def suit_form_tabs(self):
tabs = [('general', 'Site Details'),
- ('users','Users'),
- ('siteprivileges','Privileges'),
- ('slices','Slices'),
- ('nodes','Nodes'),
- ]
+ ('users', 'Users'),
+ ('siteprivileges', 'Privileges'),
+ ('slices', 'Slices'),
+ ('nodes', 'Nodes'),
+ ]
- request=getattr(_thread_locals, "request", None)
+ request = getattr(_thread_locals, "request", None)
if request and request.user.is_admin:
- tabs.append( ('admin-only', 'Admin-Only') )
+ tabs.append(('admin-only', 'Admin-Only'))
return tabs
@@ -1006,7 +1105,7 @@
link_obj = obj.accounts.all()
if link_obj:
reverse_path = "admin:core_account_change"
- url = reverse(reverse_path, args =(link_obj[0].id,))
+ url = reverse(reverse_path, args=(link_obj[0].id,))
return "<a href='%s'>%s</a>" % (url, "view billing details")
else:
return "no billing data for this site"
@@ -1015,16 +1114,16 @@
def save_model(self, request, obj, form, change):
# update openstack connection to use this site/tenant
- obj.save_by_user(request.user)
+ obj.save_by_user(request.user)
def delete_model(self, request, obj):
obj.delete_by_user(request.user)
-
+
class SitePrivilegeAdmin(XOSBaseAdmin):
fieldList = ['backend_status_text', 'user', 'site', 'role']
fieldsets = [
- (None, {'fields': fieldList, 'classes':['collapse']})
+ (None, {'fields': fieldList, 'classes': ['collapse']})
]
readonly_fields = ('backend_status_text', )
list_display = ('backend_status_icon', 'user', 'site', 'role')
@@ -1046,10 +1145,12 @@
if not request.user.is_admin:
# only show users from sites where caller has admin or pi role
roles = Role.objects.filter(role_type__in=['admin', 'pi'])
- site_privileges = SitePrivilege.objects.filter(user=request.user).filter(role__in=roles)
+ site_privileges = SitePrivilege.objects.filter(
+ user=request.user).filter(role__in=roles)
sites = [site_privilege.site for site_privilege in site_privileges]
site_privileges = SitePrivilege.objects.filter(site__in=sites)
- emails = [site_privilege.user.email for site_privilege in site_privileges]
+ emails = [
+ site_privilege.user.email for site_privilege in site_privileges]
users = User.objects.filter(email__in=emails)
kwargs['queryset'] = users
@@ -1059,7 +1160,7 @@
# admins can see all privileges. Users can only see privileges at sites
# where they have the admin role or pi role.
qs = super(SitePrivilegeAdmin, self).queryset(request)
- #if not request.user.is_admin:
+ # if not request.user.is_admin:
# roles = Role.objects.filter(role_type__in=['admin', 'pi'])
# site_privileges = SitePrivilege.objects.filter(user=request.user).filter(role__in=roles)
# login_bases = [site_privilege.site.login_base for site_privilege in site_privileges]
@@ -1067,7 +1168,9 @@
# qs = qs.filter(site__in=sites)
return qs
+
class SliceForm(forms.ModelForm):
+
class Meta:
model = Slice
widgets = {
@@ -1081,13 +1184,15 @@
slice_id = self.instance.id
if not site and slice_id:
site = Slice.objects.get(id=slice_id).site
- if (not isinstance(site,Site)):
+ if (not isinstance(site, Site)):
# previous code indicates 'site' could be a site_id and not a site?
site = Slice.objects.get(id=site.id)
if not name.startswith(site.login_base):
- raise forms.ValidationError('slice name must begin with %s' % site.login_base)
+ raise forms.ValidationError(
+ 'slice name must begin with %s' % site.login_base)
return cleaned_data
+
class ControllerSliceInline(XOSTabularInline):
model = ControllerSlice
extra = 0
@@ -1095,16 +1200,21 @@
verbose_name_plural = "Controller Slices"
suit_classes = 'suit-tab suit-tab-admin-only'
fields = ['backend_status_icon', 'controller', 'tenant_id']
- readonly_fields = ('backend_status_icon', 'controller' )
+ readonly_fields = ('backend_status_icon', 'controller')
+
class SliceAdmin(XOSBaseAdmin):
form = SliceForm
- fieldList = ['backend_status_text', 'site', 'name', 'serviceClass', 'enabled','description', 'service', 'slice_url', 'max_instances', "default_isolation", "network"]
- fieldsets = [('Slice Details', {'fields': fieldList, 'classes':['suit-tab suit-tab-general']}),]
+ fieldList = ['backend_status_text', 'site', 'name', 'serviceClass', 'enabled',
+ 'description', 'service', 'slice_url', 'max_instances', "default_isolation", "network"]
+ fieldsets = [('Slice Details', {'fields': fieldList, 'classes': [
+ 'suit-tab suit-tab-general']}), ]
readonly_fields = ('backend_status_text', )
- list_display = ('backend_status_icon', 'name', 'site','serviceClass', 'slice_url', 'max_instances')
+ list_display = ('backend_status_icon', 'name', 'site',
+ 'serviceClass', 'slice_url', 'max_instances')
list_display_links = ('backend_status_icon', 'name', )
- normal_inlines = [SlicePrivilegeInline, InstanceInline, TagInline, ReservationInline, SliceNetworkInline]
+ normal_inlines = [SlicePrivilegeInline, InstanceInline,
+ TagInline, ReservationInline, SliceNetworkInline]
inlines = normal_inlines
admin_inlines = [ControllerSliceInline]
suit_form_includes = (('slice_instance_tab.html', 'bottom', 'instances'),)
@@ -1113,20 +1223,20 @@
@property
def suit_form_tabs(self):
- tabs =[('general', 'Slice Details'),
- ('slicenetworks','Networks'),
- ('sliceprivileges','Privileges'),
- ('instances','Instances'),
- #('reservations','Reservations'),
- ('tags','Tags'),
- ]
+ tabs = [('general', 'Slice Details'),
+ ('slicenetworks', 'Networks'),
+ ('sliceprivileges', 'Privileges'),
+ ('instances', 'Instances'),
+ #('reservations','Reservations'),
+ ('tags', 'Tags'),
+ ]
- request=getattr(_thread_locals, "request", None)
+ request = getattr(_thread_locals, "request", None)
if request and request.user.is_admin:
- tabs.append( ('admin-only', 'Admin-Only') )
+ tabs.append(('admin-only', 'Admin-Only'))
return tabs
-
+
def add_view(self, request, form_url='', extra_context=None):
# Ugly hack for CORD
self.inlines = self.normal_inlines
@@ -1135,26 +1245,30 @@
return super(SliceAdmin, self).add_view(request, form_url, extra_context=extra_context)
def change_view(self, request, object_id, form_url='', extra_context=None):
- # cannot change the site of an existing slice so make the site field read only
+ # cannot change the site of an existing slice so make the site field
+ # read only
if object_id:
- self.readonly_fields = ('backend_status_text','site')
+ self.readonly_fields = ('backend_status_text', 'site')
return super(SliceAdmin, self).change_view(request, object_id, form_url)
def render_change_form(self, request, context, add=False, change=False, form_url='', obj=None):
deployment_nodes = []
for node in Node.objects.all():
- deployment_nodes.append( (node.site_deployment.deployment.id, node.id, node.name) )
+ deployment_nodes.append(
+ (node.site_deployment.deployment.id, node.id, node.name))
deployment_flavors = []
for flavor in Flavor.objects.all():
for deployment in flavor.deployments.all():
- deployment_flavors.append( (deployment.id, flavor.id, flavor.name) )
+ deployment_flavors.append(
+ (deployment.id, flavor.id, flavor.name))
deployment_images = []
for image in Image.objects.all():
for deployment_image in image.imagedeployments.all():
- deployment_images.append( (deployment_image.deployment.id, image.id, image.name) )
+ deployment_images.append(
+ (deployment_image.deployment.id, image.id, image.name))
site_login_bases = []
for site in Site.objects.all():
@@ -1168,8 +1282,10 @@
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if db_field.name == 'site':
- kwargs['queryset'] = Site.select_by_user(request.user).filter(hosts_users=True)
- kwargs['widget'] = forms.Select(attrs={'onChange': "update_slice_prefix(this, $($(this).closest('fieldset')[0]).find('.field-name input')[0].id)"})
+ kwargs['queryset'] = Site.select_by_user(
+ request.user).filter(hosts_users=True)
+ kwargs['widget'] = forms.Select(
+ attrs={'onChange': "update_slice_prefix(this, $($(this).closest('fieldset')[0]).find('.field-name input')[0].id)"})
return super(SliceAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)
@@ -1189,7 +1305,7 @@
def add_extra_context(self, request, extra_context):
super(SliceAdmin, self).add_extra_context(request, extra_context)
# set context["slice_id"] to the PK passed in the URL to this view
- if len(request.resolver_match.args)>0:
+ if len(request.resolver_match.args) > 0:
extra_context["slice_id"] = request.resolver_match.args[0]
def UNUSED_get_inline_instances(self, request, obj=None):
@@ -1199,16 +1315,19 @@
# XXX this approach is better than clobbering self.inlines, so
# try to make this work post-demo.
if (obj is not None) and (obj.name == "mysite_vcpe"):
- cord_vcpe_inlines = [ SlicePrivilegeInline, CordInstanceInline, TagInline, ReservationInline,SliceNetworkInline]
+ cord_vcpe_inlines = [SlicePrivilegeInline, CordInstanceInline,
+ TagInline, ReservationInline, SliceNetworkInline]
- inlines=[]
+ inlines = []
for inline_class in cord_vcpe_inlines:
inlines.append(inline_class(self.model, self.admin_site))
else:
- inlines = super(SliceAdmin, self).get_inline_instances(request, obj)
+ inlines = super(SliceAdmin, self).get_inline_instances(
+ request, obj)
return inlines
+
class SlicePrivilegeAdmin(XOSBaseAdmin):
fieldsets = [
(None, {'fields': ['backend_status_text', 'user', 'slice', 'role']})
@@ -1223,7 +1342,7 @@
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if db_field.name == 'slice':
kwargs['queryset'] = Slice.select_by_user(request.user)
-
+
if db_field.name == 'user':
kwargs['queryset'] = User.select_by_user(request.user)
@@ -1248,23 +1367,27 @@
obj.os_manager = OpenStackManager(auth=auth, caller=request.user)
obj.delete()
+
class ImageAdmin(XOSBaseAdmin):
fieldsets = [('Image Details',
- {'fields': ['backend_status_text', 'name', 'kind', 'disk_format', 'container_format', 'tag', 'path'],
- 'classes': ['suit-tab suit-tab-general']})
- ]
+ {'fields': ['backend_status_text', 'name', 'kind', 'disk_format', 'container_format', 'tag', 'path'],
+ 'classes': ['suit-tab suit-tab-general']})
+ ]
readonly_fields = ('backend_status_text', )
- suit_form_tabs =(('general','Image Details'),('instances','Instances'),('imagedeployments','Deployments'), ('admin-only', 'Admin-Only'))
+ suit_form_tabs = (('general', 'Image Details'), ('instances', 'Instances'),
+ ('imagedeployments', 'Deployments'), ('admin-only', 'Admin-Only'))
inlines = [InstanceInline, ControllerImagesInline]
- user_readonly_fields = ['name', 'disk_format', 'container_format', 'tag', 'path']
+ user_readonly_fields = ['name', 'disk_format',
+ 'container_format', 'tag', 'path']
list_display = ['backend_status_icon', 'name', 'kind']
list_display_links = ('backend_status_icon', 'name', )
+
class NodeForm(forms.ModelForm):
nodelabels = forms.ModelMultipleChoiceField(
queryset=NodeLabel.objects.all(),
@@ -1274,6 +1397,7 @@
verbose_name=('Labels'), is_stacked=False
)
)
+
class Meta:
model = Node
widgets = {
@@ -1282,21 +1406,21 @@
}
def __init__(self, *args, **kwargs):
- request = kwargs.pop('request', None)
- super(NodeForm, self).__init__(*args, **kwargs)
+ request = kwargs.pop('request', None)
+ super(NodeForm, self).__init__(*args, **kwargs)
- if self.instance and self.instance.pk:
- self.fields['nodelabels'].initial = self.instance.nodelabels.all()
+ if self.instance and self.instance.pk:
+ self.fields['nodelabels'].initial = self.instance.nodelabels.all()
def save(self, commit=True):
- node = super(NodeForm, self).save(commit=False)
+ node = super(NodeForm, self).save(commit=False)
- node.nodelabels = self.cleaned_data['nodelabels']
+ node.nodelabels = self.cleaned_data['nodelabels']
- if commit:
- node.save()
+ if commit:
+ node.save()
- return node
+ return node
class NodeLabelAdmin(XOSBaseAdmin):
@@ -1312,25 +1436,30 @@
list_display_links = ('backend_status_icon', 'name', )
list_filter = ('site_deployment',)
- inlines = [TagInline,InstanceInline]
+ inlines = [TagInline, InstanceInline]
fieldsets = [('Node Details', {'fields': ['backend_status_text', 'name', 'site_deployment'], 'classes':['suit-tab suit-tab-details']}),
('Labels', {'fields': ['nodelabels'], 'classes':['suit-tab suit-tab-labels']})]
readonly_fields = ('backend_status_text', )
- user_readonly_fields = ['name','site_deployment']
- user_readonly_inlines = [TagInline,InstanceInline]
+ user_readonly_fields = ['name', 'site_deployment']
+ user_readonly_inlines = [TagInline, InstanceInline]
- suit_form_tabs =(('details','Node Details'),('instances','Instances'), ('labels', 'Labels'), ('tags','Tags'))
+ suit_form_tabs = (('details', 'Node Details'), ('instances',
+ 'Instances'), ('labels', 'Labels'), ('tags', 'Tags'))
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if db_field.name == 'site':
- kwargs['queryset'] = Site.select_by_user(request.user).filter(hosts_nodes=True)
+ kwargs['queryset'] = Site.select_by_user(
+ request.user).filter(hosts_nodes=True)
- field = super(NodeAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)
+ field = super(NodeAdmin, self).formfield_for_foreignkey(
+ db_field, request, **kwargs)
return field
+
class InstanceForm(forms.ModelForm):
+
class Meta:
model = Instance
ip = forms.CharField(widget=PlainTextWidget)
@@ -1345,12 +1474,16 @@
'image': LinkedSelect
}
+
class TagAdmin(XOSBaseAdmin):
- list_display = ['backend_status_icon', 'service', 'name', 'value', 'content_type', 'content_object',]
+ list_display = ['backend_status_icon', 'service',
+ 'name', 'value', 'content_type', 'content_object', ]
list_display_links = list_display
- user_readonly_fields = ['service', 'name', 'value', 'content_type', 'content_object',]
+ user_readonly_fields = ['service', 'name',
+ 'value', 'content_type', 'content_object', ]
user_readonly_inlines = []
+
class InstancePortInline(XOSTabularInline):
fields = ['backend_status_icon', 'network', 'instance', 'ip', 'mac']
readonly_fields = ("backend_status_icon", "ip", "mac")
@@ -1361,21 +1494,28 @@
verbose_name = "Port"
suit_classes = 'suit-tab suit-tab-ports'
+
class InstanceAdmin(XOSBaseAdmin):
form = InstanceForm
fieldsets = [
- ('Instance Details', {'fields': ['backend_status_text', 'slice', 'deployment', 'isolation', 'flavor', 'image', 'node', 'parent', 'all_ips_string', 'instance_id', 'instance_name', 'ssh_command', ], 'classes': ['suit-tab suit-tab-general'], }),
- ('Container Settings', {'fields': ['volumes'], 'classes': ['suit-tab suit-tab-container'], }),
+ ('Instance Details', {'fields': ['backend_status_text', 'slice', 'deployment', 'isolation', 'flavor', 'image', 'node',
+ 'parent', 'all_ips_string', 'instance_id', 'instance_name', 'ssh_command', ], 'classes': ['suit-tab suit-tab-general'], }),
+ ('Container Settings', {'fields': ['volumes'], 'classes': [
+ 'suit-tab suit-tab-container'], }),
]
readonly_fields = ('backend_status_text', 'ssh_command', 'all_ips_string')
- list_display = ['backend_status_icon', 'all_ips_string', 'instance_id', 'instance_name', 'isolation', 'slice', 'flavor', 'image', 'node', 'deployment']
- list_display_links = ('backend_status_icon', 'all_ips_string', 'instance_id', )
+ list_display = ['backend_status_icon', 'all_ips_string', 'instance_id',
+ 'instance_name', 'isolation', 'slice', 'flavor', 'image', 'node', 'deployment']
+ list_display_links = ('backend_status_icon',
+ 'all_ips_string', 'instance_id', )
- suit_form_tabs =(('general', 'Instance Details'), ('ports', 'Ports'), ('container', 'Container Settings'), ('tags', 'Tags'))
+ suit_form_tabs = (('general', 'Instance Details'), ('ports', 'Ports'),
+ ('container', 'Container Settings'), ('tags', 'Tags'))
inlines = [TagInline, InstancePortInline]
- user_readonly_fields = ['slice', 'deployment', 'node', 'ip', 'instance_name', 'flavor', 'image']
+ user_readonly_fields = ['slice', 'deployment',
+ 'node', 'ip', 'instance_name', 'flavor', 'image']
def ssh_command(self, obj):
ssh_command = obj.get_ssh_command()
@@ -1395,30 +1535,36 @@
# the slices they belong to.
return Instance.select_by_user(request.user)
- def add_view(self, request, form_url='', extra_context = None):
- self.readonly_fields = ('backend_status_text', 'ssh_command', 'all_ips_string')
- return super(InstanceAdmin,self).add_view(request, form_url, extra_context)
+ def add_view(self, request, form_url='', extra_context=None):
+ self.readonly_fields = ('backend_status_text',
+ 'ssh_command', 'all_ips_string')
+ return super(InstanceAdmin, self).add_view(request, form_url, extra_context)
def change_view(self, request, object_id, extra_context=None):
- self.readonly_fields = ('backend_status_text', 'ssh_command', 'all_ips_string', 'deployment', 'slice', 'flavor', 'image', 'node')
- self.readonly_save = self.readonly_fields # for XOSAdminMixin.change_view's user_readonly_fields switching code
- return super(InstanceAdmin,self).change_view(request, object_id, extra_context)
+ self.readonly_fields = ('backend_status_text', 'ssh_command',
+ 'all_ips_string', 'deployment', 'slice', 'flavor', 'image', 'node')
+ # for XOSAdminMixin.change_view's user_readonly_fields switching code
+ self.readonly_save = self.readonly_fields
+ return super(InstanceAdmin, self).change_view(request, object_id, extra_context)
def render_change_form(self, request, context, add=False, change=False, form_url='', obj=None):
deployment_nodes = []
# for node in Node.objects.all():
for node in Node.objects.order_by("name"):
- deployment_nodes.append( (node.site_deployment.deployment.id, node.id, node.name) )
+ deployment_nodes.append(
+ (node.site_deployment.deployment.id, node.id, node.name))
deployment_flavors = []
for flavor in Flavor.objects.all():
for deployment in flavor.deployments.all():
- deployment_flavors.append( (deployment.id, flavor.id, flavor.name) )
+ deployment_flavors.append(
+ (deployment.id, flavor.id, flavor.name))
deployment_images = []
for image in Image.objects.all():
for deployment_image in image.imagedeployments.all():
- deployment_images.append( (deployment_image.deployment.id, image.id, image.name) )
+ deployment_images.append(
+ (deployment_image.deployment.id, image.id, image.name))
site_login_bases = []
for site in Site.objects.all():
@@ -1432,16 +1578,20 @@
def formfield_for_foreignkey(self, db_field, request=None, **kwargs):
if db_field.name == 'deployment':
- kwargs['queryset'] = Deployment.select_by_acl(request.user).filter(sitedeployments__nodes__isnull=False).distinct()
- kwargs['widget'] = forms.Select(attrs={'onChange': "instance_deployment_changed(this);"})
+ kwargs['queryset'] = Deployment.select_by_acl(request.user).filter(
+ sitedeployments__nodes__isnull=False).distinct()
+ kwargs['widget'] = forms.Select(
+ attrs={'onChange': "instance_deployment_changed(this);"})
if db_field.name == 'flavor':
- kwargs['widget'] = forms.Select(attrs={'onChange': "instance_flavor_changed(this);"})
+ kwargs['widget'] = forms.Select(
+ attrs={'onChange': "instance_flavor_changed(this);"})
- field = super(InstanceAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)
+ field = super(InstanceAdmin, self).formfield_for_foreignkey(
+ db_field, request, **kwargs)
return field
- #def save_model(self, request, obj, form, change):
+ # def save_model(self, request, obj, form, change):
# # update openstack connection to use this site/tenant
# auth = request.session.get('auth', {})
# auth['tenant'] = obj.slice.name
@@ -1449,14 +1599,14 @@
# obj.creator = request.user
# obj.save()
- #def delete_model(self, request, obj):
+ # def delete_model(self, request, obj):
# # update openstack connection to use this site/tenant
# auth = request.session.get('auth', {})
# auth['tenant'] = obj.slice.name
# obj.os_manager = OpenStackManager(auth=auth, caller=request.user)
# obj.delete()
-#class ContainerPortInline(XOSTabularInline):
+# class ContainerPortInline(XOSTabularInline):
# fields = ['backend_status_icon', 'network', 'container', 'ip', 'mac', 'segmentation_id']
# readonly_fields = ("backend_status_icon", "ip", "mac", "segmentation_id")
# model = Port
@@ -1466,7 +1616,7 @@
# verbose_name = "Port"
# suit_classes = 'suit-tab suit-tab-ports'
-#class ContainerAdmin(XOSBaseAdmin):
+# class ContainerAdmin(XOSBaseAdmin):
# fieldsets = [
# ('Container Details', {'fields': ['backend_status_text', 'slice', 'node', 'docker_image', 'volumes', 'no_sync'], 'classes': ['suit-tab suit-tab-general'], })
# ]
@@ -1489,11 +1639,13 @@
# # the slices they belong to.
# return Container.select_by_user(request.user)
+
class UserCreationForm(forms.ModelForm):
"""A form for creating new users. Includes all the required
fields, plus a repeated password."""
password1 = forms.CharField(label='Password', widget=forms.PasswordInput)
- password2 = forms.CharField(label='Password confirmation', widget=forms.PasswordInput)
+ password2 = forms.CharField(
+ label='Password confirmation', widget=forms.PasswordInput)
class Meta:
model = User
@@ -1511,7 +1663,7 @@
# Save the provided password in hashed format
user = super(UserCreationForm, self).save(commit=False)
user.password = self.cleaned_data["password1"]
- #user.set_password(self.cleaned_data["password1"])
+ # user.set_password(self.cleaned_data["password1"])
if commit:
user.save()
return user
@@ -1523,14 +1675,16 @@
password hash display field.
"""
password = ReadOnlyPasswordHashField(label='Password',
- help_text= '<a href=\"password/\">Change Password</a>.')
+ help_text='<a href=\"password/\">Change Password</a>.')
- PROFILE_CHOICES = ((None, '------'), ('regular', 'Regular user'), ('cp', 'Content Provider'))
- profile = forms.ChoiceField(choices=PROFILE_CHOICES, required=False, label="Quick Profile")
+ PROFILE_CHOICES = ((None, '------'), ('regular',
+ 'Regular user'), ('cp', 'Content Provider'))
+ profile = forms.ChoiceField(
+ choices=PROFILE_CHOICES, required=False, label="Quick Profile")
class Meta:
model = User
- widgets = { 'public_key': UploadTextareaWidget, }
+ widgets = {'public_key': UploadTextareaWidget, }
def clean_password(self):
# Regardless of what the user provides, return the initial value.
@@ -1540,16 +1694,18 @@
def save(self, *args, **kwargs):
if self.cleaned_data['profile']:
- self.instance.apply_profile(self.cleaned_data['profile'])
+ self.instance.apply_profile(self.cleaned_data['profile'])
return super(UserChangeForm, self).save(*args, **kwargs)
+
class UserDashboardViewInline(XOSTabularInline):
model = UserDashboardView
extra = 0
suit_classes = 'suit-tab suit-tab-dashboards'
fields = ['user', 'dashboardView', 'order']
+
class ControllerUserInline(XOSTabularInline):
model = ControllerUser
extra = 0
@@ -1571,24 +1727,28 @@
# The fields to be used in displaying the User model.
# These override the definitions on the base UserAdmin
# that reference specific fields on auth.User.
- list_display = ('backend_status_icon', 'email', 'firstname', 'lastname', 'site', 'last_login')
+ list_display = ('backend_status_icon', 'email',
+ 'firstname', 'lastname', 'site', 'last_login')
list_display_links = ("email",)
list_filter = ('site',)
- inlines = [SlicePrivilegeInline,SitePrivilegeInline]
+ inlines = [SlicePrivilegeInline, SitePrivilegeInline]
admin_inlines = [ControllerUserInline]
- fieldListLoginDetails = ['backend_status_text', 'email', 'site','password','is_active','is_readonly','is_admin','is_appuser', 'public_key', 'login_page', 'profile']
- fieldListContactInfo = ['firstname','lastname','phone','timezone']
+ fieldListLoginDetails = ['backend_status_text', 'email', 'site', 'password', 'is_active',
+ 'is_readonly', 'is_admin', 'is_appuser', 'public_key', 'login_page', 'profile']
+ fieldListContactInfo = ['firstname', 'lastname', 'phone', 'timezone']
fieldsets = (
- ('Login Details', {'fields': ['backend_status_text', 'email', 'site','password', 'is_active', 'is_readonly', 'is_admin', 'is_appuser', 'public_key'], 'classes':['suit-tab suit-tab-general']}),
- ('Contact Information', {'fields': ('firstname','lastname','phone', 'timezone'), 'classes':['suit-tab suit-tab-contact']}),
+ ('Login Details', {'fields': ['backend_status_text', 'email', 'site', 'password', 'is_active',
+ 'is_readonly', 'is_admin', 'is_appuser', 'public_key'], 'classes': ['suit-tab suit-tab-general']}),
+ ('Contact Information', {'fields': (
+ 'firstname', 'lastname', 'phone', 'timezone'), 'classes': ['suit-tab suit-tab-contact']}),
#('Important dates', {'fields': ('last_login',)}),
)
add_fieldsets = (
(None, {
'classes': ('wide',),
- 'fields': ('site', 'email', 'firstname', 'lastname', 'is_admin', 'is_readonly', 'is_appuser', 'phone', 'public_key','password1', 'password2')},
- ),
+ 'fields': ('site', 'email', 'firstname', 'lastname', 'is_admin', 'is_readonly', 'is_appuser', 'phone', 'public_key', 'password1', 'password2')},
+ ),
)
readonly_fields = ('backend_status_text', )
search_fields = ('email',)
@@ -1602,20 +1762,21 @@
if getattr(_thread_locals, "obj", None) is None:
return []
else:
- tabs = [('general','Login Details'),
- ('contact','Contact Information'),
- ('sliceprivileges','Slice Privileges'),
- ('siteprivileges','Site Privileges')]
+ tabs = [('general', 'Login Details'),
+ ('contact', 'Contact Information'),
+ ('sliceprivileges', 'Slice Privileges'),
+ ('siteprivileges', 'Site Privileges')]
- request=getattr(_thread_locals, "request", None)
+ request = getattr(_thread_locals, "request", None)
if request and request.user.is_admin:
- tabs.append( ('admin-only', 'Admin-Only') )
+ tabs.append(('admin-only', 'Admin-Only'))
return tabs
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if db_field.name == 'site':
- kwargs['queryset'] = Site.select_by_user(request.user).filter(hosts_users=True)
+ kwargs['queryset'] = Site.select_by_user(
+ request.user).filter(hosts_users=True)
return super(UserAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)
@@ -1635,14 +1796,17 @@
login_details_fields.remove('is_admin')
if 'profile' in login_details_fields:
login_details_fields.remove('profile')
- #if len(request.user.siteprivileges.filter(role__role = 'pi')) > 0:
+ # if len(request.user.siteprivileges.filter(role__role = 'pi')) > 0:
# only admins and pis can change a user's site
- # self.readonly_fields = ('backend_status_text', 'site')
+ # self.readonly_fields = ('backend_status_text', 'site')
self.fieldsets = (
- ('Login Details', {'fields': login_details_fields, 'classes':['suit-tab suit-tab-general']}),
- ('Contact Information', {'fields': self.fieldListContactInfo, 'classes':['suit-tab suit-tab-contact']}),
+ ('Login Details', {'fields': login_details_fields,
+ 'classes': ['suit-tab suit-tab-general']}),
+ ('Contact Information', {
+ 'fields': self.fieldListContactInfo, 'classes': ['suit-tab suit-tab-contact']}),
)
- return super(UserAdmin, self).get_form(request, obj, **kwargs)
+ return super(UserAdmin, self).get_form(request, obj, **kwargs)
+
class ControllerDashboardViewInline(XOSTabularInline):
model = ControllerDashboardView
@@ -1650,42 +1814,49 @@
fields = ["controller", "url"]
suit_classes = 'suit-tab suit-tab-controllers'
+
class DashboardViewAdmin(XOSBaseAdmin):
fieldsets = [('Dashboard View Details',
- {'fields': ['backend_status_text', 'name', 'url', 'enabled', 'deployments'],
- 'classes': ['suit-tab suit-tab-general']})
- ]
+ {'fields': ['backend_status_text', 'name', 'url', 'enabled', 'deployments'],
+ 'classes': ['suit-tab suit-tab-general']})
+ ]
list_display = ["name", "enabled", "url"]
readonly_fields = ('backend_status_text', )
inlines = [ControllerDashboardViewInline]
- suit_form_tabs =(('general','Dashboard View Details'),
- ('controllers', 'Per-controller Dashboard Details'))
+ suit_form_tabs = (('general', 'Dashboard View Details'),
+ ('controllers', 'Per-controller Dashboard Details'))
+
class ServiceResourceInline(XOSTabularInline):
model = ServiceResource
extra = 0
+
class ServiceClassAdmin(XOSBaseAdmin):
- list_display = ('backend_status_icon', 'name', 'commitment', 'membershipFee')
+ list_display = ('backend_status_icon', 'name',
+ 'commitment', 'membershipFee')
list_display_links = ('backend_status_icon', 'name', )
inlines = [ServiceResourceInline]
user_readonly_fields = ['name', 'commitment', 'membershipFee']
user_readonly_inlines = []
+
class ReservedResourceInline(XOSTabularInline):
model = ReservedResource
extra = 0
suit_classes = 'suit-tab suit-tab-reservedresources'
def formfield_for_foreignkey(self, db_field, request=None, **kwargs):
- field = super(ReservedResourceInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
+ field = super(ReservedResourceInline, self).formfield_for_foreignkey(
+ db_field, request, **kwargs)
if db_field.name == 'resource':
# restrict resources to those that the slice's service class allows
if request._slice is not None:
- field.queryset = field.queryset.filter(serviceClass = request._slice.serviceClass, calendarReservable=True)
+ field.queryset = field.queryset.filter(
+ serviceClass=request._slice.serviceClass, calendarReservable=True)
if len(field.queryset) > 0:
field.initial = field.queryset.all()[0]
else:
@@ -1693,7 +1864,7 @@
elif db_field.name == 'instance':
# restrict instances to those that belong to the slice
if request._slice is not None:
- field.queryset = field.queryset.filter(slice = request._slice)
+ field.queryset = field.queryset.filter(slice=request._slice)
else:
field.queryset = field.queryset.none()
@@ -1702,31 +1873,37 @@
def queryset(self, request):
return ReservedResource.select_by_user(request.user)
+
class ReservationChangeForm(forms.ModelForm):
+
class Meta:
model = Reservation
widgets = {
- 'slice' : LinkedSelect
+ 'slice': LinkedSelect
}
+
class ReservationAddForm(forms.ModelForm):
- slice = forms.ModelChoiceField(queryset=Slice.objects.all(), widget=forms.Select(attrs={"onChange":"document.getElementById('id_refresh').value=1; submit()"}))
+ slice = forms.ModelChoiceField(queryset=Slice.objects.all(), widget=forms.Select(
+ attrs={"onChange": "document.getElementById('id_refresh').value=1; submit()"}))
refresh = forms.CharField(widget=forms.HiddenInput())
class Media:
- css = {'all': ('xos.css',)} # .field-refresh { display: none; }
+ css = {'all': ('xos.css',)} # .field-refresh { display: none; }
def clean_slice(self):
slice = self.cleaned_data.get("slice")
- x = ServiceResource.objects.filter(serviceClass = slice.serviceClass, calendarReservable=True)
+ x = ServiceResource.objects.filter(
+ serviceClass=slice.serviceClass, calendarReservable=True)
if len(x) == 0:
- raise forms.ValidationError("The slice you selected does not have a service class that allows reservations")
+ raise forms.ValidationError(
+ "The slice you selected does not have a service class that allows reservations")
return slice
class Meta:
model = Reservation
widgets = {
- 'slice' : LinkedSelect
+ 'slice': LinkedSelect
}
@@ -1750,17 +1927,21 @@
return result
""" don't save anything """
+
def is_valid(self):
return False
+
class ReservationAdmin(XOSBaseAdmin):
fieldList = ['backend_status_text', 'slice', 'startTime', 'duration']
- fieldsets = [('Reservation Details', {'fields': fieldList, 'classes': ['suit-tab suit-tab-general']})]
+ fieldsets = [('Reservation Details', {
+ 'fields': fieldList, 'classes': ['suit-tab suit-tab-general']})]
readonly_fields = ('backend_status_text', )
list_display = ('startTime', 'duration')
form = ReservationAddForm
- suit_form_tabs = (('general','Reservation Details'), ('reservedresources','Reserved Resources'))
+ suit_form_tabs = (('general', 'Reservation Details'),
+ ('reservedresources', 'Reserved Resources'))
inlines = [ReservedResourceInline]
user_readonly_fields = fieldList
@@ -1772,20 +1953,21 @@
if request.method == 'POST':
# "refresh" will be set to "1" if the form was submitted due to
# a change in the Slice dropdown.
- if request.POST.get("refresh","1") == "1":
+ if request.POST.get("refresh", "1") == "1":
request._refresh = True
request.POST["refresh"] = "0"
# Keep track of the slice that was selected, so the
# reservedResource inline can filter items for the slice.
- request._slice = request.POST.get("slice",None)
+ request._slice = request.POST.get("slice", None)
if (request._slice is not None):
request._slice = Slice.objects.get(id=request._slice)
- result = super(ReservationAdmin, self).add_view(request, form_url, extra_context)
+ result = super(ReservationAdmin, self).add_view(
+ request, form_url, extra_context)
return result
- def changelist_view(self, request, extra_context = None):
+ def changelist_view(self, request, extra_context=None):
timezone.activate(request.user.timezone)
return super(ReservationAdmin, self).changelist_view(request, extra_context)
@@ -1814,18 +1996,21 @@
def queryset(self, request):
return Reservation.select_by_user(request.user)
+
class NetworkParameterTypeAdmin(XOSBaseAdmin):
list_display = ("backend_status_icon", "name", )
list_display_links = ('backend_status_icon', 'name', )
user_readonly_fields = ['name']
user_readonly_inlines = []
+
class RouterAdmin(XOSBaseAdmin):
list_display = ("backend_status_icon", "name", )
list_display_links = ('backend_status_icon', 'name', )
user_readonly_fields = ['name']
user_readonly_inlines = []
+
class RouterInline(XOSTabularInline):
model = Router.networks.through
extra = 0
@@ -1833,6 +2018,7 @@
verbose_name = "Router"
suit_classes = 'suit-tab suit-tab-routers'
+
class NetworkParameterInline(PlStackGenericTabularInline):
model = NetworkParameter
extra = 0
@@ -1842,6 +2028,7 @@
fields = ['backend_status_icon', 'parameter', 'value']
readonly_fields = ('backend_status_icon', )
+
class NetworkPortInline(XOSTabularInline):
fields = ['backend_status_icon', 'network', 'instance', 'ip', 'mac']
readonly_fields = ("backend_status_icon", "ip", "mac")
@@ -1852,6 +2039,7 @@
verbose_name = "Port"
suit_classes = 'suit-tab suit-tab-ports'
+
class NetworkSlicesInline(XOSTabularInline):
model = NetworkSlice
selflink_fieldname = "slice"
@@ -1859,19 +2047,23 @@
verbose_name_plural = "Slices"
verbose_name = "Slice"
suit_classes = 'suit-tab suit-tab-networkslices'
- fields = ['backend_status_icon', 'network','slice']
+ fields = ['backend_status_icon', 'network', 'slice']
readonly_fields = ('backend_status_icon', )
+
class ControllerNetworkInline(XOSTabularInline):
model = ControllerNetwork
extra = 0
verbose_name_plural = "Controller Networks"
verbose_name = "Controller Network"
suit_classes = 'suit-tab suit-tab-admin-only'
- fields = ['backend_status_icon', 'controller','net_id','subnet_id','subnet']
+ fields = ['backend_status_icon', 'controller',
+ 'net_id', 'subnet_id', 'subnet']
readonly_fields = ('backend_status_icon', )
+
class NetworkForm(forms.ModelForm):
+
class Meta:
model = Network
widgets = {
@@ -1879,57 +2071,62 @@
'controllerParameters': UploadTextareaWidget,
}
+
class NetworkAdmin(XOSBaseAdmin):
list_display = ("backend_status_icon", "name", "subnet", "ports", "labels")
list_display_links = ('backend_status_icon', 'name', )
readonly_fields = ("subnet", )
- inlines = [NetworkParameterInline, NetworkPortInline, NetworkSlicesInline, RouterInline]
+ inlines = [NetworkParameterInline, NetworkPortInline,
+ NetworkSlicesInline, RouterInline]
admin_inlines = [ControllerNetworkInline]
- form=NetworkForm
+ form = NetworkForm
fieldsets = [
- (None, {'fields': ['backend_status_text', 'name','template','ports','labels',
- 'owner','guaranteed_bandwidth', 'permit_all_slices',
- 'permitted_slices','network_id','router_id','subnet_id',
+ (None, {'fields': ['backend_status_text', 'name', 'template', 'ports', 'labels',
+ 'owner', 'guaranteed_bandwidth', 'permit_all_slices',
+ 'permitted_slices', 'network_id', 'router_id', 'subnet_id',
'subnet', 'autoconnect'],
'classes':['suit-tab suit-tab-general']}),
(None, {'fields': ['topology_parameters', 'controller_url', 'controller_parameters'],
'classes':['suit-tab suit-tab-sdn']}),
- ]
+ ]
readonly_fields = ('backend_status_text', )
- user_readonly_fields = ['name','template','ports','labels','owner','guaranteed_bandwidth',
- 'permit_all_slices','permitted_slices','network_id','router_id',
- 'subnet_id','subnet','autoconnect']
+ user_readonly_fields = ['name', 'template', 'ports', 'labels', 'owner', 'guaranteed_bandwidth',
+ 'permit_all_slices', 'permitted_slices', 'network_id', 'router_id',
+ 'subnet_id', 'subnet', 'autoconnect']
@property
def suit_form_tabs(self):
- tabs=[('general','Network Details'),
- ('sdn', 'SDN Configuration'),
- ('netparams', 'Parameters'),
- ('ports','Ports'),
- ('networkslices','Slices'),
- ('routers','Routers'),
- ]
+ tabs = [('general', 'Network Details'),
+ ('sdn', 'SDN Configuration'),
+ ('netparams', 'Parameters'),
+ ('ports', 'Ports'),
+ ('networkslices', 'Slices'),
+ ('routers', 'Routers'),
+ ]
- request=getattr(_thread_locals, "request", None)
+ request = getattr(_thread_locals, "request", None)
if request and request.user.is_admin:
- tabs.append( ('admin-only', 'Admin-Only') )
+ tabs.append(('admin-only', 'Admin-Only'))
return tabs
class NetworkTemplateAdmin(XOSBaseAdmin):
- list_display = ("backend_status_icon", "name", "guaranteed_bandwidth", "visibility")
+ list_display = ("backend_status_icon", "name",
+ "guaranteed_bandwidth", "visibility")
list_display_links = ('backend_status_icon', 'name', )
user_readonly_fields = ["name", "guaranteed_bandwidth", "visibility"]
user_readonly_inlines = []
- inlines = [NetworkParameterInline,]
+ inlines = [NetworkParameterInline, ]
fieldsets = [
(None, {'fields': ['name', 'description', 'guaranteed_bandwidth', 'visibility', 'translation', 'access', 'shared_network_name', 'shared_network_id', 'topology_kind', 'controller_kind'],
- 'classes':['suit-tab suit-tab-general']}),]
- suit_form_tabs = (('general','Network Template Details'), ('netparams', 'Parameters') )
+ 'classes':['suit-tab suit-tab-general']}), ]
+ suit_form_tabs = (('general', 'Network Template Details'),
+ ('netparams', 'Parameters'))
+
class PortAdmin(XOSBaseAdmin):
list_display = ("backend_status_icon", "id", "ip")
@@ -1940,59 +2137,70 @@
fieldsets = [
(None, {'fields': ['backend_status_text', 'network', 'instance', 'ip', 'port_id', 'mac'],
'classes':['suit-tab suit-tab-general']}),
- ]
+ ]
readonly_fields = ('backend_status_text', )
suit_form_tabs = (('general', 'Port Details'), ('netparams', 'Parameters'))
+
class FlavorAdmin(XOSBaseAdmin):
- list_display = ("backend_status_icon", "name", "flavor", "order", "default")
+ list_display = ("backend_status_icon", "name",
+ "flavor", "order", "default")
list_display_links = ("backend_status_icon", "name")
user_readonly_fields = ("name", "flavor")
fields = ("name", "description", "flavor", "order", "default")
# register a signal that caches the user's credentials when they log in
+
+
def cache_credentials(sender, user, request, **kwds):
auth = {'username': request.POST['username'],
'password': request.POST['password']}
request.session['auth'] = auth
user_logged_in.connect(cache_credentials)
+
def dollar_field(fieldName, short_description):
def newFunc(self, obj):
try:
- x= "$ %0.2f" % float(getattr(obj, fieldName, 0.0))
+ x = "$ %0.2f" % float(getattr(obj, fieldName, 0.0))
except:
- x=getattr(obj, fieldName, 0.0)
+ x = getattr(obj, fieldName, 0.0)
return x
newFunc.short_description = short_description
return newFunc
+
def right_dollar_field(fieldName, short_description):
def newFunc(self, obj):
try:
#x= '<div align=right style="width:6em">$ %0.2f</div>' % float(getattr(obj, fieldName, 0.0))
- x= '<div align=right>$ %0.2f</div>' % float(getattr(obj, fieldName, 0.0))
+ x = '<div align=right>$ %0.2f</div>' % float(
+ getattr(obj, fieldName, 0.0))
except:
- x=getattr(obj, fieldName, 0.0)
+ x = getattr(obj, fieldName, 0.0)
return x
newFunc.short_description = short_description
newFunc.allow_tags = True
return newFunc
+
class InvoiceChargeInline(XOSTabularInline):
model = Charge
extra = 0
verbose_name_plural = "Charges"
verbose_name = "Charge"
exclude = ['account']
- fields = ["date", "kind", "state", "object", "coreHours", "dollar_amount", "slice"]
- readonly_fields = ["date", "kind", "state", "object", "coreHours", "dollar_amount", "slice"]
+ fields = ["date", "kind", "state", "object",
+ "coreHours", "dollar_amount", "slice"]
+ readonly_fields = ["date", "kind", "state",
+ "object", "coreHours", "dollar_amount", "slice"]
can_delete = False
max_num = 0
dollar_amount = right_dollar_field("amount", "Amount")
+
class InvoiceAdmin(admin.ModelAdmin):
list_display = ("date", "account")
@@ -2003,6 +2211,7 @@
dollar_amount = dollar_field("amount", "Amount")
+
class InvoiceInline(XOSTabularInline):
model = Invoice
extra = 0
@@ -2011,22 +2220,25 @@
fields = ["date", "dollar_amount"]
readonly_fields = ["date", "dollar_amount"]
suit_classes = 'suit-tab suit-tab-accountinvoice'
- can_delete=False
- max_num=0
+ can_delete = False
+ max_num = 0
dollar_amount = right_dollar_field("amount", "Amount")
+
class PendingChargeInline(XOSTabularInline):
model = Charge
extra = 0
verbose_name_plural = "Charges"
verbose_name = "Charge"
exclude = ["invoice"]
- fields = ["date", "kind", "state", "object", "coreHours", "dollar_amount", "slice"]
- readonly_fields = ["date", "kind", "state", "object", "coreHours", "dollar_amount", "slice"]
+ fields = ["date", "kind", "state", "object",
+ "coreHours", "dollar_amount", "slice"]
+ readonly_fields = ["date", "kind", "state",
+ "object", "coreHours", "dollar_amount", "slice"]
suit_classes = 'suit-tab suit-tab-accountpendingcharges'
- can_delete=False
- max_num=0
+ can_delete = False
+ max_num = 0
def queryset(self, request):
qs = super(PendingChargeInline, self).queryset(request)
@@ -2035,41 +2247,46 @@
dollar_amount = right_dollar_field("amount", "Amount")
+
class PaymentInline(XOSTabularInline):
- model=Payment
+ model = Payment
extra = 1
verbose_name_plural = "Payments"
verbose_name = "Payment"
fields = ["date", "dollar_amount"]
readonly_fields = ["date", "dollar_amount"]
suit_classes = 'suit-tab suit-tab-accountpayments'
- can_delete=False
- max_num=0
+ can_delete = False
+ max_num = 0
dollar_amount = right_dollar_field("amount", "Amount")
+
class AccountAdmin(admin.ModelAdmin):
list_display = ("site", "balance_due")
inlines = [InvoiceInline, PaymentInline, PendingChargeInline]
fieldsets = [
- (None, {'fields': ['site', 'dollar_balance_due', 'dollar_total_invoices', 'dollar_total_payments'],'classes':['suit-tab suit-tab-general']}),]
+ (None, {'fields': ['site', 'dollar_balance_due', 'dollar_total_invoices', 'dollar_total_payments'], 'classes':['suit-tab suit-tab-general']}), ]
- readonly_fields = ['site', 'dollar_balance_due', 'dollar_total_invoices', 'dollar_total_payments']
+ readonly_fields = ['site', 'dollar_balance_due',
+ 'dollar_total_invoices', 'dollar_total_payments']
- suit_form_tabs =(
- ('general','Account Details'),
+ suit_form_tabs = (
+ ('general', 'Account Details'),
('accountinvoice', 'Invoices'),
('accountpayments', 'Payments'),
- ('accountpendingcharges','Pending Charges'),
+ ('accountpendingcharges', 'Pending Charges'),
)
dollar_balance_due = dollar_field("balance_due", "Balance Due")
dollar_total_invoices = dollar_field("total_invoices", "Total Invoices")
dollar_total_payments = dollar_field("total_payments", "Total Payments")
+
class ProgramForm(forms.ModelForm):
+
class Meta:
model = Program
widgets = {
@@ -2079,11 +2296,12 @@
'output': forms.Textarea(attrs={'rows': 3, 'cols': 80, 'class': 'input-xxlarge'})
}
+
class ProgramAdmin(XOSBaseAdmin):
list_display = ("name", "status")
list_display_links = ('name', "status")
- form=ProgramForm
+ form = ProgramForm
fieldsets = [
(None, {'fields': ['name', 'command', 'kind', 'description', 'output', 'status'],
@@ -2092,49 +2310,52 @@
'classes':['suit-tab suit-tab-contents']}),
(None, {'fields': ['messages'],
'classes':['suit-tab suit-tab-messages']}),
- ]
+ ]
readonly_fields = ("status",)
@property
def suit_form_tabs(self):
- tabs=[('general','Program Details'),
- ('contents','Program Source'),
- ('messages','Messages'),
- ]
+ tabs = [('general', 'Program Details'),
+ ('contents', 'Program Source'),
+ ('messages', 'Messages'),
+ ]
- request=getattr(_thread_locals, "request", None)
+ request = getattr(_thread_locals, "request", None)
if request and request.user.is_admin:
- tabs.append( ('admin-only', 'Admin-Only') )
+ tabs.append(('admin-only', 'Admin-Only'))
return tabs
+
class AddressPoolForm(forms.ModelForm):
+
class Meta:
model = Program
widgets = {
'addresses': UploadTextareaWidget(attrs={'rows': 20, 'cols': 80, 'class': "input-xxlarge"}),
}
+
class AddressPoolAdmin(XOSBaseAdmin):
list_display = ("name", "cidr")
list_display_links = ('name',)
- form=AddressPoolForm
+ form = AddressPoolForm
fieldsets = [
(None, {'fields': ['name', 'cidr', 'gateway_ip', 'gateway_mac', 'addresses', 'inuse', 'service'],
'classes':['suit-tab suit-tab-general']}),
- ]
+ ]
readonly_fields = ("status",)
@property
def suit_form_tabs(self):
- tabs=[('general','Program Details'),
- ('contents','Program Source'),
- ('messages','Messages'),
- ]
+ tabs = [('general', 'Program Details'),
+ ('contents', 'Program Source'),
+ ('messages', 'Messages'),
+ ]
# request=getattr(_thread_locals, "request", None)
# if request and request.user.is_admin:
@@ -2146,9 +2367,9 @@
admin.site.register(User, UserAdmin)
# ... and, since we're not using Django's builtin permissions,
# unregister the Group model from admin.
-#admin.site.unregister(Group)
+# admin.site.unregister(Group)
-# When debugging it is often easier to see all the classes, but for regular use
+# When debugging it is often easier to see all the classes, but for regular use
# only the top-levels should be displayed
showAll = False
@@ -2185,4 +2406,3 @@
admin.site.register(TenantRootRole, TenantRootRoleAdmin)
admin.site.register(TenantAttribute, TenantAttributeAdmin)
admin.site.register(AddressPool, AddressPoolAdmin)
-
diff --git a/xos/core/migrations/0001_initial.py b/xos/core/migrations/0001_initial.py
index db7dad0..b2e5d00 100644
--- a/xos/core/migrations/0001_initial.py
+++ b/xos/core/migrations/0001_initial.py
@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
-from django.db import models, migrations
-import timezones.fields
import core.models.instance
import core.models.network
-import geoposition.fields
-import encrypted_fields.fields
import core.models.serviceclass
import django.utils.timezone
+import encrypted_fields.fields
+import geoposition.fields
+import timezones.fields
from django.conf import settings
+from django.db import migrations, models
class Migration(migrations.Migration):
@@ -22,16 +22,24 @@
migrations.CreateModel(
name='User',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('password', models.CharField(max_length=128, verbose_name='password')),
- ('last_login', models.DateTimeField(default=django.utils.timezone.now, verbose_name='last login')),
- ('email', models.EmailField(unique=True, max_length=255, verbose_name=b'email address', db_index=True)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('password', models.CharField(
+ max_length=128, verbose_name='password')),
+ ('last_login', models.DateTimeField(
+ default=django.utils.timezone.now, verbose_name='last login')),
+ ('email', models.EmailField(unique=True, max_length=255,
+ verbose_name=b'email address', db_index=True)),
('username', models.CharField(default=b'Something', max_length=255)),
- ('firstname', models.CharField(help_text=b"person's given name", max_length=200)),
- ('lastname', models.CharField(help_text=b"person's surname", max_length=200)),
- ('phone', models.CharField(help_text=b'phone number contact', max_length=100, null=True, blank=True)),
+ ('firstname', models.CharField(
+ help_text=b"person's given name", max_length=200)),
+ ('lastname', models.CharField(
+ help_text=b"person's surname", max_length=200)),
+ ('phone', models.CharField(help_text=b'phone number contact',
+ max_length=100, null=True, blank=True)),
('user_url', models.URLField(null=True, blank=True)),
- ('public_key', models.TextField(help_text=b'Public key string', max_length=1024, null=True, blank=True)),
+ ('public_key', models.TextField(
+ help_text=b'Public key string', max_length=1024, null=True, blank=True)),
('is_active', models.BooleanField(default=True)),
('is_admin', models.BooleanField(default=True)),
('is_staff', models.BooleanField(default=True)),
@@ -40,9 +48,11 @@
('updated', models.DateTimeField(auto_now=True)),
('enacted', models.DateTimeField(default=None, null=True)),
('policed', models.DateTimeField(default=None, null=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('timezone', timezones.fields.TimeZoneField(default=b'America/New_York', max_length=100, choices=[(b'Pacific/Midway', b'(GMT-1100) Pacific/Midway'), (b'Pacific/Niue', b'(GMT-1100) Pacific/Niue'), (b'Pacific/Pago_Pago', b'(GMT-1100) Pacific/Pago_Pago'), (b'America/Adak', b'(GMT-1000) America/Adak'), (b'Pacific/Honolulu', b'(GMT-1000) Pacific/Honolulu'), (b'Pacific/Johnston', b'(GMT-1000) Pacific/Johnston'), (b'Pacific/Rarotonga', b'(GMT-1000) Pacific/Rarotonga'), (b'Pacific/Tahiti', b'(GMT-1000) Pacific/Tahiti'), (b'US/Hawaii', b'(GMT-1000) US/Hawaii'), (b'Pacific/Marquesas', b'(GMT-0930) Pacific/Marquesas'), (b'America/Anchorage', b'(GMT-0900) America/Anchorage'), (b'America/Juneau', b'(GMT-0900) America/Juneau'), (b'America/Nome', b'(GMT-0900) America/Nome'), (b'America/Sitka', b'(GMT-0900) America/Sitka'), (b'America/Yakutat', b'(GMT-0900) America/Yakutat'), (b'Pacific/Gambier', b'(GMT-0900) Pacific/Gambier'), (b'US/Alaska', b'(GMT-0900) US/Alaska'), (b'America/Dawson', b'(GMT-0800) America/Dawson'), (b'America/Los_Angeles', b'(GMT-0800) America/Los_Angeles'), (b'America/Metlakatla', b'(GMT-0800) America/Metlakatla'), (b'America/Santa_Isabel', b'(GMT-0800) America/Santa_Isabel'), (b'America/Tijuana', b'(GMT-0800) America/Tijuana'), (b'America/Vancouver', b'(GMT-0800) America/Vancouver'), (b'America/Whitehorse', b'(GMT-0800) America/Whitehorse'), (b'Canada/Pacific', b'(GMT-0800) Canada/Pacific'), (b'Pacific/Pitcairn', b'(GMT-0800) Pacific/Pitcairn'), (b'US/Pacific', b'(GMT-0800) US/Pacific'), (b'America/Boise', b'(GMT-0700) America/Boise'), (b'America/Cambridge_Bay', b'(GMT-0700) America/Cambridge_Bay'), (b'America/Chihuahua', b'(GMT-0700) America/Chihuahua'), (b'America/Creston', b'(GMT-0700) America/Creston'), (b'America/Dawson_Creek', b'(GMT-0700) America/Dawson_Creek'), (b'America/Denver', b'(GMT-0700) America/Denver'), (b'America/Edmonton', b'(GMT-0700) America/Edmonton'), (b'America/Hermosillo', b'(GMT-0700) America/Hermosillo'), (b'America/Inuvik', b'(GMT-0700) America/Inuvik'), (b'America/Mazatlan', b'(GMT-0700) America/Mazatlan'), (b'America/Ojinaga', b'(GMT-0700) America/Ojinaga'), (b'America/Phoenix', b'(GMT-0700) America/Phoenix'), (b'America/Shiprock', b'(GMT-0700) America/Shiprock'), (b'America/Yellowknife', b'(GMT-0700) America/Yellowknife'), (b'Canada/Mountain', b'(GMT-0700) Canada/Mountain'), (b'US/Arizona', b'(GMT-0700) US/Arizona'), (b'US/Mountain', b'(GMT-0700) US/Mountain'), (b'America/Bahia_Banderas', b'(GMT-0600) America/Bahia_Banderas'), (b'America/Belize', b'(GMT-0600) America/Belize'), (b'America/Cancun', b'(GMT-0600) America/Cancun'), (b'America/Chicago', b'(GMT-0600) America/Chicago'), (b'America/Costa_Rica', b'(GMT-0600) America/Costa_Rica'), (b'America/El_Salvador', b'(GMT-0600) America/El_Salvador'), (b'America/Guatemala', b'(GMT-0600) America/Guatemala'), (b'America/Indiana/Knox', b'(GMT-0600) America/Indiana/Knox'), (b'America/Indiana/Tell_City', b'(GMT-0600) America/Indiana/Tell_City'), (b'America/Managua', b'(GMT-0600) America/Managua'), (b'America/Matamoros', b'(GMT-0600) America/Matamoros'), (b'America/Menominee', b'(GMT-0600) America/Menominee'), (b'America/Merida', b'(GMT-0600) America/Merida'), (b'America/Mexico_City', b'(GMT-0600) America/Mexico_City'), (b'America/Monterrey', b'(GMT-0600) America/Monterrey'), (b'America/North_Dakota/Beulah', b'(GMT-0600) America/North_Dakota/Beulah'), (b'America/North_Dakota/Center', b'(GMT-0600) America/North_Dakota/Center'), (b'America/North_Dakota/New_Salem', b'(GMT-0600) America/North_Dakota/New_Salem'), (b'America/Rainy_River', b'(GMT-0600) America/Rainy_River'), (b'America/Rankin_Inlet', b'(GMT-0600) America/Rankin_Inlet'), (b'America/Regina', b'(GMT-0600) America/Regina'), (b'America/Resolute', b'(GMT-0600) America/Resolute'), (b'America/Swift_Current', b'(GMT-0600) America/Swift_Current'), (b'America/Tegucigalpa', b'(GMT-0600) America/Tegucigalpa'), (b'America/Winnipeg', b'(GMT-0600) America/Winnipeg'), (b'Canada/Central', b'(GMT-0600) Canada/Central'), (b'Pacific/Galapagos', b'(GMT-0600) Pacific/Galapagos'), (b'US/Central', b'(GMT-0600) US/Central'), (b'America/Atikokan', b'(GMT-0500) America/Atikokan'), (b'America/Bogota', b'(GMT-0500) America/Bogota'), (b'America/Cayman', b'(GMT-0500) America/Cayman'), (b'America/Detroit', b'(GMT-0500) America/Detroit'), (b'America/Eirunepe', b'(GMT-0500) America/Eirunepe'), (b'America/Grand_Turk', b'(GMT-0500) America/Grand_Turk'), (b'America/Guayaquil', b'(GMT-0500) America/Guayaquil'), (b'America/Havana', b'(GMT-0500) America/Havana'), (b'America/Indiana/Indianapolis', b'(GMT-0500) America/Indiana/Indianapolis'), (b'America/Indiana/Marengo', b'(GMT-0500) America/Indiana/Marengo'), (b'America/Indiana/Petersburg', b'(GMT-0500) America/Indiana/Petersburg'), (b'America/Indiana/Vevay', b'(GMT-0500) America/Indiana/Vevay'), (b'America/Indiana/Vincennes', b'(GMT-0500) America/Indiana/Vincennes'), (b'America/Indiana/Winamac', b'(GMT-0500) America/Indiana/Winamac'), (b'America/Iqaluit', b'(GMT-0500) America/Iqaluit'), (b'America/Jamaica', b'(GMT-0500) America/Jamaica'), (b'America/Kentucky/Louisville', b'(GMT-0500) America/Kentucky/Louisville'), (b'America/Kentucky/Monticello', b'(GMT-0500) America/Kentucky/Monticello'), (b'America/Lima', b'(GMT-0500) America/Lima'), (b'America/Montreal', b'(GMT-0500) America/Montreal'), (b'America/Nassau', b'(GMT-0500) America/Nassau'), (b'America/New_York', b'(GMT-0500) America/New_York'), (b'America/Nipigon', b'(GMT-0500) America/Nipigon'), (b'America/Panama', b'(GMT-0500) America/Panama'), (b'America/Pangnirtung', b'(GMT-0500) America/Pangnirtung'), (b'America/Port-au-Prince', b'(GMT-0500) America/Port-au-Prince'), (b'America/Rio_Branco', b'(GMT-0500) America/Rio_Branco'), (b'America/Thunder_Bay', b'(GMT-0500) America/Thunder_Bay'), (b'America/Toronto', b'(GMT-0500) America/Toronto'), (b'Canada/Eastern', b'(GMT-0500) Canada/Eastern'), (b'Pacific/Easter', b'(GMT-0500) Pacific/Easter'), (b'US/Eastern', b'(GMT-0500) US/Eastern'), (b'America/Caracas', b'(GMT-0430) America/Caracas'), (b'America/Anguilla', b'(GMT-0400) America/Anguilla'), (b'America/Antigua', b'(GMT-0400) America/Antigua'), (b'America/Aruba', b'(GMT-0400) America/Aruba'), (b'America/Barbados', b'(GMT-0400) America/Barbados'), (b'America/Blanc-Sablon', b'(GMT-0400) America/Blanc-Sablon'), (b'America/Boa_Vista', b'(GMT-0400) America/Boa_Vista'), (b'America/Curacao', b'(GMT-0400) America/Curacao'), (b'America/Dominica', b'(GMT-0400) America/Dominica'), (b'America/Glace_Bay', b'(GMT-0400) America/Glace_Bay'), (b'America/Goose_Bay', b'(GMT-0400) America/Goose_Bay'), (b'America/Grenada', b'(GMT-0400) America/Grenada'), (b'America/Guadeloupe', b'(GMT-0400) America/Guadeloupe'), (b'America/Guyana', b'(GMT-0400) America/Guyana'), (b'America/Halifax', b'(GMT-0400) America/Halifax'), (b'America/Kralendijk', b'(GMT-0400) America/Kralendijk'), (b'America/La_Paz', b'(GMT-0400) America/La_Paz'), (b'America/Lower_Princes', b'(GMT-0400) America/Lower_Princes'), (b'America/Manaus', b'(GMT-0400) America/Manaus'), (b'America/Marigot', b'(GMT-0400) America/Marigot'), (b'America/Martinique', b'(GMT-0400) America/Martinique'), (b'America/Moncton', b'(GMT-0400) America/Moncton'), (b'America/Montserrat', b'(GMT-0400) America/Montserrat'), (b'America/Port_of_Spain', b'(GMT-0400) America/Port_of_Spain'), (b'America/Porto_Velho', b'(GMT-0400) America/Porto_Velho'), (b'America/Puerto_Rico', b'(GMT-0400) America/Puerto_Rico'), (b'America/Santo_Domingo', b'(GMT-0400) America/Santo_Domingo'), (b'America/St_Barthelemy', b'(GMT-0400) America/St_Barthelemy'), (b'America/St_Kitts', b'(GMT-0400) America/St_Kitts'), (b'America/St_Lucia', b'(GMT-0400) America/St_Lucia'), (b'America/St_Thomas', b'(GMT-0400) America/St_Thomas'), (b'America/St_Vincent', b'(GMT-0400) America/St_Vincent'), (b'America/Thule', b'(GMT-0400) America/Thule'), (b'America/Tortola', b'(GMT-0400) America/Tortola'), (b'Atlantic/Bermuda', b'(GMT-0400) Atlantic/Bermuda'), (b'Canada/Atlantic', b'(GMT-0400) Canada/Atlantic'), (b'America/St_Johns', b'(GMT-0330) America/St_Johns'), (b'Canada/Newfoundland', b'(GMT-0330) Canada/Newfoundland'), (b'America/Araguaina', b'(GMT-0300) America/Araguaina'), (b'America/Argentina/Buenos_Aires', b'(GMT-0300) America/Argentina/Buenos_Aires'), (b'America/Argentina/Catamarca', b'(GMT-0300) America/Argentina/Catamarca'), (b'America/Argentina/Cordoba', b'(GMT-0300) America/Argentina/Cordoba'), (b'America/Argentina/Jujuy', b'(GMT-0300) America/Argentina/Jujuy'), (b'America/Argentina/La_Rioja', b'(GMT-0300) America/Argentina/La_Rioja'), (b'America/Argentina/Mendoza', b'(GMT-0300) America/Argentina/Mendoza'), (b'America/Argentina/Rio_Gallegos', b'(GMT-0300) America/Argentina/Rio_Gallegos'), (b'America/Argentina/Salta', b'(GMT-0300) America/Argentina/Salta'), (b'America/Argentina/San_Juan', b'(GMT-0300) America/Argentina/San_Juan'), (b'America/Argentina/San_Luis', b'(GMT-0300) America/Argentina/San_Luis'), (b'America/Argentina/Tucuman', b'(GMT-0300) America/Argentina/Tucuman'), (b'America/Argentina/Ushuaia', b'(GMT-0300) America/Argentina/Ushuaia'), (b'America/Asuncion', b'(GMT-0300) America/Asuncion'), (b'America/Bahia', b'(GMT-0300) America/Bahia'), (b'America/Belem', b'(GMT-0300) America/Belem'), (b'America/Campo_Grande', b'(GMT-0300) America/Campo_Grande'), (b'America/Cayenne', b'(GMT-0300) America/Cayenne'), (b'America/Cuiaba', b'(GMT-0300) America/Cuiaba'), (b'America/Fortaleza', b'(GMT-0300) America/Fortaleza'), (b'America/Godthab', b'(GMT-0300) America/Godthab'), (b'America/Maceio', b'(GMT-0300) America/Maceio'), (b'America/Miquelon', b'(GMT-0300) America/Miquelon'), (b'America/Paramaribo', b'(GMT-0300) America/Paramaribo'), (b'America/Recife', b'(GMT-0300) America/Recife'), (b'America/Santarem', b'(GMT-0300) America/Santarem'), (b'America/Santiago', b'(GMT-0300) America/Santiago'), (b'Antarctica/Palmer', b'(GMT-0300) Antarctica/Palmer'), (b'Antarctica/Rothera', b'(GMT-0300) Antarctica/Rothera'), (b'Atlantic/Stanley', b'(GMT-0300) Atlantic/Stanley'), (b'America/Montevideo', b'(GMT-0200) America/Montevideo'), (b'America/Noronha', b'(GMT-0200) America/Noronha'), (b'America/Sao_Paulo', b'(GMT-0200) America/Sao_Paulo'), (b'Atlantic/South_Georgia', b'(GMT-0200) Atlantic/South_Georgia'), (b'America/Scoresbysund', b'(GMT-0100) America/Scoresbysund'), (b'Atlantic/Azores', b'(GMT-0100) Atlantic/Azores'), (b'Atlantic/Cape_Verde', b'(GMT-0100) Atlantic/Cape_Verde'), (b'Africa/Abidjan', b'(GMT+0000) Africa/Abidjan'), (b'Africa/Accra', b'(GMT+0000) Africa/Accra'), (b'Africa/Bamako', b'(GMT+0000) Africa/Bamako'), (b'Africa/Banjul', b'(GMT+0000) Africa/Banjul'), (b'Africa/Bissau', b'(GMT+0000) Africa/Bissau'), (b'Africa/Casablanca', b'(GMT+0000) Africa/Casablanca'), (b'Africa/Conakry', b'(GMT+0000) Africa/Conakry'), (b'Africa/Dakar', b'(GMT+0000) Africa/Dakar'), (b'Africa/El_Aaiun', b'(GMT+0000) Africa/El_Aaiun'), (b'Africa/Freetown', b'(GMT+0000) Africa/Freetown'), (b'Africa/Lome', b'(GMT+0000) Africa/Lome'), (b'Africa/Monrovia', b'(GMT+0000) Africa/Monrovia'), (b'Africa/Nouakchott', b'(GMT+0000) Africa/Nouakchott'), (b'Africa/Ouagadougou', b'(GMT+0000) Africa/Ouagadougou'), (b'Africa/Sao_Tome', b'(GMT+0000) Africa/Sao_Tome'), (b'America/Danmarkshavn', b'(GMT+0000) America/Danmarkshavn'), (b'Atlantic/Canary', b'(GMT+0000) Atlantic/Canary'), (b'Atlantic/Faroe', b'(GMT+0000) Atlantic/Faroe'), (b'Atlantic/Madeira', b'(GMT+0000) Atlantic/Madeira'), (b'Atlantic/Reykjavik', b'(GMT+0000) Atlantic/Reykjavik'), (b'Atlantic/St_Helena', b'(GMT+0000) Atlantic/St_Helena'), (b'Europe/Dublin', b'(GMT+0000) Europe/Dublin'), (b'Europe/Guernsey', b'(GMT+0000) Europe/Guernsey'), (b'Europe/Isle_of_Man', b'(GMT+0000) Europe/Isle_of_Man'), (b'Europe/Jersey', b'(GMT+0000) Europe/Jersey'), (b'Europe/Lisbon', b'(GMT+0000) Europe/Lisbon'), (b'Europe/London', b'(GMT+0000) Europe/London'), (b'GMT', b'(GMT+0000) GMT'), (b'UTC', b'(GMT+0000) UTC'), (b'Africa/Algiers', b'(GMT+0100) Africa/Algiers'), (b'Africa/Bangui', b'(GMT+0100) Africa/Bangui'), (b'Africa/Brazzaville', b'(GMT+0100) Africa/Brazzaville'), (b'Africa/Ceuta', b'(GMT+0100) Africa/Ceuta'), (b'Africa/Douala', b'(GMT+0100) Africa/Douala'), (b'Africa/Kinshasa', b'(GMT+0100) Africa/Kinshasa'), (b'Africa/Lagos', b'(GMT+0100) Africa/Lagos'), (b'Africa/Libreville', b'(GMT+0100) Africa/Libreville'), (b'Africa/Luanda', b'(GMT+0100) Africa/Luanda'), (b'Africa/Malabo', b'(GMT+0100) Africa/Malabo'), (b'Africa/Ndjamena', b'(GMT+0100) Africa/Ndjamena'), (b'Africa/Niamey', b'(GMT+0100) Africa/Niamey'), (b'Africa/Porto-Novo', b'(GMT+0100) Africa/Porto-Novo'), (b'Africa/Tunis', b'(GMT+0100) Africa/Tunis'), (b'Arctic/Longyearbyen', b'(GMT+0100) Arctic/Longyearbyen'), (b'Europe/Amsterdam', b'(GMT+0100) Europe/Amsterdam'), (b'Europe/Andorra', b'(GMT+0100) Europe/Andorra'), (b'Europe/Belgrade', b'(GMT+0100) Europe/Belgrade'), (b'Europe/Berlin', b'(GMT+0100) Europe/Berlin'), (b'Europe/Bratislava', b'(GMT+0100) Europe/Bratislava'), (b'Europe/Brussels', b'(GMT+0100) Europe/Brussels'), (b'Europe/Budapest', b'(GMT+0100) Europe/Budapest'), (b'Europe/Copenhagen', b'(GMT+0100) Europe/Copenhagen'), (b'Europe/Gibraltar', b'(GMT+0100) Europe/Gibraltar'), (b'Europe/Ljubljana', b'(GMT+0100) Europe/Ljubljana'), (b'Europe/Luxembourg', b'(GMT+0100) Europe/Luxembourg'), (b'Europe/Madrid', b'(GMT+0100) Europe/Madrid'), (b'Europe/Malta', b'(GMT+0100) Europe/Malta'), (b'Europe/Monaco', b'(GMT+0100) Europe/Monaco'), (b'Europe/Oslo', b'(GMT+0100) Europe/Oslo'), (b'Europe/Paris', b'(GMT+0100) Europe/Paris'), (b'Europe/Podgorica', b'(GMT+0100) Europe/Podgorica'), (b'Europe/Prague', b'(GMT+0100) Europe/Prague'), (b'Europe/Rome', b'(GMT+0100) Europe/Rome'), (b'Europe/San_Marino', b'(GMT+0100) Europe/San_Marino'), (b'Europe/Sarajevo', b'(GMT+0100) Europe/Sarajevo'), (b'Europe/Skopje', b'(GMT+0100) Europe/Skopje'), (b'Europe/Stockholm', b'(GMT+0100) Europe/Stockholm'), (b'Europe/Tirane', b'(GMT+0100) Europe/Tirane'), (b'Europe/Vaduz', b'(GMT+0100) Europe/Vaduz'), (b'Europe/Vatican', b'(GMT+0100) Europe/Vatican'), (b'Europe/Vienna', b'(GMT+0100) Europe/Vienna'), (b'Europe/Warsaw', b'(GMT+0100) Europe/Warsaw'), (b'Europe/Zagreb', b'(GMT+0100) Europe/Zagreb'), (b'Europe/Zurich', b'(GMT+0100) Europe/Zurich'), (b'Africa/Blantyre', b'(GMT+0200) Africa/Blantyre'), (b'Africa/Bujumbura', b'(GMT+0200) Africa/Bujumbura'), (b'Africa/Cairo', b'(GMT+0200) Africa/Cairo'), (b'Africa/Gaborone', b'(GMT+0200) Africa/Gaborone'), (b'Africa/Harare', b'(GMT+0200) Africa/Harare'), (b'Africa/Johannesburg', b'(GMT+0200) Africa/Johannesburg'), (b'Africa/Kigali', b'(GMT+0200) Africa/Kigali'), (b'Africa/Lubumbashi', b'(GMT+0200) Africa/Lubumbashi'), (b'Africa/Lusaka', b'(GMT+0200) Africa/Lusaka'), (b'Africa/Maputo', b'(GMT+0200) Africa/Maputo'), (b'Africa/Maseru', b'(GMT+0200) Africa/Maseru'), (b'Africa/Mbabane', b'(GMT+0200) Africa/Mbabane'), (b'Africa/Tripoli', b'(GMT+0200) Africa/Tripoli'), (b'Africa/Windhoek', b'(GMT+0200) Africa/Windhoek'), (b'Asia/Amman', b'(GMT+0200) Asia/Amman'), (b'Asia/Beirut', b'(GMT+0200) Asia/Beirut'), (b'Asia/Damascus', b'(GMT+0200) Asia/Damascus'), (b'Asia/Gaza', b'(GMT+0200) Asia/Gaza'), (b'Asia/Hebron', b'(GMT+0200) Asia/Hebron'), (b'Asia/Jerusalem', b'(GMT+0200) Asia/Jerusalem'), (b'Asia/Nicosia', b'(GMT+0200) Asia/Nicosia'), (b'Europe/Athens', b'(GMT+0200) Europe/Athens'), (b'Europe/Bucharest', b'(GMT+0200) Europe/Bucharest'), (b'Europe/Chisinau', b'(GMT+0200) Europe/Chisinau'), (b'Europe/Helsinki', b'(GMT+0200) Europe/Helsinki'), (b'Europe/Istanbul', b'(GMT+0200) Europe/Istanbul'), (b'Europe/Kiev', b'(GMT+0200) Europe/Kiev'), (b'Europe/Mariehamn', b'(GMT+0200) Europe/Mariehamn'), (b'Europe/Riga', b'(GMT+0200) Europe/Riga'), (b'Europe/Sofia', b'(GMT+0200) Europe/Sofia'), (b'Europe/Tallinn', b'(GMT+0200) Europe/Tallinn'), (b'Europe/Uzhgorod', b'(GMT+0200) Europe/Uzhgorod'), (b'Europe/Vilnius', b'(GMT+0200) Europe/Vilnius'), (b'Europe/Zaporozhye', b'(GMT+0200) Europe/Zaporozhye'), (b'Africa/Addis_Ababa', b'(GMT+0300) Africa/Addis_Ababa'), (b'Africa/Asmara', b'(GMT+0300) Africa/Asmara'), (b'Africa/Dar_es_Salaam', b'(GMT+0300) Africa/Dar_es_Salaam'), (b'Africa/Djibouti', b'(GMT+0300) Africa/Djibouti'), (b'Africa/Juba', b'(GMT+0300) Africa/Juba'), (b'Africa/Kampala', b'(GMT+0300) Africa/Kampala'), (b'Africa/Khartoum', b'(GMT+0300) Africa/Khartoum'), (b'Africa/Mogadishu', b'(GMT+0300) Africa/Mogadishu'), (b'Africa/Nairobi', b'(GMT+0300) Africa/Nairobi'), (b'Antarctica/Syowa', b'(GMT+0300) Antarctica/Syowa'), (b'Asia/Aden', b'(GMT+0300) Asia/Aden'), (b'Asia/Baghdad', b'(GMT+0300) Asia/Baghdad'), (b'Asia/Bahrain', b'(GMT+0300) Asia/Bahrain'), (b'Asia/Kuwait', b'(GMT+0300) Asia/Kuwait'), (b'Asia/Qatar', b'(GMT+0300) Asia/Qatar'), (b'Asia/Riyadh', b'(GMT+0300) Asia/Riyadh'), (b'Europe/Kaliningrad', b'(GMT+0300) Europe/Kaliningrad'), (b'Europe/Minsk', b'(GMT+0300) Europe/Minsk'), (b'Indian/Antananarivo', b'(GMT+0300) Indian/Antananarivo'), (b'Indian/Comoro', b'(GMT+0300) Indian/Comoro'), (b'Indian/Mayotte', b'(GMT+0300) Indian/Mayotte'), (b'Asia/Tehran', b'(GMT+0330) Asia/Tehran'), (b'Asia/Baku', b'(GMT+0400) Asia/Baku'), (b'Asia/Dubai', b'(GMT+0400) Asia/Dubai'), (b'Asia/Muscat', b'(GMT+0400) Asia/Muscat'), (b'Asia/Tbilisi', b'(GMT+0400) Asia/Tbilisi'), (b'Asia/Yerevan', b'(GMT+0400) Asia/Yerevan'), (b'Europe/Moscow', b'(GMT+0400) Europe/Moscow'), (b'Europe/Samara', b'(GMT+0400) Europe/Samara'), (b'Europe/Simferopol', b'(GMT+0400) Europe/Simferopol'), (b'Europe/Volgograd', b'(GMT+0400) Europe/Volgograd'), (b'Indian/Mahe', b'(GMT+0400) Indian/Mahe'), (b'Indian/Mauritius', b'(GMT+0400) Indian/Mauritius'), (b'Indian/Reunion', b'(GMT+0400) Indian/Reunion'), (b'Asia/Kabul', b'(GMT+0430) Asia/Kabul'), (b'Antarctica/Mawson', b'(GMT+0500) Antarctica/Mawson'), (b'Asia/Aqtau', b'(GMT+0500) Asia/Aqtau'), (b'Asia/Aqtobe', b'(GMT+0500) Asia/Aqtobe'), (b'Asia/Ashgabat', b'(GMT+0500) Asia/Ashgabat'), (b'Asia/Dushanbe', b'(GMT+0500) Asia/Dushanbe'), (b'Asia/Karachi', b'(GMT+0500) Asia/Karachi'), (b'Asia/Oral', b'(GMT+0500) Asia/Oral'), (b'Asia/Samarkand', b'(GMT+0500) Asia/Samarkand'), (b'Asia/Tashkent', b'(GMT+0500) Asia/Tashkent'), (b'Indian/Kerguelen', b'(GMT+0500) Indian/Kerguelen'), (b'Indian/Maldives', b'(GMT+0500) Indian/Maldives'), (b'Asia/Colombo', b'(GMT+0530) Asia/Colombo'), (b'Asia/Kolkata', b'(GMT+0530) Asia/Kolkata'), (b'Asia/Kathmandu', b'(GMT+0545) Asia/Kathmandu'), (b'Antarctica/Vostok', b'(GMT+0600) Antarctica/Vostok'), (b'Asia/Almaty', b'(GMT+0600) Asia/Almaty'), (b'Asia/Bishkek', b'(GMT+0600) Asia/Bishkek'), (b'Asia/Dhaka', b'(GMT+0600) Asia/Dhaka'), (b'Asia/Qyzylorda', b'(GMT+0600) Asia/Qyzylorda'), (b'Asia/Thimphu', b'(GMT+0600) Asia/Thimphu'), (b'Asia/Yekaterinburg', b'(GMT+0600) Asia/Yekaterinburg'), (b'Indian/Chagos', b'(GMT+0600) Indian/Chagos'), (b'Asia/Rangoon', b'(GMT+0630) Asia/Rangoon'), (b'Indian/Cocos', b'(GMT+0630) Indian/Cocos'), (b'Antarctica/Davis', b'(GMT+0700) Antarctica/Davis'), (b'Asia/Bangkok', b'(GMT+0700) Asia/Bangkok'), (b'Asia/Ho_Chi_Minh', b'(GMT+0700) Asia/Ho_Chi_Minh'), (b'Asia/Hovd', b'(GMT+0700) Asia/Hovd'), (b'Asia/Jakarta', b'(GMT+0700) Asia/Jakarta'), (b'Asia/Novokuznetsk', b'(GMT+0700) Asia/Novokuznetsk'), (b'Asia/Novosibirsk', b'(GMT+0700) Asia/Novosibirsk'), (b'Asia/Omsk', b'(GMT+0700) Asia/Omsk'), (b'Asia/Phnom_Penh', b'(GMT+0700) Asia/Phnom_Penh'), (b'Asia/Pontianak', b'(GMT+0700) Asia/Pontianak'), (b'Asia/Vientiane', b'(GMT+0700) Asia/Vientiane'), (b'Indian/Christmas', b'(GMT+0700) Indian/Christmas'), (b'Antarctica/Casey', b'(GMT+0800) Antarctica/Casey'), (b'Asia/Brunei', b'(GMT+0800) Asia/Brunei'), (b'Asia/Choibalsan', b'(GMT+0800) Asia/Choibalsan'), (b'Asia/Chongqing', b'(GMT+0800) Asia/Chongqing'), (b'Asia/Harbin', b'(GMT+0800) Asia/Harbin'), (b'Asia/Hong_Kong', b'(GMT+0800) Asia/Hong_Kong'), (b'Asia/Kashgar', b'(GMT+0800) Asia/Kashgar'), (b'Asia/Krasnoyarsk', b'(GMT+0800) Asia/Krasnoyarsk'), (b'Asia/Kuala_Lumpur', b'(GMT+0800) Asia/Kuala_Lumpur'), (b'Asia/Kuching', b'(GMT+0800) Asia/Kuching'), (b'Asia/Macau', b'(GMT+0800) Asia/Macau'), (b'Asia/Makassar', b'(GMT+0800) Asia/Makassar'), (b'Asia/Manila', b'(GMT+0800) Asia/Manila'), (b'Asia/Shanghai', b'(GMT+0800) Asia/Shanghai'), (b'Asia/Singapore', b'(GMT+0800) Asia/Singapore'), (b'Asia/Taipei', b'(GMT+0800) Asia/Taipei'), (b'Asia/Ulaanbaatar', b'(GMT+0800) Asia/Ulaanbaatar'), (b'Asia/Urumqi', b'(GMT+0800) Asia/Urumqi'), (b'Australia/Perth', b'(GMT+0800) Australia/Perth'), (b'Australia/Eucla', b'(GMT+0845) Australia/Eucla'), (b'Asia/Dili', b'(GMT+0900) Asia/Dili'), (b'Asia/Irkutsk', b'(GMT+0900) Asia/Irkutsk'), (b'Asia/Jayapura', b'(GMT+0900) Asia/Jayapura'), (b'Asia/Pyongyang', b'(GMT+0900) Asia/Pyongyang'), (b'Asia/Seoul', b'(GMT+0900) Asia/Seoul'), (b'Asia/Tokyo', b'(GMT+0900) Asia/Tokyo'), (b'Pacific/Palau', b'(GMT+0900) Pacific/Palau'), (b'Australia/Darwin', b'(GMT+0930) Australia/Darwin'), (b'Antarctica/DumontDUrville', b'(GMT+1000) Antarctica/DumontDUrville'), (b'Asia/Yakutsk', b'(GMT+1000) Asia/Yakutsk'), (b'Australia/Brisbane', b'(GMT+1000) Australia/Brisbane'), (b'Australia/Lindeman', b'(GMT+1000) Australia/Lindeman'), (b'Pacific/Chuuk', b'(GMT+1000) Pacific/Chuuk'), (b'Pacific/Guam', b'(GMT+1000) Pacific/Guam'), (b'Pacific/Port_Moresby', b'(GMT+1000) Pacific/Port_Moresby'), (b'Pacific/Saipan', b'(GMT+1000) Pacific/Saipan'), (b'Australia/Adelaide', b'(GMT+1030) Australia/Adelaide'), (b'Australia/Broken_Hill', b'(GMT+1030) Australia/Broken_Hill'), (b'Antarctica/Macquarie', b'(GMT+1100) Antarctica/Macquarie'), (b'Asia/Sakhalin', b'(GMT+1100) Asia/Sakhalin'), (b'Asia/Vladivostok', b'(GMT+1100) Asia/Vladivostok'), (b'Australia/Currie', b'(GMT+1100) Australia/Currie'), (b'Australia/Hobart', b'(GMT+1100) Australia/Hobart'), (b'Australia/Lord_Howe', b'(GMT+1100) Australia/Lord_Howe'), (b'Australia/Melbourne', b'(GMT+1100) Australia/Melbourne'), (b'Australia/Sydney', b'(GMT+1100) Australia/Sydney'), (b'Pacific/Efate', b'(GMT+1100) Pacific/Efate'), (b'Pacific/Guadalcanal', b'(GMT+1100) Pacific/Guadalcanal'), (b'Pacific/Kosrae', b'(GMT+1100) Pacific/Kosrae'), (b'Pacific/Noumea', b'(GMT+1100) Pacific/Noumea'), (b'Pacific/Pohnpei', b'(GMT+1100) Pacific/Pohnpei'), (b'Pacific/Norfolk', b'(GMT+1130) Pacific/Norfolk'), (b'Asia/Anadyr', b'(GMT+1200) Asia/Anadyr'), (b'Asia/Kamchatka', b'(GMT+1200) Asia/Kamchatka'), (b'Asia/Magadan', b'(GMT+1200) Asia/Magadan'), (b'Pacific/Fiji', b'(GMT+1200) Pacific/Fiji'), (b'Pacific/Funafuti', b'(GMT+1200) Pacific/Funafuti'), (b'Pacific/Kwajalein', b'(GMT+1200) Pacific/Kwajalein'), (b'Pacific/Majuro', b'(GMT+1200) Pacific/Majuro'), (b'Pacific/Nauru', b'(GMT+1200) Pacific/Nauru'), (b'Pacific/Tarawa', b'(GMT+1200) Pacific/Tarawa'), (b'Pacific/Wake', b'(GMT+1200) Pacific/Wake'), (b'Pacific/Wallis', b'(GMT+1200) Pacific/Wallis'), (b'Antarctica/McMurdo', b'(GMT+1300) Antarctica/McMurdo'), (b'Antarctica/South_Pole', b'(GMT+1300) Antarctica/South_Pole'), (b'Pacific/Auckland', b'(GMT+1300) Pacific/Auckland'), (b'Pacific/Enderbury', b'(GMT+1300) Pacific/Enderbury'), (b'Pacific/Fakaofo', b'(GMT+1300) Pacific/Fakaofo'), (b'Pacific/Tongatapu', b'(GMT+1300) Pacific/Tongatapu'), (b'Pacific/Chatham', b'(GMT+1345) Pacific/Chatham'), (b'Pacific/Apia', b'(GMT+1400) Pacific/Apia'), (b'Pacific/Kiritimati', b'(GMT+1400) Pacific/Kiritimati')])),
+ ('timezone', timezones.fields.TimeZoneField(default=b'America/New_York', max_length=100, choices=[(b'Pacific/Midway', b'(GMT-1100) Pacific/Midway'), (b'Pacific/Niue', b'(GMT-1100) Pacific/Niue'), (b'Pacific/Pago_Pago', b'(GMT-1100) Pacific/Pago_Pago'), (b'America/Adak', b'(GMT-1000) America/Adak'), (b'Pacific/Honolulu', b'(GMT-1000) Pacific/Honolulu'), (b'Pacific/Johnston', b'(GMT-1000) Pacific/Johnston'), (b'Pacific/Rarotonga', b'(GMT-1000) Pacific/Rarotonga'), (b'Pacific/Tahiti', b'(GMT-1000) Pacific/Tahiti'), (b'US/Hawaii', b'(GMT-1000) US/Hawaii'), (b'Pacific/Marquesas', b'(GMT-0930) Pacific/Marquesas'), (b'America/Anchorage', b'(GMT-0900) America/Anchorage'), (b'America/Juneau', b'(GMT-0900) America/Juneau'), (b'America/Nome', b'(GMT-0900) America/Nome'), (b'America/Sitka', b'(GMT-0900) America/Sitka'), (b'America/Yakutat', b'(GMT-0900) America/Yakutat'), (b'Pacific/Gambier', b'(GMT-0900) Pacific/Gambier'), (b'US/Alaska', b'(GMT-0900) US/Alaska'), (b'America/Dawson', b'(GMT-0800) America/Dawson'), (b'America/Los_Angeles', b'(GMT-0800) America/Los_Angeles'), (b'America/Metlakatla', b'(GMT-0800) America/Metlakatla'), (b'America/Santa_Isabel', b'(GMT-0800) America/Santa_Isabel'), (b'America/Tijuana', b'(GMT-0800) America/Tijuana'), (b'America/Vancouver', b'(GMT-0800) America/Vancouver'), (b'America/Whitehorse', b'(GMT-0800) America/Whitehorse'), (b'Canada/Pacific', b'(GMT-0800) Canada/Pacific'), (b'Pacific/Pitcairn', b'(GMT-0800) Pacific/Pitcairn'), (b'US/Pacific', b'(GMT-0800) US/Pacific'), (b'America/Boise', b'(GMT-0700) America/Boise'), (b'America/Cambridge_Bay', b'(GMT-0700) America/Cambridge_Bay'), (b'America/Chihuahua', b'(GMT-0700) America/Chihuahua'), (b'America/Creston', b'(GMT-0700) America/Creston'), (b'America/Dawson_Creek', b'(GMT-0700) America/Dawson_Creek'), (b'America/Denver', b'(GMT-0700) America/Denver'), (b'America/Edmonton', b'(GMT-0700) America/Edmonton'), (b'America/Hermosillo', b'(GMT-0700) America/Hermosillo'), (b'America/Inuvik', b'(GMT-0700) America/Inuvik'), (b'America/Mazatlan', b'(GMT-0700) America/Mazatlan'), (b'America/Ojinaga', b'(GMT-0700) America/Ojinaga'), (b'America/Phoenix', b'(GMT-0700) America/Phoenix'), (b'America/Shiprock', b'(GMT-0700) America/Shiprock'), (b'America/Yellowknife', b'(GMT-0700) America/Yellowknife'), (b'Canada/Mountain', b'(GMT-0700) Canada/Mountain'), (b'US/Arizona', b'(GMT-0700) US/Arizona'), (b'US/Mountain', b'(GMT-0700) US/Mountain'), (b'America/Bahia_Banderas', b'(GMT-0600) America/Bahia_Banderas'), (b'America/Belize', b'(GMT-0600) America/Belize'), (b'America/Cancun', b'(GMT-0600) America/Cancun'), (b'America/Chicago', b'(GMT-0600) America/Chicago'), (b'America/Costa_Rica', b'(GMT-0600) America/Costa_Rica'), (b'America/El_Salvador', b'(GMT-0600) America/El_Salvador'), (b'America/Guatemala', b'(GMT-0600) America/Guatemala'), (b'America/Indiana/Knox', b'(GMT-0600) America/Indiana/Knox'), (b'America/Indiana/Tell_City', b'(GMT-0600) America/Indiana/Tell_City'), (b'America/Managua', b'(GMT-0600) America/Managua'), (b'America/Matamoros', b'(GMT-0600) America/Matamoros'), (b'America/Menominee', b'(GMT-0600) America/Menominee'), (b'America/Merida', b'(GMT-0600) America/Merida'), (b'America/Mexico_City', b'(GMT-0600) America/Mexico_City'), (b'America/Monterrey', b'(GMT-0600) America/Monterrey'), (b'America/North_Dakota/Beulah', b'(GMT-0600) America/North_Dakota/Beulah'), (b'America/North_Dakota/Center', b'(GMT-0600) America/North_Dakota/Center'), (b'America/North_Dakota/New_Salem', b'(GMT-0600) America/North_Dakota/New_Salem'), (b'America/Rainy_River', b'(GMT-0600) America/Rainy_River'), (b'America/Rankin_Inlet', b'(GMT-0600) America/Rankin_Inlet'), (b'America/Regina', b'(GMT-0600) America/Regina'), (b'America/Resolute', b'(GMT-0600) America/Resolute'), (b'America/Swift_Current', b'(GMT-0600) America/Swift_Current'), (b'America/Tegucigalpa', b'(GMT-0600) America/Tegucigalpa'), (b'America/Winnipeg', b'(GMT-0600) America/Winnipeg'), (b'Canada/Central', b'(GMT-0600) Canada/Central'), (b'Pacific/Galapagos', b'(GMT-0600) Pacific/Galapagos'), (b'US/Central', b'(GMT-0600) US/Central'), (b'America/Atikokan', b'(GMT-0500) America/Atikokan'), (b'America/Bogota', b'(GMT-0500) America/Bogota'), (b'America/Cayman', b'(GMT-0500) America/Cayman'), (b'America/Detroit', b'(GMT-0500) America/Detroit'), (b'America/Eirunepe', b'(GMT-0500) America/Eirunepe'), (b'America/Grand_Turk', b'(GMT-0500) America/Grand_Turk'), (b'America/Guayaquil', b'(GMT-0500) America/Guayaquil'), (b'America/Havana', b'(GMT-0500) America/Havana'), (b'America/Indiana/Indianapolis', b'(GMT-0500) America/Indiana/Indianapolis'), (b'America/Indiana/Marengo', b'(GMT-0500) America/Indiana/Marengo'), (b'America/Indiana/Petersburg', b'(GMT-0500) America/Indiana/Petersburg'), (b'America/Indiana/Vevay', b'(GMT-0500) America/Indiana/Vevay'), (b'America/Indiana/Vincennes', b'(GMT-0500) America/Indiana/Vincennes'), (b'America/Indiana/Winamac', b'(GMT-0500) America/Indiana/Winamac'), (b'America/Iqaluit', b'(GMT-0500) America/Iqaluit'), (b'America/Jamaica', b'(GMT-0500) America/Jamaica'), (b'America/Kentucky/Louisville', b'(GMT-0500) America/Kentucky/Louisville'), (b'America/Kentucky/Monticello', b'(GMT-0500) America/Kentucky/Monticello'), (b'America/Lima', b'(GMT-0500) America/Lima'), (b'America/Montreal', b'(GMT-0500) America/Montreal'), (b'America/Nassau', b'(GMT-0500) America/Nassau'), (b'America/New_York', b'(GMT-0500) America/New_York'), (b'America/Nipigon', b'(GMT-0500) America/Nipigon'), (b'America/Panama', b'(GMT-0500) America/Panama'), (b'America/Pangnirtung', b'(GMT-0500) America/Pangnirtung'), (b'America/Port-au-Prince', b'(GMT-0500) America/Port-au-Prince'), (b'America/Rio_Branco', b'(GMT-0500) America/Rio_Branco'), (b'America/Thunder_Bay', b'(GMT-0500) America/Thunder_Bay'), (b'America/Toronto', b'(GMT-0500) America/Toronto'), (b'Canada/Eastern', b'(GMT-0500) Canada/Eastern'), (b'Pacific/Easter', b'(GMT-0500) Pacific/Easter'), (b'US/Eastern', b'(GMT-0500) US/Eastern'), (b'America/Caracas', b'(GMT-0430) America/Caracas'), (b'America/Anguilla', b'(GMT-0400) America/Anguilla'), (b'America/Antigua', b'(GMT-0400) America/Antigua'), (b'America/Aruba', b'(GMT-0400) America/Aruba'), (b'America/Barbados', b'(GMT-0400) America/Barbados'), (b'America/Blanc-Sablon', b'(GMT-0400) America/Blanc-Sablon'), (b'America/Boa_Vista', b'(GMT-0400) America/Boa_Vista'), (b'America/Curacao', b'(GMT-0400) America/Curacao'), (b'America/Dominica', b'(GMT-0400) America/Dominica'), (b'America/Glace_Bay', b'(GMT-0400) America/Glace_Bay'), (b'America/Goose_Bay', b'(GMT-0400) America/Goose_Bay'), (b'America/Grenada', b'(GMT-0400) America/Grenada'), (b'America/Guadeloupe', b'(GMT-0400) America/Guadeloupe'), (b'America/Guyana', b'(GMT-0400) America/Guyana'), (b'America/Halifax', b'(GMT-0400) America/Halifax'), (b'America/Kralendijk', b'(GMT-0400) America/Kralendijk'), (b'America/La_Paz', b'(GMT-0400) America/La_Paz'), (b'America/Lower_Princes', b'(GMT-0400) America/Lower_Princes'), (b'America/Manaus', b'(GMT-0400) America/Manaus'), (b'America/Marigot', b'(GMT-0400) America/Marigot'), (b'America/Martinique', b'(GMT-0400) America/Martinique'), (b'America/Moncton', b'(GMT-0400) America/Moncton'), (b'America/Montserrat', b'(GMT-0400) America/Montserrat'), (b'America/Port_of_Spain', b'(GMT-0400) America/Port_of_Spain'), (b'America/Porto_Velho', b'(GMT-0400) America/Porto_Velho'), (b'America/Puerto_Rico', b'(GMT-0400) America/Puerto_Rico'), (b'America/Santo_Domingo', b'(GMT-0400) America/Santo_Domingo'), (b'America/St_Barthelemy', b'(GMT-0400) America/St_Barthelemy'), (b'America/St_Kitts', b'(GMT-0400) America/St_Kitts'), (b'America/St_Lucia', b'(GMT-0400) America/St_Lucia'), (b'America/St_Thomas', b'(GMT-0400) America/St_Thomas'), (b'America/St_Vincent', b'(GMT-0400) America/St_Vincent'), (b'America/Thule', b'(GMT-0400) America/Thule'), (b'America/Tortola', b'(GMT-0400) America/Tortola'), (b'Atlantic/Bermuda', b'(GMT-0400) Atlantic/Bermuda'), (b'Canada/Atlantic', b'(GMT-0400) Canada/Atlantic'), (b'America/St_Johns', b'(GMT-0330) America/St_Johns'), (b'Canada/Newfoundland', b'(GMT-0330) Canada/Newfoundland'), (b'America/Araguaina', b'(GMT-0300) America/Araguaina'), (b'America/Argentina/Buenos_Aires', b'(GMT-0300) America/Argentina/Buenos_Aires'), (b'America/Argentina/Catamarca', b'(GMT-0300) America/Argentina/Catamarca'), (b'America/Argentina/Cordoba', b'(GMT-0300) America/Argentina/Cordoba'), (b'America/Argentina/Jujuy', b'(GMT-0300) America/Argentina/Jujuy'), (b'America/Argentina/La_Rioja', b'(GMT-0300) America/Argentina/La_Rioja'), (b'America/Argentina/Mendoza', b'(GMT-0300) America/Argentina/Mendoza'), (b'America/Argentina/Rio_Gallegos', b'(GMT-0300) America/Argentina/Rio_Gallegos'), (b'America/Argentina/Salta', b'(GMT-0300) America/Argentina/Salta'), (b'America/Argentina/San_Juan', b'(GMT-0300) America/Argentina/San_Juan'), (b'America/Argentina/San_Luis', b'(GMT-0300) America/Argentina/San_Luis'), (b'America/Argentina/Tucuman', b'(GMT-0300) America/Argentina/Tucuman'), (b'America/Argentina/Ushuaia', b'(GMT-0300) America/Argentina/Ushuaia'), (b'America/Asuncion', b'(GMT-0300) America/Asuncion'), (b'America/Bahia', b'(GMT-0300) America/Bahia'), (b'America/Belem', b'(GMT-0300) America/Belem'), (b'America/Campo_Grande', b'(GMT-0300) America/Campo_Grande'), (b'America/Cayenne', b'(GMT-0300) America/Cayenne'), (b'America/Cuiaba', b'(GMT-0300) America/Cuiaba'), (b'America/Fortaleza', b'(GMT-0300) America/Fortaleza'), (b'America/Godthab', b'(GMT-0300) America/Godthab'), (b'America/Maceio', b'(GMT-0300) America/Maceio'), (b'America/Miquelon', b'(GMT-0300) America/Miquelon'), (b'America/Paramaribo', b'(GMT-0300) America/Paramaribo'), (b'America/Recife', b'(GMT-0300) America/Recife'), (b'America/Santarem', b'(GMT-0300) America/Santarem'), (b'America/Santiago', b'(GMT-0300) America/Santiago'), (b'Antarctica/Palmer', b'(GMT-0300) Antarctica/Palmer'), (b'Antarctica/Rothera', b'(GMT-0300) Antarctica/Rothera'), (b'Atlantic/Stanley', b'(GMT-0300) Atlantic/Stanley'), (b'America/Montevideo', b'(GMT-0200) America/Montevideo'), (b'America/Noronha', b'(GMT-0200) America/Noronha'), (b'America/Sao_Paulo', b'(GMT-0200) America/Sao_Paulo'), (b'Atlantic/South_Georgia', b'(GMT-0200) Atlantic/South_Georgia'), (b'America/Scoresbysund', b'(GMT-0100) America/Scoresbysund'), (b'Atlantic/Azores', b'(GMT-0100) Atlantic/Azores'), (b'Atlantic/Cape_Verde', b'(GMT-0100) Atlantic/Cape_Verde'), (b'Africa/Abidjan', b'(GMT+0000) Africa/Abidjan'), (b'Africa/Accra', b'(GMT+0000) Africa/Accra'), (b'Africa/Bamako', b'(GMT+0000) Africa/Bamako'), (b'Africa/Banjul', b'(GMT+0000) Africa/Banjul'), (b'Africa/Bissau', b'(GMT+0000) Africa/Bissau'), (b'Africa/Casablanca', b'(GMT+0000) Africa/Casablanca'), (b'Africa/Conakry', b'(GMT+0000) Africa/Conakry'), (b'Africa/Dakar', b'(GMT+0000) Africa/Dakar'), (b'Africa/El_Aaiun', b'(GMT+0000) Africa/El_Aaiun'), (b'Africa/Freetown', b'(GMT+0000) Africa/Freetown'), (b'Africa/Lome', b'(GMT+0000) Africa/Lome'), (b'Africa/Monrovia', b'(GMT+0000) Africa/Monrovia'), (b'Africa/Nouakchott', b'(GMT+0000) Africa/Nouakchott'), (b'Africa/Ouagadougou', b'(GMT+0000) Africa/Ouagadougou'), (b'Africa/Sao_Tome', b'(GMT+0000) Africa/Sao_Tome'), (b'America/Danmarkshavn', b'(GMT+0000) America/Danmarkshavn'), (b'Atlantic/Canary', b'(GMT+0000) Atlantic/Canary'), (b'Atlantic/Faroe', b'(GMT+0000) Atlantic/Faroe'), (b'Atlantic/Madeira', b'(GMT+0000) Atlantic/Madeira'), (b'Atlantic/Reykjavik', b'(GMT+0000) Atlantic/Reykjavik'), (b'Atlantic/St_Helena', b'(GMT+0000) Atlantic/St_Helena'), (b'Europe/Dublin', b'(GMT+0000) Europe/Dublin'), (b'Europe/Guernsey', b'(GMT+0000) Europe/Guernsey'), (
+ b'Europe/Isle_of_Man', b'(GMT+0000) Europe/Isle_of_Man'), (b'Europe/Jersey', b'(GMT+0000) Europe/Jersey'), (b'Europe/Lisbon', b'(GMT+0000) Europe/Lisbon'), (b'Europe/London', b'(GMT+0000) Europe/London'), (b'GMT', b'(GMT+0000) GMT'), (b'UTC', b'(GMT+0000) UTC'), (b'Africa/Algiers', b'(GMT+0100) Africa/Algiers'), (b'Africa/Bangui', b'(GMT+0100) Africa/Bangui'), (b'Africa/Brazzaville', b'(GMT+0100) Africa/Brazzaville'), (b'Africa/Ceuta', b'(GMT+0100) Africa/Ceuta'), (b'Africa/Douala', b'(GMT+0100) Africa/Douala'), (b'Africa/Kinshasa', b'(GMT+0100) Africa/Kinshasa'), (b'Africa/Lagos', b'(GMT+0100) Africa/Lagos'), (b'Africa/Libreville', b'(GMT+0100) Africa/Libreville'), (b'Africa/Luanda', b'(GMT+0100) Africa/Luanda'), (b'Africa/Malabo', b'(GMT+0100) Africa/Malabo'), (b'Africa/Ndjamena', b'(GMT+0100) Africa/Ndjamena'), (b'Africa/Niamey', b'(GMT+0100) Africa/Niamey'), (b'Africa/Porto-Novo', b'(GMT+0100) Africa/Porto-Novo'), (b'Africa/Tunis', b'(GMT+0100) Africa/Tunis'), (b'Arctic/Longyearbyen', b'(GMT+0100) Arctic/Longyearbyen'), (b'Europe/Amsterdam', b'(GMT+0100) Europe/Amsterdam'), (b'Europe/Andorra', b'(GMT+0100) Europe/Andorra'), (b'Europe/Belgrade', b'(GMT+0100) Europe/Belgrade'), (b'Europe/Berlin', b'(GMT+0100) Europe/Berlin'), (b'Europe/Bratislava', b'(GMT+0100) Europe/Bratislava'), (b'Europe/Brussels', b'(GMT+0100) Europe/Brussels'), (b'Europe/Budapest', b'(GMT+0100) Europe/Budapest'), (b'Europe/Copenhagen', b'(GMT+0100) Europe/Copenhagen'), (b'Europe/Gibraltar', b'(GMT+0100) Europe/Gibraltar'), (b'Europe/Ljubljana', b'(GMT+0100) Europe/Ljubljana'), (b'Europe/Luxembourg', b'(GMT+0100) Europe/Luxembourg'), (b'Europe/Madrid', b'(GMT+0100) Europe/Madrid'), (b'Europe/Malta', b'(GMT+0100) Europe/Malta'), (b'Europe/Monaco', b'(GMT+0100) Europe/Monaco'), (b'Europe/Oslo', b'(GMT+0100) Europe/Oslo'), (b'Europe/Paris', b'(GMT+0100) Europe/Paris'), (b'Europe/Podgorica', b'(GMT+0100) Europe/Podgorica'), (b'Europe/Prague', b'(GMT+0100) Europe/Prague'), (b'Europe/Rome', b'(GMT+0100) Europe/Rome'), (b'Europe/San_Marino', b'(GMT+0100) Europe/San_Marino'), (b'Europe/Sarajevo', b'(GMT+0100) Europe/Sarajevo'), (b'Europe/Skopje', b'(GMT+0100) Europe/Skopje'), (b'Europe/Stockholm', b'(GMT+0100) Europe/Stockholm'), (b'Europe/Tirane', b'(GMT+0100) Europe/Tirane'), (b'Europe/Vaduz', b'(GMT+0100) Europe/Vaduz'), (b'Europe/Vatican', b'(GMT+0100) Europe/Vatican'), (b'Europe/Vienna', b'(GMT+0100) Europe/Vienna'), (b'Europe/Warsaw', b'(GMT+0100) Europe/Warsaw'), (b'Europe/Zagreb', b'(GMT+0100) Europe/Zagreb'), (b'Europe/Zurich', b'(GMT+0100) Europe/Zurich'), (b'Africa/Blantyre', b'(GMT+0200) Africa/Blantyre'), (b'Africa/Bujumbura', b'(GMT+0200) Africa/Bujumbura'), (b'Africa/Cairo', b'(GMT+0200) Africa/Cairo'), (b'Africa/Gaborone', b'(GMT+0200) Africa/Gaborone'), (b'Africa/Harare', b'(GMT+0200) Africa/Harare'), (b'Africa/Johannesburg', b'(GMT+0200) Africa/Johannesburg'), (b'Africa/Kigali', b'(GMT+0200) Africa/Kigali'), (b'Africa/Lubumbashi', b'(GMT+0200) Africa/Lubumbashi'), (b'Africa/Lusaka', b'(GMT+0200) Africa/Lusaka'), (b'Africa/Maputo', b'(GMT+0200) Africa/Maputo'), (b'Africa/Maseru', b'(GMT+0200) Africa/Maseru'), (b'Africa/Mbabane', b'(GMT+0200) Africa/Mbabane'), (b'Africa/Tripoli', b'(GMT+0200) Africa/Tripoli'), (b'Africa/Windhoek', b'(GMT+0200) Africa/Windhoek'), (b'Asia/Amman', b'(GMT+0200) Asia/Amman'), (b'Asia/Beirut', b'(GMT+0200) Asia/Beirut'), (b'Asia/Damascus', b'(GMT+0200) Asia/Damascus'), (b'Asia/Gaza', b'(GMT+0200) Asia/Gaza'), (b'Asia/Hebron', b'(GMT+0200) Asia/Hebron'), (b'Asia/Jerusalem', b'(GMT+0200) Asia/Jerusalem'), (b'Asia/Nicosia', b'(GMT+0200) Asia/Nicosia'), (b'Europe/Athens', b'(GMT+0200) Europe/Athens'), (b'Europe/Bucharest', b'(GMT+0200) Europe/Bucharest'), (b'Europe/Chisinau', b'(GMT+0200) Europe/Chisinau'), (b'Europe/Helsinki', b'(GMT+0200) Europe/Helsinki'), (b'Europe/Istanbul', b'(GMT+0200) Europe/Istanbul'), (b'Europe/Kiev', b'(GMT+0200) Europe/Kiev'), (b'Europe/Mariehamn', b'(GMT+0200) Europe/Mariehamn'), (b'Europe/Riga', b'(GMT+0200) Europe/Riga'), (b'Europe/Sofia', b'(GMT+0200) Europe/Sofia'), (b'Europe/Tallinn', b'(GMT+0200) Europe/Tallinn'), (b'Europe/Uzhgorod', b'(GMT+0200) Europe/Uzhgorod'), (b'Europe/Vilnius', b'(GMT+0200) Europe/Vilnius'), (b'Europe/Zaporozhye', b'(GMT+0200) Europe/Zaporozhye'), (b'Africa/Addis_Ababa', b'(GMT+0300) Africa/Addis_Ababa'), (b'Africa/Asmara', b'(GMT+0300) Africa/Asmara'), (b'Africa/Dar_es_Salaam', b'(GMT+0300) Africa/Dar_es_Salaam'), (b'Africa/Djibouti', b'(GMT+0300) Africa/Djibouti'), (b'Africa/Juba', b'(GMT+0300) Africa/Juba'), (b'Africa/Kampala', b'(GMT+0300) Africa/Kampala'), (b'Africa/Khartoum', b'(GMT+0300) Africa/Khartoum'), (b'Africa/Mogadishu', b'(GMT+0300) Africa/Mogadishu'), (b'Africa/Nairobi', b'(GMT+0300) Africa/Nairobi'), (b'Antarctica/Syowa', b'(GMT+0300) Antarctica/Syowa'), (b'Asia/Aden', b'(GMT+0300) Asia/Aden'), (b'Asia/Baghdad', b'(GMT+0300) Asia/Baghdad'), (b'Asia/Bahrain', b'(GMT+0300) Asia/Bahrain'), (b'Asia/Kuwait', b'(GMT+0300) Asia/Kuwait'), (b'Asia/Qatar', b'(GMT+0300) Asia/Qatar'), (b'Asia/Riyadh', b'(GMT+0300) Asia/Riyadh'), (b'Europe/Kaliningrad', b'(GMT+0300) Europe/Kaliningrad'), (b'Europe/Minsk', b'(GMT+0300) Europe/Minsk'), (b'Indian/Antananarivo', b'(GMT+0300) Indian/Antananarivo'), (b'Indian/Comoro', b'(GMT+0300) Indian/Comoro'), (b'Indian/Mayotte', b'(GMT+0300) Indian/Mayotte'), (b'Asia/Tehran', b'(GMT+0330) Asia/Tehran'), (b'Asia/Baku', b'(GMT+0400) Asia/Baku'), (b'Asia/Dubai', b'(GMT+0400) Asia/Dubai'), (b'Asia/Muscat', b'(GMT+0400) Asia/Muscat'), (b'Asia/Tbilisi', b'(GMT+0400) Asia/Tbilisi'), (b'Asia/Yerevan', b'(GMT+0400) Asia/Yerevan'), (b'Europe/Moscow', b'(GMT+0400) Europe/Moscow'), (b'Europe/Samara', b'(GMT+0400) Europe/Samara'), (b'Europe/Simferopol', b'(GMT+0400) Europe/Simferopol'), (b'Europe/Volgograd', b'(GMT+0400) Europe/Volgograd'), (b'Indian/Mahe', b'(GMT+0400) Indian/Mahe'), (b'Indian/Mauritius', b'(GMT+0400) Indian/Mauritius'), (b'Indian/Reunion', b'(GMT+0400) Indian/Reunion'), (b'Asia/Kabul', b'(GMT+0430) Asia/Kabul'), (b'Antarctica/Mawson', b'(GMT+0500) Antarctica/Mawson'), (b'Asia/Aqtau', b'(GMT+0500) Asia/Aqtau'), (b'Asia/Aqtobe', b'(GMT+0500) Asia/Aqtobe'), (b'Asia/Ashgabat', b'(GMT+0500) Asia/Ashgabat'), (b'Asia/Dushanbe', b'(GMT+0500) Asia/Dushanbe'), (b'Asia/Karachi', b'(GMT+0500) Asia/Karachi'), (b'Asia/Oral', b'(GMT+0500) Asia/Oral'), (b'Asia/Samarkand', b'(GMT+0500) Asia/Samarkand'), (b'Asia/Tashkent', b'(GMT+0500) Asia/Tashkent'), (b'Indian/Kerguelen', b'(GMT+0500) Indian/Kerguelen'), (b'Indian/Maldives', b'(GMT+0500) Indian/Maldives'), (b'Asia/Colombo', b'(GMT+0530) Asia/Colombo'), (b'Asia/Kolkata', b'(GMT+0530) Asia/Kolkata'), (b'Asia/Kathmandu', b'(GMT+0545) Asia/Kathmandu'), (b'Antarctica/Vostok', b'(GMT+0600) Antarctica/Vostok'), (b'Asia/Almaty', b'(GMT+0600) Asia/Almaty'), (b'Asia/Bishkek', b'(GMT+0600) Asia/Bishkek'), (b'Asia/Dhaka', b'(GMT+0600) Asia/Dhaka'), (b'Asia/Qyzylorda', b'(GMT+0600) Asia/Qyzylorda'), (b'Asia/Thimphu', b'(GMT+0600) Asia/Thimphu'), (b'Asia/Yekaterinburg', b'(GMT+0600) Asia/Yekaterinburg'), (b'Indian/Chagos', b'(GMT+0600) Indian/Chagos'), (b'Asia/Rangoon', b'(GMT+0630) Asia/Rangoon'), (b'Indian/Cocos', b'(GMT+0630) Indian/Cocos'), (b'Antarctica/Davis', b'(GMT+0700) Antarctica/Davis'), (b'Asia/Bangkok', b'(GMT+0700) Asia/Bangkok'), (b'Asia/Ho_Chi_Minh', b'(GMT+0700) Asia/Ho_Chi_Minh'), (b'Asia/Hovd', b'(GMT+0700) Asia/Hovd'), (b'Asia/Jakarta', b'(GMT+0700) Asia/Jakarta'), (b'Asia/Novokuznetsk', b'(GMT+0700) Asia/Novokuznetsk'), (b'Asia/Novosibirsk', b'(GMT+0700) Asia/Novosibirsk'), (b'Asia/Omsk', b'(GMT+0700) Asia/Omsk'), (b'Asia/Phnom_Penh', b'(GMT+0700) Asia/Phnom_Penh'), (b'Asia/Pontianak', b'(GMT+0700) Asia/Pontianak'), (b'Asia/Vientiane', b'(GMT+0700) Asia/Vientiane'), (b'Indian/Christmas', b'(GMT+0700) Indian/Christmas'), (b'Antarctica/Casey', b'(GMT+0800) Antarctica/Casey'), (b'Asia/Brunei', b'(GMT+0800) Asia/Brunei'), (b'Asia/Choibalsan', b'(GMT+0800) Asia/Choibalsan'), (b'Asia/Chongqing', b'(GMT+0800) Asia/Chongqing'), (b'Asia/Harbin', b'(GMT+0800) Asia/Harbin'), (b'Asia/Hong_Kong', b'(GMT+0800) Asia/Hong_Kong'), (b'Asia/Kashgar', b'(GMT+0800) Asia/Kashgar'), (b'Asia/Krasnoyarsk', b'(GMT+0800) Asia/Krasnoyarsk'), (b'Asia/Kuala_Lumpur', b'(GMT+0800) Asia/Kuala_Lumpur'), (b'Asia/Kuching', b'(GMT+0800) Asia/Kuching'), (b'Asia/Macau', b'(GMT+0800) Asia/Macau'), (b'Asia/Makassar', b'(GMT+0800) Asia/Makassar'), (b'Asia/Manila', b'(GMT+0800) Asia/Manila'), (b'Asia/Shanghai', b'(GMT+0800) Asia/Shanghai'), (b'Asia/Singapore', b'(GMT+0800) Asia/Singapore'), (b'Asia/Taipei', b'(GMT+0800) Asia/Taipei'), (b'Asia/Ulaanbaatar', b'(GMT+0800) Asia/Ulaanbaatar'), (b'Asia/Urumqi', b'(GMT+0800) Asia/Urumqi'), (b'Australia/Perth', b'(GMT+0800) Australia/Perth'), (b'Australia/Eucla', b'(GMT+0845) Australia/Eucla'), (b'Asia/Dili', b'(GMT+0900) Asia/Dili'), (b'Asia/Irkutsk', b'(GMT+0900) Asia/Irkutsk'), (b'Asia/Jayapura', b'(GMT+0900) Asia/Jayapura'), (b'Asia/Pyongyang', b'(GMT+0900) Asia/Pyongyang'), (b'Asia/Seoul', b'(GMT+0900) Asia/Seoul'), (b'Asia/Tokyo', b'(GMT+0900) Asia/Tokyo'), (b'Pacific/Palau', b'(GMT+0900) Pacific/Palau'), (b'Australia/Darwin', b'(GMT+0930) Australia/Darwin'), (b'Antarctica/DumontDUrville', b'(GMT+1000) Antarctica/DumontDUrville'), (b'Asia/Yakutsk', b'(GMT+1000) Asia/Yakutsk'), (b'Australia/Brisbane', b'(GMT+1000) Australia/Brisbane'), (b'Australia/Lindeman', b'(GMT+1000) Australia/Lindeman'), (b'Pacific/Chuuk', b'(GMT+1000) Pacific/Chuuk'), (b'Pacific/Guam', b'(GMT+1000) Pacific/Guam'), (b'Pacific/Port_Moresby', b'(GMT+1000) Pacific/Port_Moresby'), (b'Pacific/Saipan', b'(GMT+1000) Pacific/Saipan'), (b'Australia/Adelaide', b'(GMT+1030) Australia/Adelaide'), (b'Australia/Broken_Hill', b'(GMT+1030) Australia/Broken_Hill'), (b'Antarctica/Macquarie', b'(GMT+1100) Antarctica/Macquarie'), (b'Asia/Sakhalin', b'(GMT+1100) Asia/Sakhalin'), (b'Asia/Vladivostok', b'(GMT+1100) Asia/Vladivostok'), (b'Australia/Currie', b'(GMT+1100) Australia/Currie'), (b'Australia/Hobart', b'(GMT+1100) Australia/Hobart'), (b'Australia/Lord_Howe', b'(GMT+1100) Australia/Lord_Howe'), (b'Australia/Melbourne', b'(GMT+1100) Australia/Melbourne'), (b'Australia/Sydney', b'(GMT+1100) Australia/Sydney'), (b'Pacific/Efate', b'(GMT+1100) Pacific/Efate'), (b'Pacific/Guadalcanal', b'(GMT+1100) Pacific/Guadalcanal'), (b'Pacific/Kosrae', b'(GMT+1100) Pacific/Kosrae'), (b'Pacific/Noumea', b'(GMT+1100) Pacific/Noumea'), (b'Pacific/Pohnpei', b'(GMT+1100) Pacific/Pohnpei'), (b'Pacific/Norfolk', b'(GMT+1130) Pacific/Norfolk'), (b'Asia/Anadyr', b'(GMT+1200) Asia/Anadyr'), (b'Asia/Kamchatka', b'(GMT+1200) Asia/Kamchatka'), (b'Asia/Magadan', b'(GMT+1200) Asia/Magadan'), (b'Pacific/Fiji', b'(GMT+1200) Pacific/Fiji'), (b'Pacific/Funafuti', b'(GMT+1200) Pacific/Funafuti'), (b'Pacific/Kwajalein', b'(GMT+1200) Pacific/Kwajalein'), (b'Pacific/Majuro', b'(GMT+1200) Pacific/Majuro'), (b'Pacific/Nauru', b'(GMT+1200) Pacific/Nauru'), (b'Pacific/Tarawa', b'(GMT+1200) Pacific/Tarawa'), (b'Pacific/Wake', b'(GMT+1200) Pacific/Wake'), (b'Pacific/Wallis', b'(GMT+1200) Pacific/Wallis'), (b'Antarctica/McMurdo', b'(GMT+1300) Antarctica/McMurdo'), (b'Antarctica/South_Pole', b'(GMT+1300) Antarctica/South_Pole'), (b'Pacific/Auckland', b'(GMT+1300) Pacific/Auckland'), (b'Pacific/Enderbury', b'(GMT+1300) Pacific/Enderbury'), (b'Pacific/Fakaofo', b'(GMT+1300) Pacific/Fakaofo'), (b'Pacific/Tongatapu', b'(GMT+1300) Pacific/Tongatapu'), (b'Pacific/Chatham', b'(GMT+1345) Pacific/Chatham'), (b'Pacific/Apia', b'(GMT+1400) Pacific/Apia'), (b'Pacific/Kiritimati', b'(GMT+1400) Pacific/Kiritimati')])),
],
options={
},
@@ -51,12 +61,18 @@
migrations.CreateModel(
name='Account',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
],
options={
@@ -67,19 +83,28 @@
migrations.CreateModel(
name='Charge',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('kind', models.CharField(default=b'besteffort', max_length=30, choices=[(b'besteffort', b'besteffort'), (b'reservation', b'reservation'), (b'monthlyfee', b'monthlyfee')])),
- ('state', models.CharField(default=b'pending', max_length=30, choices=[(b'pending', b'pending'), (b'invoiced', b'invoiced')])),
+ ('kind', models.CharField(default=b'besteffort', max_length=30, choices=[
+ (b'besteffort', b'besteffort'), (b'reservation', b'reservation'), (b'monthlyfee', b'monthlyfee')])),
+ ('state', models.CharField(default=b'pending', max_length=30, choices=[
+ (b'pending', b'pending'), (b'invoiced', b'invoiced')])),
('date', models.DateTimeField()),
('amount', models.FloatField(default=0.0)),
('coreHours', models.FloatField(default=0.0)),
- ('account', models.ForeignKey(related_name=b'charges', to='core.Account')),
+ ('account', models.ForeignKey(
+ related_name=b'charges', to='core.Account')),
],
options={
'abstract': False,
@@ -89,20 +114,33 @@
migrations.CreateModel(
name='Controller',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('name', models.CharField(help_text=b'Name of the Controller', unique=True, max_length=200)),
- ('backend_type', models.CharField(help_text=b'Type of compute controller, e.g. EC2, OpenStack, or OpenStack version', max_length=200)),
- ('version', models.CharField(help_text=b'Controller version', max_length=200)),
- ('auth_url', models.CharField(help_text=b'Auth url for the compute controller', max_length=200, null=True, blank=True)),
- ('admin_user', models.CharField(help_text=b'Username of an admin user at this controller', max_length=200, null=True, blank=True)),
- ('admin_password', models.CharField(help_text=b'Password of theadmin user at this controller', max_length=200, null=True, blank=True)),
- ('admin_tenant', models.CharField(help_text=b'Name of the tenant the admin user belongs to', max_length=200, null=True, blank=True)),
+ ('name', models.CharField(
+ help_text=b'Name of the Controller', unique=True, max_length=200)),
+ ('backend_type', models.CharField(
+ help_text=b'Type of compute controller, e.g. EC2, OpenStack, or OpenStack version', max_length=200)),
+ ('version', models.CharField(
+ help_text=b'Controller version', max_length=200)),
+ ('auth_url', models.CharField(
+ help_text=b'Auth url for the compute controller', max_length=200, null=True, blank=True)),
+ ('admin_user', models.CharField(
+ help_text=b'Username of an admin user at this controller', max_length=200, null=True, blank=True)),
+ ('admin_password', models.CharField(
+ help_text=b'Password of theadmin user at this controller', max_length=200, null=True, blank=True)),
+ ('admin_tenant', models.CharField(
+ help_text=b'Name of the tenant the admin user belongs to', max_length=200, null=True, blank=True)),
],
options={
'abstract': False,
@@ -112,17 +150,27 @@
migrations.CreateModel(
name='ControllerCredential',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('name', models.SlugField(help_text=b'The credential type, e.g. ec2', max_length=128)),
- ('key_id', models.CharField(help_text=b'The backend id of this credential', max_length=1024)),
- ('enc_value', encrypted_fields.fields.EncryptedCharField(help_text=b'The key value of this credential', max_length=1024)),
- ('controller', models.ForeignKey(related_name=b'controllercredentials', to='core.Controller', help_text=b'The User this credential is associated with')),
+ ('name', models.SlugField(
+ help_text=b'The credential type, e.g. ec2', max_length=128)),
+ ('key_id', models.CharField(
+ help_text=b'The backend id of this credential', max_length=1024)),
+ ('enc_value', encrypted_fields.fields.EncryptedCharField(
+ help_text=b'The key value of this credential', max_length=1024)),
+ ('controller', models.ForeignKey(related_name=b'controllercredentials',
+ to='core.Controller', help_text=b'The User this credential is associated with')),
],
options={
'abstract': False,
@@ -132,16 +180,23 @@
migrations.CreateModel(
name='ControllerDashboardView',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
('enabled', models.BooleanField(default=True)),
('url', models.CharField(help_text=b'URL of Dashboard', max_length=1024)),
- ('controller', models.ForeignKey(related_name=b'controllerdashboardviews', to='core.Controller')),
+ ('controller', models.ForeignKey(
+ related_name=b'controllerdashboardviews', to='core.Controller')),
],
options={
'abstract': False,
@@ -151,15 +206,23 @@
migrations.CreateModel(
name='ControllerImages',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('glance_image_id', models.CharField(help_text=b'Glance image id', max_length=200, null=True, blank=True)),
- ('controller', models.ForeignKey(related_name=b'controllerimages', to='core.Controller')),
+ ('glance_image_id', models.CharField(
+ help_text=b'Glance image id', max_length=200, null=True, blank=True)),
+ ('controller', models.ForeignKey(
+ related_name=b'controllerimages', to='core.Controller')),
],
options={
'abstract': False,
@@ -169,18 +232,28 @@
migrations.CreateModel(
name='ControllerNetwork',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('net_id', models.CharField(help_text=b'Quantum network', max_length=256, null=True, blank=True)),
- ('router_id', models.CharField(help_text=b'Quantum router id', max_length=256, null=True, blank=True)),
- ('subnet_id', models.CharField(help_text=b'Quantum subnet id', max_length=256, null=True, blank=True)),
+ ('net_id', models.CharField(help_text=b'Quantum network',
+ max_length=256, null=True, blank=True)),
+ ('router_id', models.CharField(help_text=b'Quantum router id',
+ max_length=256, null=True, blank=True)),
+ ('subnet_id', models.CharField(help_text=b'Quantum subnet id',
+ max_length=256, null=True, blank=True)),
('subnet', models.CharField(max_length=32, blank=True)),
- ('controller', models.ForeignKey(related_name=b'controllernetworks', to='core.Controller')),
+ ('controller', models.ForeignKey(
+ related_name=b'controllernetworks', to='core.Controller')),
],
options={
'abstract': False,
@@ -190,14 +263,21 @@
migrations.CreateModel(
name='ControllerRole',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('role', models.CharField(unique=True, max_length=30, choices=[(b'admin', b'Admin')])),
+ ('role', models.CharField(unique=True,
+ max_length=30, choices=[(b'admin', b'Admin')])),
],
options={
'abstract': False,
@@ -207,15 +287,23 @@
migrations.CreateModel(
name='ControllerSite',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('tenant_id', models.CharField(help_text=b'Keystone tenant id', max_length=200, null=True, db_index=True, blank=True)),
- ('controller', models.ForeignKey(related_name=b'controllersite', blank=True, to='core.Controller', null=True)),
+ ('tenant_id', models.CharField(help_text=b'Keystone tenant id',
+ max_length=200, null=True, db_index=True, blank=True)),
+ ('controller', models.ForeignKey(related_name=b'controllersite',
+ blank=True, to='core.Controller', null=True)),
],
options={
'abstract': False,
@@ -225,15 +313,23 @@
migrations.CreateModel(
name='ControllerSitePrivilege',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('role_id', models.CharField(help_text=b'Keystone id', max_length=200, null=True, db_index=True, blank=True)),
- ('controller', models.ForeignKey(related_name=b'controllersiteprivileges', to='core.Controller')),
+ ('role_id', models.CharField(help_text=b'Keystone id',
+ max_length=200, null=True, db_index=True, blank=True)),
+ ('controller', models.ForeignKey(
+ related_name=b'controllersiteprivileges', to='core.Controller')),
],
options={
'abstract': False,
@@ -243,15 +339,23 @@
migrations.CreateModel(
name='ControllerSlice',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('tenant_id', models.CharField(help_text=b'Keystone tenant id', max_length=200, null=True, blank=True)),
- ('controller', models.ForeignKey(related_name=b'controllerslices', to='core.Controller')),
+ ('tenant_id', models.CharField(
+ help_text=b'Keystone tenant id', max_length=200, null=True, blank=True)),
+ ('controller', models.ForeignKey(
+ related_name=b'controllerslices', to='core.Controller')),
],
options={
'abstract': False,
@@ -261,15 +365,23 @@
migrations.CreateModel(
name='ControllerSlicePrivilege',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('role_id', models.CharField(help_text=b'Keystone id', max_length=200, null=True, db_index=True, blank=True)),
- ('controller', models.ForeignKey(related_name=b'controllersliceprivileges', to='core.Controller')),
+ ('role_id', models.CharField(help_text=b'Keystone id',
+ max_length=200, null=True, db_index=True, blank=True)),
+ ('controller', models.ForeignKey(
+ related_name=b'controllersliceprivileges', to='core.Controller')),
],
options={
'abstract': False,
@@ -279,16 +391,25 @@
migrations.CreateModel(
name='ControllerUser',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('kuser_id', models.CharField(help_text=b'Keystone user id', max_length=200, null=True, blank=True)),
- ('controller', models.ForeignKey(related_name=b'controllersusers', to='core.Controller')),
- ('user', models.ForeignKey(related_name=b'controllerusers', to=settings.AUTH_USER_MODEL)),
+ ('kuser_id', models.CharField(help_text=b'Keystone user id',
+ max_length=200, null=True, blank=True)),
+ ('controller', models.ForeignKey(
+ related_name=b'controllersusers', to='core.Controller')),
+ ('user', models.ForeignKey(
+ related_name=b'controllerusers', to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
@@ -298,17 +419,25 @@
migrations.CreateModel(
name='DashboardView',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('name', models.CharField(help_text=b'Name of the View', unique=True, max_length=200)),
+ ('name', models.CharField(
+ help_text=b'Name of the View', unique=True, max_length=200)),
('url', models.CharField(help_text=b'URL of Dashboard', max_length=1024)),
('enabled', models.BooleanField(default=True)),
- ('controllers', models.ManyToManyField(related_name=b'dashboardviews', through='core.ControllerDashboardView', to='core.Controller', blank=True)),
+ ('controllers', models.ManyToManyField(related_name=b'dashboardviews',
+ through='core.ControllerDashboardView', to='core.Controller', blank=True)),
],
options={
'abstract': False,
@@ -318,15 +447,23 @@
migrations.CreateModel(
name='Deployment',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('name', models.CharField(help_text=b'Name of the Deployment', unique=True, max_length=200)),
- ('accessControl', models.TextField(default=b'allow all', help_text=b'Access control list that specifies which sites/users may use nodes in this deployment', max_length=200)),
+ ('name', models.CharField(
+ help_text=b'Name of the Deployment', unique=True, max_length=200)),
+ ('accessControl', models.TextField(default=b'allow all',
+ help_text=b'Access control list that specifies which sites/users may use nodes in this deployment', max_length=200)),
],
options={
'abstract': False,
@@ -336,14 +473,21 @@
migrations.CreateModel(
name='DeploymentPrivilege',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('deployment', models.ForeignKey(related_name=b'deploymentprivileges', to='core.Deployment')),
+ ('deployment', models.ForeignKey(
+ related_name=b'deploymentprivileges', to='core.Deployment')),
],
options={
'abstract': False,
@@ -353,14 +497,21 @@
migrations.CreateModel(
name='DeploymentRole',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('role', models.CharField(unique=True, max_length=30, choices=[(b'admin', b'Admin')])),
+ ('role', models.CharField(unique=True,
+ max_length=30, choices=[(b'admin', b'Admin')])),
],
options={
'abstract': False,
@@ -370,19 +521,31 @@
migrations.CreateModel(
name='Flavor',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('name', models.CharField(help_text=b'name of this flavor, as displayed to users', max_length=32)),
- ('description', models.CharField(max_length=1024, null=True, blank=True)),
- ('flavor', models.CharField(help_text=b'flavor string used to configure deployments', max_length=32)),
- ('order', models.IntegerField(default=0, help_text=b'used to order flavors when displayed in a list')),
- ('default', models.BooleanField(default=False, help_text=b'make this a default flavor to use when creating new instances')),
- ('deployments', models.ManyToManyField(related_name=b'flavors', to='core.Deployment', blank=True)),
+ ('name', models.CharField(
+ help_text=b'name of this flavor, as displayed to users', max_length=32)),
+ ('description', models.CharField(
+ max_length=1024, null=True, blank=True)),
+ ('flavor', models.CharField(
+ help_text=b'flavor string used to configure deployments', max_length=32)),
+ ('order', models.IntegerField(default=0,
+ help_text=b'used to order flavors when displayed in a list')),
+ ('default', models.BooleanField(default=False,
+ help_text=b'make this a default flavor to use when creating new instances')),
+ ('deployments', models.ManyToManyField(
+ related_name=b'flavors', to='core.Deployment', blank=True)),
],
options={
'ordering': ('order', 'name'),
@@ -392,17 +555,24 @@
migrations.CreateModel(
name='Image',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
('name', models.CharField(unique=True, max_length=256)),
('disk_format', models.CharField(max_length=256)),
('container_format', models.CharField(max_length=256)),
- ('path', models.CharField(help_text=b'Path to image on local disk', max_length=256, null=True, blank=True)),
+ ('path', models.CharField(help_text=b'Path to image on local disk',
+ max_length=256, null=True, blank=True)),
],
options={
'abstract': False,
@@ -412,15 +582,23 @@
migrations.CreateModel(
name='ImageDeployments',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('deployment', models.ForeignKey(related_name=b'imagedeployments', to='core.Deployment')),
- ('image', models.ForeignKey(related_name=b'imagedeployments', to='core.Image')),
+ ('deployment', models.ForeignKey(
+ related_name=b'imagedeployments', to='core.Deployment')),
+ ('image', models.ForeignKey(
+ related_name=b'imagedeployments', to='core.Image')),
],
options={
'abstract': False,
@@ -430,15 +608,22 @@
migrations.CreateModel(
name='Invoice',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
('date', models.DateTimeField()),
- ('account', models.ForeignKey(related_name=b'invoices', to='core.Account')),
+ ('account', models.ForeignKey(
+ related_name=b'invoices', to='core.Account')),
],
options={
'abstract': False,
@@ -448,25 +633,36 @@
migrations.CreateModel(
name='Network',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
('name', models.CharField(max_length=32)),
('subnet', models.CharField(max_length=32, blank=True)),
- ('ports', models.CharField(blank=True, max_length=1024, null=True, validators=[core.models.network.ValidateNatList])),
+ ('ports', models.CharField(blank=True, max_length=1024,
+ null=True, validators=[core.models.network.ValidateNatList])),
('labels', models.CharField(max_length=1024, null=True, blank=True)),
('guaranteed_bandwidth', models.IntegerField(default=0)),
('permit_all_slices', models.BooleanField(default=False)),
('topology_parameters', models.TextField(null=True, blank=True)),
- ('controller_url', models.CharField(max_length=1024, null=True, blank=True)),
+ ('controller_url', models.CharField(
+ max_length=1024, null=True, blank=True)),
('controller_parameters', models.TextField(null=True, blank=True)),
- ('network_id', models.CharField(help_text=b'Quantum network', max_length=256, null=True, blank=True)),
- ('router_id', models.CharField(help_text=b'Quantum router id', max_length=256, null=True, blank=True)),
- ('subnet_id', models.CharField(help_text=b'Quantum subnet id', max_length=256, null=True, blank=True)),
+ ('network_id', models.CharField(help_text=b'Quantum network',
+ max_length=256, null=True, blank=True)),
+ ('router_id', models.CharField(help_text=b'Quantum router id',
+ max_length=256, null=True, blank=True)),
+ ('subnet_id', models.CharField(help_text=b'Quantum subnet id',
+ max_length=256, null=True, blank=True)),
],
options={
'abstract': False,
@@ -476,14 +672,21 @@
migrations.CreateModel(
name='NetworkParameter',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('value', models.CharField(help_text=b'The value of this parameter', max_length=1024)),
+ ('value', models.CharField(
+ help_text=b'The value of this parameter', max_length=1024)),
('object_id', models.PositiveIntegerField()),
('content_type', models.ForeignKey(to='contenttypes.ContentType')),
],
@@ -495,14 +698,21 @@
migrations.CreateModel(
name='NetworkParameterType',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('name', models.SlugField(help_text=b'The name of this parameter', max_length=128)),
+ ('name', models.SlugField(
+ help_text=b'The name of this parameter', max_length=128)),
('description', models.CharField(max_length=1024)),
],
options={
@@ -513,14 +723,21 @@
migrations.CreateModel(
name='NetworkSlice',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('network', models.ForeignKey(related_name=b'networkslices', to='core.Network')),
+ ('network', models.ForeignKey(
+ related_name=b'networkslices', to='core.Network')),
],
options={
'abstract': False,
@@ -530,16 +747,25 @@
migrations.CreateModel(
name='NetworkInstance',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('ip', models.GenericIPAddressField(help_text=b'Instance ip address', null=True, blank=True)),
- ('port_id', models.CharField(help_text=b'Quantum port id', max_length=256, null=True, blank=True)),
- ('network', models.ForeignKey(related_name=b'networkinstances', to='core.Network')),
+ ('ip', models.GenericIPAddressField(
+ help_text=b'Instance ip address', null=True, blank=True)),
+ ('port_id', models.CharField(help_text=b'Quantum port id',
+ max_length=256, null=True, blank=True)),
+ ('network', models.ForeignKey(
+ related_name=b'networkinstances', to='core.Network')),
],
options={
'abstract': False,
@@ -549,22 +775,35 @@
migrations.CreateModel(
name='NetworkTemplate',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
('name', models.CharField(max_length=32)),
- ('description', models.CharField(max_length=1024, null=True, blank=True)),
+ ('description', models.CharField(
+ max_length=1024, null=True, blank=True)),
('guaranteed_bandwidth', models.IntegerField(default=0)),
- ('visibility', models.CharField(default=b'private', max_length=30, choices=[(b'public', b'public'), (b'private', b'private')])),
- ('translation', models.CharField(default=b'none', max_length=30, choices=[(b'none', b'none'), (b'NAT', b'NAT')])),
- ('shared_network_name', models.CharField(max_length=30, null=True, blank=True)),
- ('shared_network_id', models.CharField(help_text=b'Quantum network', max_length=256, null=True, blank=True)),
- ('topology_kind', models.CharField(default=b'BigSwitch', max_length=30, choices=[(b'bigswitch', b'BigSwitch'), (b'physical', b'Physical'), (b'custom', b'Custom')])),
- ('controller_kind', models.CharField(default=None, max_length=30, null=True, blank=True, choices=[(None, b'None'), (b'onos', b'ONOS'), (b'custom', b'Custom')])),
+ ('visibility', models.CharField(default=b'private', max_length=30,
+ choices=[(b'public', b'public'), (b'private', b'private')])),
+ ('translation', models.CharField(default=b'none', max_length=30,
+ choices=[(b'none', b'none'), (b'NAT', b'NAT')])),
+ ('shared_network_name', models.CharField(
+ max_length=30, null=True, blank=True)),
+ ('shared_network_id', models.CharField(
+ help_text=b'Quantum network', max_length=256, null=True, blank=True)),
+ ('topology_kind', models.CharField(default=b'BigSwitch', max_length=30, choices=[
+ (b'bigswitch', b'BigSwitch'), (b'physical', b'Physical'), (b'custom', b'Custom')])),
+ ('controller_kind', models.CharField(default=None, max_length=30, null=True,
+ blank=True, choices=[(None, b'None'), (b'onos', b'ONOS'), (b'custom', b'Custom')])),
],
options={
'abstract': False,
@@ -574,14 +813,21 @@
migrations.CreateModel(
name='Node',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('name', models.CharField(help_text=b'Name of the Node', unique=True, max_length=200)),
+ ('name', models.CharField(
+ help_text=b'Name of the Node', unique=True, max_length=200)),
],
options={
'abstract': False,
@@ -591,16 +837,23 @@
migrations.CreateModel(
name='Payment',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
('amount', models.FloatField(default=0.0)),
('date', models.DateTimeField(default=django.utils.timezone.now)),
- ('account', models.ForeignKey(related_name=b'payments', to='core.Account')),
+ ('account', models.ForeignKey(
+ related_name=b'payments', to='core.Account')),
],
options={
'abstract': False,
@@ -610,14 +863,21 @@
migrations.CreateModel(
name='PlanetStack',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('description', models.CharField(default=b'PlanetStack', help_text=b'Used for scoping of roles at the PlanetStack Application level', unique=True, max_length=200)),
+ ('description', models.CharField(default=b'PlanetStack',
+ help_text=b'Used for scoping of roles at the PlanetStack Application level', unique=True, max_length=200)),
],
options={
'verbose_name_plural': 'PlanetStack',
@@ -627,14 +887,21 @@
migrations.CreateModel(
name='PlanetStackPrivilege',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('planetstack', models.ForeignKey(related_name=b'planetstackprivileges', default=1, to='core.PlanetStack')),
+ ('planetstack', models.ForeignKey(
+ related_name=b'planetstackprivileges', default=1, to='core.PlanetStack')),
],
options={
'abstract': False,
@@ -644,14 +911,21 @@
migrations.CreateModel(
name='PlanetStackRole',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('role', models.CharField(unique=True, max_length=30, choices=[(b'admin', b'Admin')])),
+ ('role', models.CharField(unique=True,
+ max_length=30, choices=[(b'admin', b'Admin')])),
],
options={
'abstract': False,
@@ -661,14 +935,21 @@
migrations.CreateModel(
name='Project',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('name', models.CharField(help_text=b'Name of Project', unique=True, max_length=200)),
+ ('name', models.CharField(
+ help_text=b'Name of Project', unique=True, max_length=200)),
],
options={
'abstract': False,
@@ -678,12 +959,18 @@
migrations.CreateModel(
name='Reservation',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
('startTime', models.DateTimeField()),
('duration', models.IntegerField(default=1)),
@@ -696,15 +983,22 @@
migrations.CreateModel(
name='ReservedResource',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
('quantity', models.IntegerField(default=1)),
- ('reservationSet', models.ForeignKey(related_name=b'reservedresources', to='core.Reservation')),
+ ('reservationSet', models.ForeignKey(
+ related_name=b'reservedresources', to='core.Reservation')),
],
options={
'abstract': False,
@@ -715,17 +1009,26 @@
migrations.CreateModel(
name='Role',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
('role_type', models.CharField(max_length=80, verbose_name=b'Name')),
- ('role', models.CharField(max_length=80, null=True, verbose_name=b'Keystone role id', blank=True)),
- ('description', models.CharField(max_length=120, verbose_name=b'Description')),
- ('content_type', models.ForeignKey(verbose_name=b'Role Scope', to='contenttypes.ContentType')),
+ ('role', models.CharField(max_length=80, null=True,
+ verbose_name=b'Keystone role id', blank=True)),
+ ('description', models.CharField(
+ max_length=120, verbose_name=b'Description')),
+ ('content_type', models.ForeignKey(
+ verbose_name=b'Role Scope', to='contenttypes.ContentType')),
],
options={
'abstract': False,
@@ -735,15 +1038,22 @@
migrations.CreateModel(
name='Router',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
('name', models.CharField(max_length=32)),
- ('networks', models.ManyToManyField(related_name=b'routers', to='core.Network', blank=True)),
+ ('networks', models.ManyToManyField(
+ related_name=b'routers', to='core.Network', blank=True)),
],
options={
'abstract': False,
@@ -753,17 +1063,25 @@
migrations.CreateModel(
name='Service',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('description', models.TextField(help_text=b'Description of Service', max_length=254, null=True, blank=True)),
+ ('description', models.TextField(
+ help_text=b'Description of Service', max_length=254, null=True, blank=True)),
('enabled', models.BooleanField(default=True)),
('name', models.CharField(help_text=b'Service Name', max_length=30)),
- ('versionNumber', models.CharField(help_text=b'Version of Service Definition', max_length=30)),
+ ('versionNumber', models.CharField(
+ help_text=b'Version of Service Definition', max_length=30)),
('published', models.BooleanField(default=True)),
],
options={
@@ -774,16 +1092,24 @@
migrations.CreateModel(
name='ServiceAttribute',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
('name', models.SlugField(help_text=b'Attribute Name', max_length=128)),
- ('value', models.CharField(help_text=b'Attribute Value', max_length=1024)),
- ('service', models.ForeignKey(related_name=b'serviceattributes', to='core.Service', help_text=b'The Service this attribute is associated with')),
+ ('value', models.CharField(
+ help_text=b'Attribute Value', max_length=1024)),
+ ('service', models.ForeignKey(related_name=b'serviceattributes',
+ to='core.Service', help_text=b'The Service this attribute is associated with')),
],
options={
'abstract': False,
@@ -793,12 +1119,18 @@
migrations.CreateModel(
name='ServiceClass',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
('name', models.CharField(max_length=32)),
('description', models.CharField(max_length=255)),
@@ -806,7 +1138,8 @@
('membershipFee', models.IntegerField(default=0)),
('membershipFeeMonths', models.IntegerField(default=12)),
('upgradeRequiresApproval', models.BooleanField(default=False)),
- ('upgradeFrom', models.ManyToManyField(related_name='upgradeFrom_rel_+', null=True, to='core.ServiceClass', blank=True)),
+ ('upgradeFrom', models.ManyToManyField(
+ related_name='upgradeFrom_rel_+', null=True, to='core.ServiceClass', blank=True)),
],
options={
'abstract': False,
@@ -817,12 +1150,18 @@
migrations.CreateModel(
name='ServiceResource',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
('name', models.CharField(max_length=32)),
('maxUnitsDeployment', models.IntegerField(default=1)),
@@ -832,7 +1171,8 @@
('bucketMaxSize', models.IntegerField(default=0)),
('cost', models.IntegerField(default=0)),
('calendarReservable', models.BooleanField(default=True)),
- ('serviceClass', models.ForeignKey(related_name=b'serviceresources', to='core.ServiceClass')),
+ ('serviceClass', models.ForeignKey(
+ related_name=b'serviceresources', to='core.ServiceClass')),
],
options={
'abstract': False,
@@ -842,21 +1182,32 @@
migrations.CreateModel(
name='Site',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('name', models.CharField(help_text=b'Name for this Site', max_length=200)),
- ('site_url', models.URLField(help_text=b"Site's Home URL Page", max_length=512, null=True, blank=True)),
- ('enabled', models.BooleanField(default=True, help_text=b'Status for this Site')),
+ ('name', models.CharField(
+ help_text=b'Name for this Site', max_length=200)),
+ ('site_url', models.URLField(help_text=b"Site's Home URL Page",
+ max_length=512, null=True, blank=True)),
+ ('enabled', models.BooleanField(
+ default=True, help_text=b'Status for this Site')),
('location', geoposition.fields.GeopositionField(max_length=42)),
('longitude', models.FloatField(null=True, blank=True)),
('latitude', models.FloatField(null=True, blank=True)),
- ('login_base', models.CharField(help_text=b'Prefix for Slices associated with this Site', unique=True, max_length=50)),
- ('is_public', models.BooleanField(default=True, help_text=b'Indicates the visibility of this site to other members')),
+ ('login_base', models.CharField(
+ help_text=b'Prefix for Slices associated with this Site', unique=True, max_length=50)),
+ ('is_public', models.BooleanField(
+ default=True, help_text=b'Indicates the visibility of this site to other members')),
('abbreviated_name', models.CharField(max_length=80)),
],
options={
@@ -867,17 +1218,27 @@
migrations.CreateModel(
name='SiteCredential',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('name', models.SlugField(help_text=b'The credential type, e.g. ec2', max_length=128)),
- ('key_id', models.CharField(help_text=b'The backend id of this credential', max_length=1024)),
- ('enc_value', encrypted_fields.fields.EncryptedCharField(help_text=b'The key value of this credential', max_length=1024)),
- ('site', models.ForeignKey(related_name=b'sitecredentials', to='core.Site', help_text=b'The User this credential is associated with')),
+ ('name', models.SlugField(
+ help_text=b'The credential type, e.g. ec2', max_length=128)),
+ ('key_id', models.CharField(
+ help_text=b'The backend id of this credential', max_length=1024)),
+ ('enc_value', encrypted_fields.fields.EncryptedCharField(
+ help_text=b'The key value of this credential', max_length=1024)),
+ ('site', models.ForeignKey(related_name=b'sitecredentials', to='core.Site',
+ help_text=b'The User this credential is associated with')),
],
options={
'abstract': False,
@@ -887,17 +1248,27 @@
migrations.CreateModel(
name='SiteDeployment',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('availability_zone', models.CharField(help_text=b'OpenStack availability zone', max_length=200, null=True, blank=True)),
- ('controller', models.ForeignKey(related_name=b'sitedeployments', blank=True, to='core.Controller', null=True)),
- ('deployment', models.ForeignKey(related_name=b'sitedeployments', to='core.Deployment')),
- ('site', models.ForeignKey(related_name=b'sitedeployments', to='core.Site')),
+ ('availability_zone', models.CharField(
+ help_text=b'OpenStack availability zone', max_length=200, null=True, blank=True)),
+ ('controller', models.ForeignKey(
+ related_name=b'sitedeployments', blank=True, to='core.Controller', null=True)),
+ ('deployment', models.ForeignKey(
+ related_name=b'sitedeployments', to='core.Deployment')),
+ ('site', models.ForeignKey(
+ related_name=b'sitedeployments', to='core.Site')),
],
options={
'abstract': False,
@@ -907,12 +1278,18 @@
migrations.CreateModel(
name='SitePrivilege',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
],
options={
@@ -923,14 +1300,21 @@
migrations.CreateModel(
name='SiteRole',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('role', models.CharField(unique=True, max_length=30, choices=[(b'admin', b'Admin'), (b'pi', b'PI'), (b'tech', b'Tech'), (b'billing', b'Billing')])),
+ ('role', models.CharField(unique=True, max_length=30, choices=[
+ (b'admin', b'Admin'), (b'pi', b'PI'), (b'tech', b'Tech'), (b'billing', b'Billing')])),
],
options={
'abstract': False,
@@ -940,27 +1324,44 @@
migrations.CreateModel(
name='Slice',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('name', models.CharField(help_text=b'The Name of the Slice', unique=True, max_length=80)),
- ('enabled', models.BooleanField(default=True, help_text=b'Status for this Slice')),
+ ('name', models.CharField(
+ help_text=b'The Name of the Slice', unique=True, max_length=80)),
+ ('enabled', models.BooleanField(
+ default=True, help_text=b'Status for this Slice')),
('omf_friendly', models.BooleanField(default=False)),
- ('description', models.TextField(help_text=b'High level description of the slice and expected activities', max_length=1024, blank=True)),
+ ('description', models.TextField(
+ help_text=b'High level description of the slice and expected activities', max_length=1024, blank=True)),
('slice_url', models.URLField(max_length=512, blank=True)),
('max_instances', models.IntegerField(default=10)),
- ('network', models.CharField(default=b'Private Only', max_length=256, null=True, blank=True)),
- ('mount_data_sets', models.CharField(default=b'GenBank', max_length=256, null=True, blank=True)),
- ('creator', models.ForeignKey(related_name=b'slices', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
- ('default_flavor', models.ForeignKey(related_name=b'slices', blank=True, to='core.Flavor', null=True)),
- ('default_image', models.ForeignKey(related_name=b'slices', blank=True, to='core.Image', null=True)),
- ('service', models.ForeignKey(related_name=b'service', blank=True, to='core.Service', null=True)),
- ('serviceClass', models.ForeignKey(related_name=b'slices', default=core.models.serviceclass.get_default_serviceclass, to='core.ServiceClass', null=True)),
- ('site', models.ForeignKey(related_name=b'slices', to='core.Site', help_text=b'The Site this Slice belongs to')),
+ ('network', models.CharField(default=b'Private Only',
+ max_length=256, null=True, blank=True)),
+ ('mount_data_sets', models.CharField(
+ default=b'GenBank', max_length=256, null=True, blank=True)),
+ ('creator', models.ForeignKey(related_name=b'slices',
+ blank=True, to=settings.AUTH_USER_MODEL, null=True)),
+ ('default_flavor', models.ForeignKey(
+ related_name=b'slices', blank=True, to='core.Flavor', null=True)),
+ ('default_image', models.ForeignKey(
+ related_name=b'slices', blank=True, to='core.Image', null=True)),
+ ('service', models.ForeignKey(related_name=b'service',
+ blank=True, to='core.Service', null=True)),
+ ('serviceClass', models.ForeignKey(related_name=b'slices',
+ default=core.models.serviceclass.get_default_serviceclass, to='core.ServiceClass', null=True)),
+ ('site', models.ForeignKey(related_name=b'slices',
+ to='core.Site', help_text=b'The Site this Slice belongs to')),
],
options={
'abstract': False,
@@ -970,17 +1371,27 @@
migrations.CreateModel(
name='SliceCredential',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('name', models.SlugField(help_text=b'The credential type, e.g. ec2', max_length=128)),
- ('key_id', models.CharField(help_text=b'The backend id of this credential', max_length=1024)),
- ('enc_value', encrypted_fields.fields.EncryptedCharField(help_text=b'The key value of this credential', max_length=1024)),
- ('slice', models.ForeignKey(related_name=b'slicecredentials', to='core.Slice', help_text=b'The User this credential is associated with')),
+ ('name', models.SlugField(
+ help_text=b'The credential type, e.g. ec2', max_length=128)),
+ ('key_id', models.CharField(
+ help_text=b'The backend id of this credential', max_length=1024)),
+ ('enc_value', encrypted_fields.fields.EncryptedCharField(
+ help_text=b'The key value of this credential', max_length=1024)),
+ ('slice', models.ForeignKey(related_name=b'slicecredentials',
+ to='core.Slice', help_text=b'The User this credential is associated with')),
],
options={
'abstract': False,
@@ -990,12 +1401,18 @@
migrations.CreateModel(
name='SlicePrivilege',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
],
options={
@@ -1006,14 +1423,21 @@
migrations.CreateModel(
name='SliceRole',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('role', models.CharField(unique=True, max_length=30, choices=[(b'admin', b'Admin'), (b'default', b'Default')])),
+ ('role', models.CharField(unique=True, max_length=30,
+ choices=[(b'admin', b'Admin'), (b'default', b'Default')])),
],
options={
'abstract': False,
@@ -1023,16 +1447,25 @@
migrations.CreateModel(
name='SliceTag',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('name', models.CharField(help_text=b'The name of this tag', max_length=30, choices=[(b'privatekey', b'Private Key'), (b'publickey', b'Public Key')])),
- ('value', models.CharField(help_text=b'The value of this tag', max_length=1024)),
- ('slice', models.ForeignKey(related_name=b'slicetags', to='core.Slice')),
+ ('name', models.CharField(help_text=b'The name of this tag', max_length=30, choices=[
+ (b'privatekey', b'Private Key'), (b'publickey', b'Public Key')])),
+ ('value', models.CharField(
+ help_text=b'The value of this tag', max_length=1024)),
+ ('slice', models.ForeignKey(
+ related_name=b'slicetags', to='core.Slice')),
],
options={
'abstract': False,
@@ -1042,26 +1475,43 @@
migrations.CreateModel(
name='Instance',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('instance_id', models.CharField(help_text=b'Nova instance id', max_length=200, null=True, blank=True)),
- ('instance_uuid', models.CharField(help_text=b'Nova instance uuid', max_length=200, null=True, blank=True)),
+ ('instance_id', models.CharField(
+ help_text=b'Nova instance id', max_length=200, null=True, blank=True)),
+ ('instance_uuid', models.CharField(
+ help_text=b'Nova instance uuid', max_length=200, null=True, blank=True)),
('name', models.CharField(help_text=b'Instance name', max_length=200)),
- ('instance_name', models.CharField(help_text=b'OpenStack generated name', max_length=200, null=True, blank=True)),
- ('ip', models.GenericIPAddressField(help_text=b'Instance ip address', null=True, blank=True)),
- ('numberCores', models.IntegerField(default=0, help_text=b'Number of cores for instance', verbose_name=b'Number of Cores')),
- ('userData', models.TextField(help_text=b'user_data passed to instance during creation', null=True, blank=True)),
- ('creator', models.ForeignKey(related_name=b'instances', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
- ('deployment', models.ForeignKey(related_name=b'instance_deployment', verbose_name=b'deployment', to='core.Deployment')),
- ('flavor', models.ForeignKey(default=core.models.instance.get_default_flavor, to='core.Flavor', help_text=b'Flavor of this instance')),
- ('image', models.ForeignKey(related_name=b'instances', to='core.Image')),
+ ('instance_name', models.CharField(
+ help_text=b'OpenStack generated name', max_length=200, null=True, blank=True)),
+ ('ip', models.GenericIPAddressField(
+ help_text=b'Instance ip address', null=True, blank=True)),
+ ('numberCores', models.IntegerField(
+ default=0, help_text=b'Number of cores for instance', verbose_name=b'Number of Cores')),
+ ('userData', models.TextField(
+ help_text=b'user_data passed to instance during creation', null=True, blank=True)),
+ ('creator', models.ForeignKey(related_name=b'instances',
+ blank=True, to=settings.AUTH_USER_MODEL, null=True)),
+ ('deployment', models.ForeignKey(related_name=b'instance_deployment',
+ verbose_name=b'deployment', to='core.Deployment')),
+ ('flavor', models.ForeignKey(default=core.models.instance.get_default_flavor,
+ to='core.Flavor', help_text=b'Flavor of this instance')),
+ ('image', models.ForeignKey(
+ related_name=b'instances', to='core.Image')),
('node', models.ForeignKey(related_name=b'instances', to='core.Node')),
- ('slice', models.ForeignKey(related_name=b'instances', to='core.Slice')),
+ ('slice', models.ForeignKey(
+ related_name=b'instances', to='core.Slice')),
],
options={
'abstract': False,
@@ -1071,18 +1521,27 @@
migrations.CreateModel(
name='Tag',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('name', models.SlugField(help_text=b'The name of this tag', max_length=128)),
- ('value', models.CharField(help_text=b'The value of this tag', max_length=1024)),
+ ('name', models.SlugField(
+ help_text=b'The name of this tag', max_length=128)),
+ ('value', models.CharField(
+ help_text=b'The value of this tag', max_length=1024)),
('object_id', models.PositiveIntegerField()),
('content_type', models.ForeignKey(to='contenttypes.ContentType')),
- ('service', models.ForeignKey(related_name=b'tags', to='core.Service', help_text=b'The Service this Tag is associated with')),
+ ('service', models.ForeignKey(related_name=b'tags', to='core.Service',
+ help_text=b'The Service this Tag is associated with')),
],
options={
'abstract': False,
@@ -1092,12 +1551,18 @@
migrations.CreateModel(
name='UsableObject',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
('name', models.CharField(max_length=1024)),
],
@@ -1109,17 +1574,27 @@
migrations.CreateModel(
name='UserCredential',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
- ('name', models.SlugField(help_text=b'The credential type, e.g. ec2', max_length=128)),
- ('key_id', models.CharField(help_text=b'The backend id of this credential', max_length=1024)),
- ('enc_value', encrypted_fields.fields.EncryptedCharField(help_text=b'The key value of this credential', max_length=1024)),
- ('user', models.ForeignKey(related_name=b'usercredentials', to=settings.AUTH_USER_MODEL, help_text=b'The User this credential is associated with')),
+ ('name', models.SlugField(
+ help_text=b'The credential type, e.g. ec2', max_length=128)),
+ ('key_id', models.CharField(
+ help_text=b'The backend id of this credential', max_length=1024)),
+ ('enc_value', encrypted_fields.fields.EncryptedCharField(
+ help_text=b'The key value of this credential', max_length=1024)),
+ ('user', models.ForeignKey(related_name=b'usercredentials', to=settings.AUTH_USER_MODEL,
+ help_text=b'The User this credential is associated with')),
],
options={
'abstract': False,
@@ -1129,16 +1604,24 @@
migrations.CreateModel(
name='UserDashboardView',
fields=[
- ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('created', models.DateTimeField(default=django.utils.timezone.now, auto_now_add=True)),
- ('updated', models.DateTimeField(default=django.utils.timezone.now, auto_now=True)),
- ('enacted', models.DateTimeField(default=None, null=True, blank=True)),
- ('policed', models.DateTimeField(default=None, null=True, blank=True)),
- ('backend_status', models.CharField(default=b'Provisioning in progress', max_length=140)),
+ ('id', models.AutoField(verbose_name='ID',
+ serialize=False, auto_created=True, primary_key=True)),
+ ('created', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now_add=True)),
+ ('updated', models.DateTimeField(
+ default=django.utils.timezone.now, auto_now=True)),
+ ('enacted', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('policed', models.DateTimeField(
+ default=None, null=True, blank=True)),
+ ('backend_status', models.CharField(
+ default=b'Provisioning in progress', max_length=140)),
('deleted', models.BooleanField(default=False)),
('order', models.IntegerField(default=0)),
- ('dashboardView', models.ForeignKey(related_name=b'userdashboardviews', to='core.DashboardView')),
- ('user', models.ForeignKey(related_name=b'userdashboardviews', to=settings.AUTH_USER_MODEL)),
+ ('dashboardView', models.ForeignKey(
+ related_name=b'userdashboardviews', to='core.DashboardView')),
+ ('user', models.ForeignKey(
+ related_name=b'userdashboardviews', to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
@@ -1148,43 +1631,50 @@
migrations.AddField(
model_name='sliceprivilege',
name='role',
- field=models.ForeignKey(related_name=b'sliceprivileges', to='core.SliceRole'),
+ field=models.ForeignKey(
+ related_name=b'sliceprivileges', to='core.SliceRole'),
preserve_default=True,
),
migrations.AddField(
model_name='sliceprivilege',
name='slice',
- field=models.ForeignKey(related_name=b'sliceprivileges', to='core.Slice'),
+ field=models.ForeignKey(
+ related_name=b'sliceprivileges', to='core.Slice'),
preserve_default=True,
),
migrations.AddField(
model_name='sliceprivilege',
name='user',
- field=models.ForeignKey(related_name=b'sliceprivileges', to=settings.AUTH_USER_MODEL),
+ field=models.ForeignKey(
+ related_name=b'sliceprivileges', to=settings.AUTH_USER_MODEL),
preserve_default=True,
),
migrations.AddField(
model_name='siteprivilege',
name='role',
- field=models.ForeignKey(related_name=b'siteprivileges', to='core.SiteRole'),
+ field=models.ForeignKey(
+ related_name=b'siteprivileges', to='core.SiteRole'),
preserve_default=True,
),
migrations.AddField(
model_name='siteprivilege',
name='site',
- field=models.ForeignKey(related_name=b'siteprivileges', to='core.Site'),
+ field=models.ForeignKey(
+ related_name=b'siteprivileges', to='core.Site'),
preserve_default=True,
),
migrations.AddField(
model_name='siteprivilege',
name='user',
- field=models.ForeignKey(related_name=b'siteprivileges', to=settings.AUTH_USER_MODEL),
+ field=models.ForeignKey(
+ related_name=b'siteprivileges', to=settings.AUTH_USER_MODEL),
preserve_default=True,
),
migrations.AddField(
model_name='site',
name='deployments',
- field=models.ManyToManyField(help_text=b'Select which sites are allowed to host nodes in this deployment', related_name=b'sites', through='core.SiteDeployment', to='core.Deployment', blank=True),
+ field=models.ManyToManyField(help_text=b'Select which sites are allowed to host nodes in this deployment',
+ related_name=b'sites', through='core.SiteDeployment', to='core.Deployment', blank=True),
preserve_default=True,
),
migrations.AddField(
@@ -1196,25 +1686,29 @@
migrations.AddField(
model_name='router',
name='permittedNetworks',
- field=models.ManyToManyField(related_name=b'availableRouters', to='core.Network', blank=True),
+ field=models.ManyToManyField(
+ related_name=b'availableRouters', to='core.Network', blank=True),
preserve_default=True,
),
migrations.AddField(
model_name='reservedresource',
name='resource',
- field=models.ForeignKey(related_name=b'reservedresources', to='core.ServiceResource'),
+ field=models.ForeignKey(
+ related_name=b'reservedresources', to='core.ServiceResource'),
preserve_default=True,
),
migrations.AddField(
model_name='reservedresource',
name='instance',
- field=models.ForeignKey(related_name=b'reservedresources', to='core.Instance'),
+ field=models.ForeignKey(
+ related_name=b'reservedresources', to='core.Instance'),
preserve_default=True,
),
migrations.AddField(
model_name='reservation',
name='slice',
- field=models.ForeignKey(related_name=b'reservations', to='core.Slice'),
+ field=models.ForeignKey(
+ related_name=b'reservations', to='core.Slice'),
preserve_default=True,
),
migrations.AddField(
@@ -1226,61 +1720,71 @@
migrations.AddField(
model_name='planetstackprivilege',
name='user',
- field=models.ForeignKey(related_name=b'planetstackprivileges', to=settings.AUTH_USER_MODEL),
+ field=models.ForeignKey(
+ related_name=b'planetstackprivileges', to=settings.AUTH_USER_MODEL),
preserve_default=True,
),
migrations.AddField(
model_name='node',
name='site',
- field=models.ForeignKey(related_name=b'nodes', blank=True, to='core.Site', null=True),
+ field=models.ForeignKey(
+ related_name=b'nodes', blank=True, to='core.Site', null=True),
preserve_default=True,
),
migrations.AddField(
model_name='node',
name='site_deployment',
- field=models.ForeignKey(related_name=b'nodes', to='core.SiteDeployment'),
+ field=models.ForeignKey(
+ related_name=b'nodes', to='core.SiteDeployment'),
preserve_default=True,
),
migrations.AddField(
model_name='networkinstance',
name='instance',
- field=models.ForeignKey(related_name=b'networkinstances', to='core.Instance'),
+ field=models.ForeignKey(
+ related_name=b'networkinstances', to='core.Instance'),
preserve_default=True,
),
migrations.AddField(
model_name='networkslice',
name='slice',
- field=models.ForeignKey(related_name=b'networkslices', to='core.Slice'),
+ field=models.ForeignKey(
+ related_name=b'networkslices', to='core.Slice'),
preserve_default=True,
),
migrations.AddField(
model_name='networkparameter',
name='parameter',
- field=models.ForeignKey(related_name=b'networkparameters', to='core.NetworkParameterType', help_text=b'The type of the parameter'),
+ field=models.ForeignKey(related_name=b'networkparameters',
+ to='core.NetworkParameterType', help_text=b'The type of the parameter'),
preserve_default=True,
),
migrations.AddField(
model_name='network',
name='owner',
- field=models.ForeignKey(related_name=b'ownedNetworks', to='core.Slice', help_text=b'Slice that owns control of this Network'),
+ field=models.ForeignKey(related_name=b'ownedNetworks', to='core.Slice',
+ help_text=b'Slice that owns control of this Network'),
preserve_default=True,
),
migrations.AddField(
model_name='network',
name='permitted_slices',
- field=models.ManyToManyField(related_name=b'availableNetworks', to='core.Slice', blank=True),
+ field=models.ManyToManyField(
+ related_name=b'availableNetworks', to='core.Slice', blank=True),
preserve_default=True,
),
migrations.AddField(
model_name='network',
name='slices',
- field=models.ManyToManyField(related_name=b'networks', through='core.NetworkSlice', to='core.Slice', blank=True),
+ field=models.ManyToManyField(
+ related_name=b'networks', through='core.NetworkSlice', to='core.Slice', blank=True),
preserve_default=True,
),
migrations.AddField(
model_name='network',
name='instances',
- field=models.ManyToManyField(related_name=b'networks', through='core.NetworkInstance', to='core.Instance', blank=True),
+ field=models.ManyToManyField(
+ related_name=b'networks', through='core.NetworkInstance', to='core.Instance', blank=True),
preserve_default=True,
),
migrations.AddField(
@@ -1292,67 +1796,78 @@
migrations.AddField(
model_name='image',
name='deployments',
- field=models.ManyToManyField(help_text=b'Select which images should be instantiated on this deployment', related_name=b'images', through='core.ImageDeployments', to='core.Deployment', blank=True),
+ field=models.ManyToManyField(help_text=b'Select which images should be instantiated on this deployment',
+ related_name=b'images', through='core.ImageDeployments', to='core.Deployment', blank=True),
preserve_default=True,
),
migrations.AddField(
model_name='deploymentprivilege',
name='role',
- field=models.ForeignKey(related_name=b'deploymentprivileges', to='core.DeploymentRole'),
+ field=models.ForeignKey(
+ related_name=b'deploymentprivileges', to='core.DeploymentRole'),
preserve_default=True,
),
migrations.AddField(
model_name='deploymentprivilege',
name='user',
- field=models.ForeignKey(related_name=b'deploymentprivileges', to=settings.AUTH_USER_MODEL),
+ field=models.ForeignKey(
+ related_name=b'deploymentprivileges', to=settings.AUTH_USER_MODEL),
preserve_default=True,
),
migrations.AddField(
model_name='controllersliceprivilege',
name='slice_privilege',
- field=models.ForeignKey(related_name=b'controllersliceprivileges', to='core.SlicePrivilege'),
+ field=models.ForeignKey(
+ related_name=b'controllersliceprivileges', to='core.SlicePrivilege'),
preserve_default=True,
),
migrations.AddField(
model_name='controllerslice',
name='slice',
- field=models.ForeignKey(related_name=b'controllerslices', to='core.Slice'),
+ field=models.ForeignKey(
+ related_name=b'controllerslices', to='core.Slice'),
preserve_default=True,
),
migrations.AddField(
model_name='controllersiteprivilege',
name='site_privilege',
- field=models.ForeignKey(related_name=b'controllersiteprivileges', to='core.SitePrivilege'),
+ field=models.ForeignKey(
+ related_name=b'controllersiteprivileges', to='core.SitePrivilege'),
preserve_default=True,
),
migrations.AddField(
model_name='controllersite',
name='site',
- field=models.ForeignKey(related_name=b'controllersite', to='core.Site'),
+ field=models.ForeignKey(
+ related_name=b'controllersite', to='core.Site'),
preserve_default=True,
),
migrations.AddField(
model_name='controllernetwork',
name='network',
- field=models.ForeignKey(related_name=b'controllernetworks', to='core.Network'),
+ field=models.ForeignKey(
+ related_name=b'controllernetworks', to='core.Network'),
preserve_default=True,
),
migrations.AddField(
model_name='controllerimages',
name='image',
- field=models.ForeignKey(related_name=b'controllerimages', to='core.Image'),
+ field=models.ForeignKey(
+ related_name=b'controllerimages', to='core.Image'),
preserve_default=True,
),
migrations.AddField(
model_name='controllerdashboardview',
name='dashboardView',
- field=models.ForeignKey(related_name=b'controllerdashboardviews', to='core.DashboardView'),
+ field=models.ForeignKey(
+ related_name=b'controllerdashboardviews', to='core.DashboardView'),
preserve_default=True,
),
migrations.AddField(
model_name='charge',
name='invoice',
- field=models.ForeignKey(related_name=b'charges', blank=True, to='core.Invoice', null=True),
+ field=models.ForeignKey(
+ related_name=b'charges', blank=True, to='core.Invoice', null=True),
preserve_default=True,
),
migrations.AddField(
@@ -1364,25 +1879,29 @@
migrations.AddField(
model_name='charge',
name='slice',
- field=models.ForeignKey(related_name=b'charges', blank=True, to='core.Slice', null=True),
+ field=models.ForeignKey(
+ related_name=b'charges', blank=True, to='core.Slice', null=True),
preserve_default=True,
),
migrations.AddField(
model_name='account',
name='site',
- field=models.ForeignKey(related_name=b'accounts', to='core.Site', help_text=b'Site for this account'),
+ field=models.ForeignKey(
+ related_name=b'accounts', to='core.Site', help_text=b'Site for this account'),
preserve_default=True,
),
migrations.AddField(
model_name='user',
name='dashboards',
- field=models.ManyToManyField(to='core.DashboardView', through='core.UserDashboardView', blank=True),
+ field=models.ManyToManyField(
+ to='core.DashboardView', through='core.UserDashboardView', blank=True),
preserve_default=True,
),
migrations.AddField(
model_name='user',
name='site',
- field=models.ForeignKey(related_name=b'users', to='core.Site', help_text=b'Site this user will be homed too', null=True),
+ field=models.ForeignKey(related_name=b'users', to='core.Site',
+ help_text=b'Site this user will be homed too', null=True),
preserve_default=True,
),
]
diff --git a/xos/core/models/service.py b/xos/core/models/service.py
index 920bc3b..641c5ae 100644
--- a/xos/core/models/service.py
+++ b/xos/core/models/service.py
@@ -1,14 +1,18 @@
-from django.db import models
-from core.models import PlCoreBase,SingletonModel,PlCoreBaseManager
-from core.models.plcorebase import StrippedCharField
-from xos.exceptions import *
-from operator import attrgetter
import json
+from operator import attrgetter
-COARSE_KIND="coarse"
+from core.models import PlCoreBase, PlCoreBaseManager, SingletonModel
+from core.models.plcorebase import StrippedCharField
+from django.db import models
+from xos.exceptions import *
+
+COARSE_KIND = "coarse"
+
class AttributeMixin(object):
- # helper for extracting things from a json-encoded service_specific_attribute
+ # helper for extracting things from a json-encoded
+ # service_specific_attribute
+
def get_attribute(self, name, default=None):
if self.service_specific_attribute:
attributes = json.loads(self.service_specific_attribute)
@@ -21,12 +25,13 @@
attributes = json.loads(self.service_specific_attribute)
else:
attributes = {}
- attributes[name]=value
+ attributes[name] = value
self.service_specific_attribute = json.dumps(attributes)
def get_initial_attribute(self, name, default=None):
if self._initial["service_specific_attribute"]:
- attributes = json.loads(self._initial["service_specific_attribute"])
+ attributes = json.loads(
+ self._initial["service_specific_attribute"])
else:
attributes = {}
return attributes.get(name, default)
@@ -34,9 +39,9 @@
@classmethod
def get_default_attribute(cls, name):
for (attrname, default) in cls.simple_attributes:
- if attrname==name:
+ if attrname == name:
return default
- if hasattr(cls,"default_attributes"):
+ if hasattr(cls, "default_attributes"):
if name in cls.default_attributes:
return cls.default_attributes[name]
@@ -46,27 +51,34 @@
def setup_simple_attributes(cls):
for (attrname, default) in cls.simple_attributes:
setattr(cls, attrname, property(lambda self, attrname=attrname, default=default: self.get_attribute(attrname, default),
- lambda self, value, attrname=attrname: self.set_attribute(attrname, value),
+ lambda self, value, attrname=attrname: self.set_attribute(
+ attrname, value),
None,
attrname))
+
class Service(PlCoreBase, AttributeMixin):
# when subclassing a service, redefine KIND to describe the new service
KIND = "generic"
- description = models.TextField(max_length=254,null=True, blank=True,help_text="Description of Service")
+ description = models.TextField(
+ max_length=254, null=True, blank=True, help_text="Description of Service")
enabled = models.BooleanField(default=True)
- kind = StrippedCharField(max_length=30, help_text="Kind of service", default=KIND)
+ kind = StrippedCharField(
+ max_length=30, help_text="Kind of service", default=KIND)
name = StrippedCharField(max_length=30, help_text="Service Name")
- versionNumber = StrippedCharField(max_length=30, help_text="Version of Service Definition")
+ versionNumber = StrippedCharField(
+ max_length=30, help_text="Version of Service Definition")
published = models.BooleanField(default=True)
view_url = StrippedCharField(blank=True, null=True, max_length=1024)
icon_url = StrippedCharField(blank=True, null=True, max_length=1024)
- public_key = models.TextField(null=True, blank=True, max_length=1024, help_text="Public key string")
+ public_key = models.TextField(
+ null=True, blank=True, max_length=1024, help_text="Public key string")
private_key_fn = StrippedCharField(blank=True, null=True, max_length=1024)
# Service_specific_attribute and service_specific_id are opaque to XOS
- service_specific_id = StrippedCharField(max_length=30, blank=True, null=True)
+ service_specific_id = StrippedCharField(
+ max_length=30, blank=True, null=True)
service_specific_attribute = models.TextField(blank=True, null=True)
def __init__(self, *args, **kwargs):
@@ -76,22 +88,23 @@
@classmethod
def get_service_objects(cls):
- return cls.objects.filter(kind = cls.KIND)
+ return cls.objects.filter(kind=cls.KIND)
@classmethod
def get_deleted_service_objects(cls):
- return cls.deleted_objects.filter(kind = cls.KIND)
+ return cls.deleted_objects.filter(kind=cls.KIND)
@classmethod
def get_service_objects_by_user(cls, user):
- return cls.select_by_user(user).filter(kind = cls.KIND)
+ return cls.select_by_user(user).filter(kind=cls.KIND)
@classmethod
def select_by_user(cls, user):
if user.is_admin:
return cls.objects.all()
else:
- service_ids = [sp.slice.id for sp in ServicePrivilege.objects.filter(user=user)]
+ service_ids = [
+ sp.slice.id for sp in ServicePrivilege.objects.filter(user=user)]
return cls.objects.filter(id__in=service_ids)
@property
@@ -115,12 +128,15 @@
exclusive_slices - list of slices that must have no nodes in common with 'slice'.
"""
- from core.models import Node, Instance # late import to get around order-of-imports constraint in __init__.py
+ # late import to get around order-of-imports constraint in __init__.py
+ from core.models import Node, Instance
nodes = list(Node.objects.all())
- conflicting_instances = Instance.objects.filter(slice__in = exclusive_slices)
- conflicting_nodes = Node.objects.filter(instances__in = conflicting_instances)
+ conflicting_instances = Instance.objects.filter(
+ slice__in=exclusive_slices)
+ conflicting_nodes = Node.objects.filter(
+ instances__in=conflicting_instances)
nodes = [x for x in nodes if x not in conflicting_nodes]
@@ -146,7 +162,8 @@
return nodes[0]
def adjust_scale(self, slice_hint, scale, max_per_node=None, exclusive_slices=[]):
- from core.models import Instance # late import to get around order-of-imports constraint in __init__.py
+ # late import to get around order-of-imports constraint in __init__.py
+ from core.models import Instance
slices = [x for x in self.slices.all() if slice_hint in x.name]
for slice in slices:
@@ -163,24 +180,26 @@
image = slice.default_image
if not image:
- raise XOSConfigurationError("No default_image for slice %s" % slice.name)
+ raise XOSConfigurationError(
+ "No default_image for slice %s" % slice.name)
flavor = slice.default_flavor
if not flavor:
- raise XOSConfigurationError("No default_flavor for slice %s" % slice.name)
+ raise XOSConfigurationError(
+ "No default_flavor for slice %s" % slice.name)
s = Instance(slice=slice,
- node=node,
- creator=slice.creator,
- image=image,
- flavor=flavor,
- deployment=node.site_deployment.deployment)
+ node=node,
+ creator=slice.creator,
+ image=image,
+ flavor=flavor,
+ deployment=node.site_deployment.deployment)
s.save()
# print "add instance", s
def get_vtn_src_nets(self):
- nets=[]
+ nets = []
for slice in self.slices.all():
for ns in slice.networkslices.all():
if not ns.network:
@@ -203,7 +222,7 @@
return nets
def get_vtn_nets(self):
- nets=[]
+ nets = []
for slice in self.slices.all():
for ns in slice.networkslices.all():
if not ns.network:
@@ -230,35 +249,39 @@
return [x["net_id"] for x in self.get_vtn_dependencies_nets()]
def get_vtn_dependencies_names(self):
- return [x["name"]+"_"+x["net_id"] for x in self.get_vtn_dependencies_nets()]
+ return [x["name"] + "_" + x["net_id"] for x in self.get_vtn_dependencies_nets()]
def get_vtn_src_ids(self):
return [x["net_id"] for x in self.get_vtn_src_nets()]
def get_vtn_src_names(self):
- return [x["name"]+"_"+x["net_id"] for x in self.get_vtn_src_nets()]
+ return [x["name"] + "_" + x["net_id"] for x in self.get_vtn_src_nets()]
class ServiceAttribute(PlCoreBase):
name = models.CharField(help_text="Attribute Name", max_length=128)
value = StrippedCharField(help_text="Attribute Value", max_length=1024)
- service = models.ForeignKey(Service, related_name='serviceattributes', help_text="The Service this attribute is associated with")
+ service = models.ForeignKey(Service, related_name='serviceattributes',
+ help_text="The Service this attribute is associated with")
+
class ServiceRole(PlCoreBase):
- ROLE_CHOICES = (('admin','Admin'),)
+ ROLE_CHOICES = (('admin', 'Admin'),)
role = StrippedCharField(choices=ROLE_CHOICES, unique=True, max_length=30)
- def __unicode__(self): return u'%s' % (self.role)
+ def __unicode__(self): return u'%s' % (self.role)
+
class ServicePrivilege(PlCoreBase):
user = models.ForeignKey('User', related_name='serviceprivileges')
service = models.ForeignKey('Service', related_name='serviceprivileges')
- role = models.ForeignKey('ServiceRole',related_name='serviceprivileges')
+ role = models.ForeignKey('ServiceRole', related_name='serviceprivileges')
class Meta:
- unique_together = ('user', 'service', 'role')
+ unique_together = ('user', 'service', 'role')
- def __unicode__(self): return u'%s %s %s' % (self.service, self.user, self.role)
+ def __unicode__(self): return u'%s %s %s' % (
+ self.service, self.user, self.role)
def can_update(self, user):
if not self.service.enabled:
@@ -283,17 +306,20 @@
qs = cls.objects.filter(user=user)
return qs
+
class TenantRoot(PlCoreBase, AttributeMixin):
""" A tenantRoot is one of the things that can sit at the root of a chain
of tenancy. This object represents a node.
"""
- KIND= "generic"
+ KIND = "generic"
kind = StrippedCharField(max_length=30, default=KIND)
- name = StrippedCharField(max_length=255, help_text="name", blank=True, null=True)
+ name = StrippedCharField(
+ max_length=255, help_text="name", blank=True, null=True)
service_specific_attribute = models.TextField(blank=True, null=True)
- service_specific_id = StrippedCharField(max_length=30, blank=True, null=True)
+ service_specific_id = StrippedCharField(
+ max_length=30, blank=True, null=True)
def __init__(self, *args, **kwargs):
# for subclasses, set the default kind appropriately
@@ -311,7 +337,7 @@
def get_subscribed_tenants(self, tenant_class):
ids = self.subscribed_tenants.filter(kind=tenant_class.KIND)
- return tenant_class.objects.filter(id__in = ids)
+ return tenant_class.objects.filter(id__in=ids)
def get_newest_subscribed_tenant(self, kind):
st = list(self.get_subscribed_tenants(kind))
@@ -321,31 +347,37 @@
@classmethod
def get_tenant_objects(cls):
- return cls.objects.filter(kind = cls.KIND)
+ return cls.objects.filter(kind=cls.KIND)
@classmethod
def get_tenant_objects_by_user(cls, user):
- return cls.select_by_user(user).filter(kind = cls.KIND)
+ return cls.select_by_user(user).filter(kind=cls.KIND)
@classmethod
def select_by_user(cls, user):
if user.is_admin:
return cls.objects.all()
else:
- tr_ids = [trp.tenant_root.id for trp in TenantRootPrivilege.objects.filter(user=user)]
+ tr_ids = [
+ trp.tenant_root.id for trp in TenantRootPrivilege.objects.filter(user=user)]
return cls.objects.filter(id__in=tr_ids)
- # helper function to be used in subclasses that want to ensure service_specific_id is unique
+ # helper function to be used in subclasses that want to ensure
+ # service_specific_id is unique
def validate_unique_service_specific_id(self, none_okay=False):
if not none_okay and (self.service_specific_id is None):
- raise XOSMissingField("subscriber_specific_id is None, and it's a required field", fields={"service_specific_id": "cannot be none"})
+ raise XOSMissingField("subscriber_specific_id is None, and it's a required field", fields={
+ "service_specific_id": "cannot be none"})
if self.service_specific_id:
- conflicts = self.get_tenant_objects().filter(service_specific_id=self.service_specific_id)
+ conflicts = self.get_tenant_objects().filter(
+ service_specific_id=self.service_specific_id)
if self.pk:
conflicts = conflicts.exclude(pk=self.pk)
if conflicts:
- raise XOSDuplicateKey("service_specific_id %s already exists" % self.service_specific_id, fields={"service_specific_id": "duplicate key"})
+ raise XOSDuplicateKey("service_specific_id %s already exists" % self.service_specific_id, fields={
+ "service_specific_id": "duplicate key"})
+
class Tenant(PlCoreBase, AttributeMixin):
""" A tenant is a relationship between two entities, a subscriber and a
@@ -358,29 +390,38 @@
TODO: rename "Tenant" to "Tenancy"
"""
- CONNECTIVITY_CHOICES = (('public', 'Public'), ('private', 'Private'), ('na', 'Not Applicable'))
+ CONNECTIVITY_CHOICES = (('public', 'Public'),
+ ('private', 'Private'), ('na', 'Not Applicable'))
# when subclassing a service, redefine KIND to describe the new service
KIND = "generic"
kind = StrippedCharField(max_length=30, default=KIND)
- provider_service = models.ForeignKey(Service, related_name='provided_tenants')
+ provider_service = models.ForeignKey(
+ Service, related_name='provided_tenants')
# The next four things are the various type of objects that can be subscribers of this Tenancy
# relationship. One and only one can be used at a time.
# XXX these should really be changed to GenericForeignKey
- subscriber_service = models.ForeignKey(Service, related_name='subscribed_tenants', blank=True, null=True)
- subscriber_tenant = models.ForeignKey("Tenant", related_name='subscribed_tenants', blank=True, null=True)
- subscriber_user = models.ForeignKey("User", related_name='subscribed_tenants', blank=True, null=True)
- subscriber_root = models.ForeignKey("TenantRoot", related_name="subscribed_tenants", blank=True, null=True)
- subscriber_network = models.ForeignKey("Network", related_name="subscribed_tenants", blank=True, null=True)
+ subscriber_service = models.ForeignKey(
+ Service, related_name='subscribed_tenants', blank=True, null=True)
+ subscriber_tenant = models.ForeignKey(
+ "Tenant", related_name='subscribed_tenants', blank=True, null=True)
+ subscriber_user = models.ForeignKey(
+ "User", related_name='subscribed_tenants', blank=True, null=True)
+ subscriber_root = models.ForeignKey(
+ "TenantRoot", related_name="subscribed_tenants", blank=True, null=True)
+ subscriber_network = models.ForeignKey(
+ "Network", related_name="subscribed_tenants", blank=True, null=True)
# Service_specific_attribute and service_specific_id are opaque to XOS
- service_specific_id = StrippedCharField(max_length=30, blank=True, null=True)
+ service_specific_id = StrippedCharField(
+ max_length=30, blank=True, null=True)
service_specific_attribute = models.TextField(blank=True, null=True)
# Connect_method is only used by Coarse tenants
- connect_method = models.CharField(null=False, blank=False, max_length=30, choices=CONNECTIVITY_CHOICES, default="na")
+ connect_method = models.CharField(
+ null=False, blank=False, max_length=30, choices=CONNECTIVITY_CHOICES, default="na")
def __init__(self, *args, **kwargs):
# for subclasses, set the default kind appropriately
@@ -392,15 +433,15 @@
@classmethod
def get_tenant_objects(cls):
- return cls.objects.filter(kind = cls.KIND)
+ return cls.objects.filter(kind=cls.KIND)
@classmethod
def get_tenant_objects_by_user(cls, user):
- return cls.select_by_user(user).filter(kind = cls.KIND)
+ return cls.select_by_user(user).filter(kind=cls.KIND)
@classmethod
def get_deleted_tenant_objects(cls):
- return cls.deleted_objects.filter(kind = cls.KIND)
+ return cls.deleted_objects.filter(kind=cls.KIND)
@property
def tenantattribute_dict(self):
@@ -409,26 +450,32 @@
attrs[attr.name] = attr.value
return attrs
- # helper function to be used in subclasses that want to ensure service_specific_id is unique
+ # helper function to be used in subclasses that want to ensure
+ # service_specific_id is unique
def validate_unique_service_specific_id(self):
if self.pk is None:
if self.service_specific_id is None:
- raise XOSMissingField("subscriber_specific_id is None, and it's a required field", fields={"service_specific_id": "cannot be none"})
+ raise XOSMissingField("subscriber_specific_id is None, and it's a required field", fields={
+ "service_specific_id": "cannot be none"})
- conflicts = self.get_tenant_objects().filter(service_specific_id=self.service_specific_id)
+ conflicts = self.get_tenant_objects().filter(
+ service_specific_id=self.service_specific_id)
if conflicts:
- raise XOSDuplicateKey("service_specific_id %s already exists" % self.service_specific_id, fields={"service_specific_id": "duplicate key"})
+ raise XOSDuplicateKey("service_specific_id %s already exists" % self.service_specific_id, fields={
+ "service_specific_id": "duplicate key"})
def save(self, *args, **kwargs):
- subCount = sum( [1 for e in [self.subscriber_service, self.subscriber_tenant, self.subscriber_user, self.subscriber_root] if e is not None])
+ subCount = sum([1 for e in [self.subscriber_service, self.subscriber_tenant,
+ self.subscriber_user, self.subscriber_root] if e is not None])
if (subCount > 1):
- raise XOSConflictingField("Only one of subscriber_service, subscriber_tenant, subscriber_user, subscriber_root should be set")
+ raise XOSConflictingField(
+ "Only one of subscriber_service, subscriber_tenant, subscriber_user, subscriber_root should be set")
super(Tenant, self).save(*args, **kwargs)
def get_subscribed_tenants(self, tenant_class):
ids = self.subscribed_tenants.filter(kind=tenant_class.KIND)
- return tenant_class.objects.filter(id__in = ids)
+ return tenant_class.objects.filter(id__in=ids)
def get_newest_subscribed_tenant(self, kind):
st = list(self.get_subscribed_tenants(kind))
@@ -436,6 +483,7 @@
return None
return sorted(st, key=attrgetter('id'))[0]
+
class Scheduler(object):
# XOS Scheduler Abstract Base Class
# Used to implement schedulers that pick which node to put instances on
@@ -451,8 +499,10 @@
raise Exception("Abstract Base")
+
class LeastLoadedNodeScheduler(Scheduler):
- # This scheduler always return the node with the fewest number of instances.
+ # This scheduler always return the node with the fewest number of
+ # instances.
def __init__(self, slice, label=None):
super(LeastLoadedNodeScheduler, self).__init__(slice)
@@ -463,28 +513,30 @@
nodes = Node.objects.all()
if self.label:
- nodes = nodes.filter(nodelabels__name=self.label)
+ nodes = nodes.filter(nodelabels__name=self.label)
nodes = list(nodes)
if not nodes:
- raise Exception("LeastLoadedNodeScheduler: No suitable nodes to pick from")
+ raise Exception(
+ "LeastLoadedNodeScheduler: No suitable nodes to pick from")
# TODO: logic to filter nodes by which nodes are up, and which
# nodes the slice can instantiate on.
nodes = sorted(nodes, key=lambda node: node.instances.all().count())
return [nodes[0], None]
+
class ContainerVmScheduler(Scheduler):
# This scheduler picks a VM in the slice with the fewest containers inside
# of it. If no VMs are suitable, then it creates a VM.
# this is a hack and should be replaced by something smarter...
- LOOK_FOR_IMAGES=["ubuntu-vcpe4", # ONOS demo machine -- preferred vcpe image
- "Ubuntu 14.04 LTS", # portal
- "Ubuntu-14.04-LTS", # ONOS demo machine
- "trusty-server-multi-nic", # CloudLab
- ]
+ LOOK_FOR_IMAGES = ["ubuntu-vcpe4", # ONOS demo machine -- preferred vcpe image
+ "Ubuntu 14.04 LTS", # portal
+ "Ubuntu-14.04-LTS", # ONOS demo machine
+ "trusty-server-multi-nic", # CloudLab
+ ]
MAX_VM_PER_CONTAINER = 10
@@ -497,11 +549,12 @@
look_for_images = self.LOOK_FOR_IMAGES
for image_name in look_for_images:
- images = Image.objects.filter(name = image_name)
+ images = Image.objects.filter(name=image_name)
if images:
return images[0]
- raise XOSProgrammingError("No ContainerVM image (looked for %s)" % str(look_for_images))
+ raise XOSProgrammingError(
+ "No ContainerVM image (looked for %s)" % str(look_for_images))
def make_new_instance(self):
from core.models import Instance, Flavor
@@ -510,16 +563,16 @@
if not flavors:
raise XOSConfigurationError("No m1.small flavor")
- (node,parent) = LeastLoadedNodeScheduler(self.slice).pick()
+ (node, parent) = LeastLoadedNodeScheduler(self.slice).pick()
- instance = Instance(slice = self.slice,
- node = node,
- image = self.image,
- creator = self.slice.creator,
- deployment = node.site_deployment.deployment,
- flavor = flavors[0],
- isolation = "vm",
- parent = parent)
+ instance = Instance(slice=self.slice,
+ node=node,
+ image=self.image,
+ creator=self.slice.creator,
+ deployment=node.site_deployment.deployment,
+ flavor=flavors[0],
+ isolation="vm",
+ parent=parent)
instance.save()
# We rely on a special naming convention to identify the VMs that will
# hole containers.
@@ -535,9 +588,9 @@
if (vm.name.startswith("%s-outer-" % self.slice.name)):
container_count = Instance.objects.filter(parent=vm).count()
if (container_count < self.MAX_VM_PER_CONTAINER):
- avail_vms.append( (vm, container_count) )
+ avail_vms.append((vm, container_count))
# sort by least containers-per-vm
- avail_vms = sorted(avail_vms, key = lambda x: x[1])
+ avail_vms = sorted(avail_vms, key=lambda x: x[1])
print "XXX", avail_vms
if avail_vms:
instance = avail_vms[0][0]
@@ -546,24 +599,25 @@
instance = self.make_new_instance()
return (instance.node, instance)
+
class TenantWithContainer(Tenant):
""" A tenant that manages a container """
# this is a hack and should be replaced by something smarter...
- LOOK_FOR_IMAGES=["ubuntu-vcpe4", # ONOS demo machine -- preferred vcpe image
- "Ubuntu 14.04 LTS", # portal
- "Ubuntu-14.04-LTS", # ONOS demo machine
- "trusty-server-multi-nic", # CloudLab
- ]
+ LOOK_FOR_IMAGES = ["ubuntu-vcpe4", # ONOS demo machine -- preferred vcpe image
+ "Ubuntu 14.04 LTS", # portal
+ "Ubuntu-14.04-LTS", # ONOS demo machine
+ "trusty-server-multi-nic", # CloudLab
+ ]
- LOOK_FOR_CONTAINER_IMAGES=["docker-vcpe"]
+ LOOK_FOR_CONTAINER_IMAGES = ["docker-vcpe"]
class Meta:
proxy = True
def __init__(self, *args, **kwargs):
super(TenantWithContainer, self).__init__(*args, **kwargs)
- self.cached_instance=None
+ self.cached_instance = None
self.orig_instance_id = self.get_initial_attribute("instance_id")
@property
@@ -571,13 +625,13 @@
from core.models import Instance
if getattr(self, "cached_instance", None):
return self.cached_instance
- instance_id=self.get_attribute("instance_id")
+ instance_id = self.get_attribute("instance_id")
if not instance_id:
return None
- instances=Instance.objects.filter(id=instance_id)
+ instances = Instance.objects.filter(id=instance_id)
if not instances:
return None
- instance=instances[0]
+ instance = instances[0]
instance.caller = self.creator
self.cached_instance = instance
return instance
@@ -587,7 +641,7 @@
if value:
value = value.id
if (value != self.get_attribute("instance_id", None)):
- self.cached_instance=None
+ self.cached_instance = None
self.set_attribute("instance_id", value)
@property
@@ -611,13 +665,13 @@
from core.models import User
if getattr(self, "cached_creator", None):
return self.cached_creator
- creator_id=self.get_attribute("creator_id")
+ creator_id = self.get_attribute("creator_id")
if not creator_id:
return None
- users=User.objects.filter(id=creator_id)
+ users = User.objects.filter(id=creator_id)
if not users:
return None
- user=users[0]
+ user = users[0]
self.cached_creator = users[0]
return user
@@ -626,7 +680,7 @@
if value:
value = value.id
if (value != self.get_attribute("creator_id", None)):
- self.cached_creator=None
+ self.cached_creator = None
self.set_attribute("creator_id", value)
@property
@@ -646,11 +700,12 @@
look_for_images = self.LOOK_FOR_IMAGES
for image_name in look_for_images:
- images = Image.objects.filter(name = image_name)
+ images = Image.objects.filter(name=image_name)
if images:
return images[0]
- raise XOSProgrammingError("No VPCE image (looked for %s)" % str(look_for_images))
+ raise XOSProgrammingError(
+ "No VPCE image (looked for %s)" % str(look_for_images))
def save_instance(self, instance):
# Override this function to do custom pre-save or post-save processing,
@@ -661,14 +716,14 @@
for slice in slices:
if slice.instances.all().count() > 0:
for instance in slice.instances.all():
- #Pick the first instance that has lesser than 5 tenants
- if self.count_of_tenants_of_an_instance(instance) < 5:
- return instance
+ # Pick the first instance that has lesser than 5 tenants
+ if self.count_of_tenants_of_an_instance(instance) < 5:
+ return instance
return None
- #TODO: Ideally the tenant count for an instance should be maintained using a
- #many-to-one relationship attribute, however this model being proxy, it does
- #not permit any new attributes to be defined. Find if any better solutions
+ # TODO: Ideally the tenant count for an instance should be maintained using a
+ # many-to-one relationship attribute, however this model being proxy, it does
+ # not permit any new attributes to be defined. Find if any better solutions
def count_of_tenants_of_an_instance(self, instance):
tenant_count = 0
for tenant in self.get_tenant_objects().all():
@@ -693,7 +748,7 @@
new_instance_created = False
instance = None
if self.get_attribute("use_same_instance_for_multiple_tenants", default=False):
- #Find if any existing instances can be used for this tenant
+ # Find if any existing instances can be used for this tenant
slices = self.provider_service.slices.all()
instance = self.pick_least_loaded_instance_in_slice(slices)
@@ -712,14 +767,14 @@
else:
(node, parent) = LeastLoadedNodeScheduler(slice).pick()
- instance = Instance(slice = slice,
- node = node,
- image = self.image,
- creator = self.creator,
- deployment = node.site_deployment.deployment,
- flavor = flavor,
- isolation = slice.default_isolation,
- parent = parent)
+ instance = Instance(slice=slice,
+ node=node,
+ image=self.image,
+ creator=self.creator,
+ deployment=node.site_deployment.deployment,
+ flavor=flavor,
+ isolation=slice.default_isolation,
+ parent=parent)
self.save_instance(instance)
new_instance_created = True
@@ -734,8 +789,10 @@
def cleanup_container(self):
if self.instance:
if self.get_attribute("use_same_instance_for_multiple_tenants", default=False):
- #Delete the instance only if this is last tenant in that instance
- tenant_count = self.count_of_tenants_of_an_instance(self.instance)
+ # Delete the instance only if this is last tenant in that
+ # instance
+ tenant_count = self.count_of_tenants_of_an_instance(
+ self.instance)
if tenant_count == 0:
self.instance.delete()
else:
@@ -747,6 +804,7 @@
self.creator = self.caller
super(TenantWithContainer, self).save(*args, **kwargs)
+
class CoarseTenant(Tenant):
""" TODO: rename "CoarseTenant" --> "StaticTenant" """
class Meta:
@@ -758,9 +816,11 @@
if (not self.subscriber_service):
raise XOSValidationError("subscriber_service cannot be null")
if (self.subscriber_tenant or self.subscriber_user):
- raise XOSValidationError("subscriber_tenant and subscriber_user must be null")
+ raise XOSValidationError(
+ "subscriber_tenant and subscriber_user must be null")
- super(CoarseTenant,self).save()
+ super(CoarseTenant, self).save()
+
class Subscriber(TenantRoot):
""" Intermediate class for TenantRoots that are to be Subscribers """
@@ -770,6 +830,7 @@
KIND = "Subscriber"
+
class Provider(TenantRoot):
""" Intermediate class for TenantRoots that are to be Providers """
@@ -778,29 +839,36 @@
KIND = "Provider"
+
class TenantAttribute(PlCoreBase):
name = models.CharField(help_text="Attribute Name", max_length=128)
value = models.TextField(help_text="Attribute Value")
- tenant = models.ForeignKey(Tenant, related_name='tenantattributes', help_text="The Tenant this attribute is associated with")
+ tenant = models.ForeignKey(Tenant, related_name='tenantattributes',
+ help_text="The Tenant this attribute is associated with")
def __unicode__(self): return u'%s-%s' % (self.name, self.id)
+
class TenantRootRole(PlCoreBase):
- ROLE_CHOICES = (('admin','Admin'), ('access','Access'))
+ ROLE_CHOICES = (('admin', 'Admin'), ('access', 'Access'))
role = StrippedCharField(choices=ROLE_CHOICES, unique=True, max_length=30)
- def __unicode__(self): return u'%s' % (self.role)
+ def __unicode__(self): return u'%s' % (self.role)
+
class TenantRootPrivilege(PlCoreBase):
user = models.ForeignKey('User', related_name="tenant_root_privileges")
- tenant_root = models.ForeignKey('TenantRoot', related_name="tenant_root_privileges")
- role = models.ForeignKey('TenantRootRole', related_name="tenant_root_privileges")
+ tenant_root = models.ForeignKey(
+ 'TenantRoot', related_name="tenant_root_privileges")
+ role = models.ForeignKey(
+ 'TenantRootRole', related_name="tenant_root_privileges")
class Meta:
unique_together = ('user', 'tenant_root', 'role')
- def __unicode__(self): return u'%s %s %s' % (self.tenant_root, self.user, self.role)
+ def __unicode__(self): return u'%s %s %s' % (
+ self.tenant_root, self.user, self.role)
def save(self, *args, **kwds):
if not self.user.is_active:
@@ -820,8 +888,7 @@
# A slice admin can see the SlicePrivileges for his Slice
for priv in cls.objects.filter(user=user, role__role="admin"):
- trp_ids.extend( [trp.id for trp in cls.objects.filter(tenant_root=priv.tenant_root)] )
+ trp_ids.extend(
+ [trp.id for trp in cls.objects.filter(tenant_root=priv.tenant_root)])
return cls.objects.filter(id__in=trp_ids)
-
-
diff --git a/xos/core/models/user.py b/xos/core/models/user.py
index 4acad99..f1d73d2 100644
--- a/xos/core/models/user.py
+++ b/xos/core/models/user.py
@@ -1,21 +1,22 @@
-import os
import datetime
-import sys
import hashlib
+import os
+import sys
from collections import defaultdict
-from django.forms.models import model_to_dict
+from operator import attrgetter, itemgetter
+
+import synchronizers.model_policy
+from core.middleware import get_request
+from core.models import DashboardView, PlCoreBase, PlModelMixIn, Site
+from core.models.plcorebase import StrippedCharField
+from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
+from django.core.exceptions import PermissionDenied
+from django.core.mail import EmailMultiAlternatives
from django.db import models
from django.db.models import F, Q
+from django.forms.models import model_to_dict
from django.utils import timezone
-from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
-from django.core.mail import EmailMultiAlternatives
-from django.core.exceptions import PermissionDenied
-from core.models import PlCoreBase,Site, DashboardView, PlModelMixIn
-from core.models.plcorebase import StrippedCharField
from timezones.fields import TimeZoneField
-from operator import itemgetter, attrgetter
-from core.middleware import get_request
-import synchronizers.model_policy
# ------ from plcorebase.py ------
try:
@@ -32,7 +33,10 @@
# ------ ------
# Create your models here.
+
+
class UserManager(BaseUserManager):
+
def create_user(self, email, firstname, lastname, password=None):
"""
Creates and saves a User with the given email, date of
@@ -47,7 +51,7 @@
lastname=lastname,
password=password
)
- #user.set_password(password)
+ # user.set_password(password)
user.is_admin = True
user.save(using=self._db)
return user
@@ -58,16 +62,16 @@
birth and password.
"""
user = self.create_user(email,
- password=password,
- firstname=firstname,
- lastname=lastname
- )
+ password=password,
+ firstname=firstname,
+ lastname=lastname
+ )
user.is_admin = True
user.save(using=self._db)
return user
def get_queryset(self):
- parent=super(UserManager, self)
+ parent = super(UserManager, self)
if hasattr(parent, "get_queryset"):
return parent.get_queryset().filter(deleted=False)
else:
@@ -77,7 +81,9 @@
def get_query_set(self):
return self.get_queryset()
+
class DeletedUserManager(UserManager):
+
def get_queryset(self):
return super(UserManager, self).get_query_set().filter(deleted=True)
@@ -85,7 +91,9 @@
def get_query_set(self):
return self.get_queryset()
+
class User(AbstractBaseUser, PlModelMixIn):
+
@property
def remote_password(self):
return hashlib.md5(self.password).hexdigest()[:12]
@@ -100,15 +108,19 @@
db_index=True,
)
- username = StrippedCharField(max_length=255, default="Something" )
+ username = StrippedCharField(max_length=255, default="Something")
- firstname = StrippedCharField(help_text="person's given name", max_length=200)
+ firstname = StrippedCharField(
+ help_text="person's given name", max_length=200)
lastname = StrippedCharField(help_text="person's surname", max_length=200)
- phone = StrippedCharField(null=True, blank=True, help_text="phone number contact", max_length=100)
+ phone = StrippedCharField(null=True, blank=True,
+ help_text="phone number contact", max_length=100)
user_url = models.URLField(null=True, blank=True)
- site = models.ForeignKey(Site, related_name='users', help_text="Site this user will be homed too")
- public_key = models.TextField(null=True, blank=True, max_length=1024, help_text="Public key string")
+ site = models.ForeignKey(Site, related_name='users',
+ help_text="Site this user will be homed too")
+ public_key = models.TextField(
+ null=True, blank=True, max_length=1024, help_text="Public key string")
is_active = models.BooleanField(default=True)
is_admin = models.BooleanField(default=False)
@@ -117,14 +129,15 @@
is_registering = models.BooleanField(default=False)
is_appuser = models.BooleanField(default=False)
- login_page = StrippedCharField(help_text="send this user to a specific page on login", max_length=200, null=True, blank=True)
+ login_page = StrippedCharField(
+ help_text="send this user to a specific page on login", max_length=200, null=True, blank=True)
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
enacted = models.DateTimeField(null=True, default=None)
policed = models.DateTimeField(null=True, default=None)
backend_status = StrippedCharField(max_length=1024,
- default="Provisioning in progress")
+ default="Provisioning in progress")
deleted = models.BooleanField(default=False)
write_protect = models.BooleanField(default=False)
lazy_blocked = models.BooleanField(default=False)
@@ -133,7 +146,8 @@
timezone = TimeZoneField()
- dashboards = models.ManyToManyField('DashboardView', through='UserDashboardView', blank=True)
+ dashboards = models.ManyToManyField(
+ 'DashboardView', through='UserDashboardView', blank=True)
objects = UserManager()
deleted_objects = DeletedUserManager()
@@ -142,11 +156,12 @@
REQUIRED_FIELDS = ['firstname', 'lastname']
PI_FORBIDDEN_FIELDS = ["is_admin", "site", "is_staff"]
- USER_FORBIDDEN_FIELDS = ["is_admin", "is_active", "site", "is_staff", "is_readonly"]
+ USER_FORBIDDEN_FIELDS = ["is_admin", "is_active",
+ "site", "is_staff", "is_readonly"]
def __init__(self, *args, **kwargs):
super(User, self).__init__(*args, **kwargs)
- self._initial = self._dict # for PlModelMixIn
+ self._initial = self._dict # for PlModelMixIn
def isReadOnlyUser(self):
return self.is_readonly
@@ -161,21 +176,21 @@
def delete(self, *args, **kwds):
# so we have something to give the observer
- purge = kwds.get('purge',False)
+ purge = kwds.get('purge', False)
if purge:
del kwds['purge']
try:
purge = purge or observer_disabled
except NameError:
pass
-
+
if (purge):
super(User, self).delete(*args, **kwds)
else:
if (not self.write_protect):
- self.deleted = True
- self.enacted=None
- self.save(update_fields=['enacted','deleted'])
+ self.deleted = True
+ self.enacted = None
+ self.save(update_fields=['enacted', 'deleted'])
@property
def keyname(self):
@@ -198,9 +213,10 @@
return False
def get_dashboards(self):
- DEFAULT_DASHBOARDS=["Tenant"]
+ DEFAULT_DASHBOARDS = ["Tenant"]
- dashboards = sorted(list(self.userdashboardviews.all()), key=attrgetter('order'))
+ dashboards = sorted(
+ list(self.userdashboardviews.all()), key=attrgetter('order'))
dashboards = [x.dashboardView for x in dashboards]
if (not dashboards) and (not self.is_appuser):
@@ -222,14 +238,14 @@
# roles[site_privilege.role.role_type].append(site_privilege.site.login_base)
# for slice_membership in slice_memberships:
# roles[slice_membership.role.role_type].append(slice_membership.slice.name)
-# return roles
+# return roles
def save(self, *args, **kwds):
if not self.id:
self.set_password(self.password)
if self.is_active and self.is_registering:
self.send_temporary_password()
- self.is_registering=False
+ self.is_registering = False
self.username = self.email
super(User, self).save(*args, **kwds)
@@ -239,11 +255,14 @@
def send_temporary_password(self):
password = User.objects.make_random_password()
self.set_password(password)
- subject, from_email, to = 'OpenCloud Account Credentials', 'support@opencloud.us', str(self.email)
+ subject, from_email, to = 'OpenCloud Account Credentials', 'support@opencloud.us', str(
+ self.email)
text_content = 'This is an important message.'
- userUrl="http://%s/" % get_request().get_host()
- html_content = """<p>Your account has been created on OpenCloud. Please log in <a href="""+userUrl+""">here</a> to activate your account<br><br>Username: """+self.email+"""<br>Temporary Password: """+password+"""<br>Please change your password once you successully login into the site.</p>"""
- msg = EmailMultiAlternatives(subject,text_content, from_email, [to])
+ userUrl = "http://%s/" % get_request().get_host()
+ html_content = """<p>Your account has been created on OpenCloud. Please log in <a href=""" + userUrl + """>here</a> to activate your account<br><br>Username: """ + \
+ self.email + """<br>Temporary Password: """ + password + \
+ """<br>Please change your password once you successully login into the site.</p>"""
+ msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
msg.attach_alternative(html_content, "text/html")
msg.send()
@@ -257,7 +276,7 @@
site_privs = SitePrivilege.objects.filter(user=user, site=self.site)
for site_priv in site_privs:
if site_priv.role.role == 'admin':
- return True
+ return True
if site_priv.role.role == 'pi':
for fieldName in self.diff.keys():
if fieldName in self.PI_FORBIDDEN_FIELDS:
@@ -282,29 +301,29 @@
if self.is_admin:
return True
- return False
+ return False
def can_update_deployment(self, deployment):
from core.models.site import DeploymentPrivilege
if self.can_update_root():
- return True
-
- if DeploymentPrivilege.objects.filter(
- deployment=deployment,
- user=self,
- role__role__in=['admin', 'Admin']):
return True
- return False
+
+ if DeploymentPrivilege.objects.filter(
+ deployment=deployment,
+ user=self,
+ role__role__in=['admin', 'Admin']):
+ return True
+ return False
def can_update_site(self, site, allow=[]):
from core.models.site import SitePrivilege
if self.can_update_root():
return True
if SitePrivilege.objects.filter(
- site=site, user=self, role__role__in=['admin', 'Admin']+allow):
+ site=site, user=self, role__role__in=['admin', 'Admin'] + allow):
return True
return False
-
+
def can_update_slice(self, slice):
from core.models.slice import SlicePrivilege
if self.can_update_root():
@@ -313,9 +332,9 @@
return True
if self.can_update_site(slice.site, allow=['pi']):
return True
-
+
if SlicePrivilege.objects.filter(
- slice=slice, user=self, role__role__in=['admin', 'Admin']):
+ slice=slice, user=self, role__role__in=['admin', 'Admin']):
return True
return False
@@ -324,7 +343,7 @@
if self.can_update_root():
return True
if ServicePrivilege.objects.filter(
- service=service, user=self, role__role__in=['admin', 'Admin']+allow):
+ service=service, user=self, role__role__in=['admin', 'Admin'] + allow):
return True
return False
@@ -333,7 +352,7 @@
if self.can_update_root():
return True
if TenantRootPrivilege.objects.filter(
- tenant_root=tenant_root, user=self, role__role__in=['admin', 'Admin']+allow):
+ tenant_root=tenant_root, user=self, role__role__in=['admin', 'Admin'] + allow):
return True
return False
@@ -341,31 +360,32 @@
return self.can_update_tenant_root(tenant_root_privilege.tenant_root, allow)
def get_readable_objects(self, filter_by=None):
- """ Returns a list of objects that the user is allowed to read. """
- from core.models import Deployment, Flavor, Image, Network, NetworkTemplate, Node, PlModelMixIn, Site, Slice, SliceTag, Instance, Tag, User, DeploymentPrivilege, SitePrivilege, SlicePrivilege
- models = []
- if filter_by and isinstance(filter_by, list):
- models = [m for m in filter_by if issubclass(m, PlModelMixIn)]
- if not models:
- models = [Deployment, Network, Site, Slice, SliceTag, Instance, Tag, User]
- readable_objects = []
- for model in models:
- readable_objects.extend(model.select_by_user(self))
- return readable_objects
+ """ Returns a list of objects that the user is allowed to read. """
+ from core.models import Deployment, Flavor, Image, Network, NetworkTemplate, Node, PlModelMixIn, Site, Slice, SliceTag, Instance, Tag, User, DeploymentPrivilege, SitePrivilege, SlicePrivilege
+ models = []
+ if filter_by and isinstance(filter_by, list):
+ models = [m for m in filter_by if issubclass(m, PlModelMixIn)]
+ if not models:
+ models = [Deployment, Network, Site,
+ Slice, SliceTag, Instance, Tag, User]
+ readable_objects = []
+ for model in models:
+ readable_objects.extend(model.select_by_user(self))
+ 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.
Permissions will be either 'r' or 'rw'.
-
+
e.g.
[{'object': django_object_instance, 'permissions': 'rw'}, ...]
Returns:
list of dicts
-
+
"""
- from core.models import Deployment, Flavor, Image, Network, NetworkTemplate, Node, PlModelMixIn, Site, Slice, SliceTag, Instance, Tag, User, DeploymentPrivilege, SitePrivilege, SlicePrivilege
+ from core.models import Deployment, Flavor, Image, Network, NetworkTemplate, Node, PlModelMixIn, Site, Slice, SliceTag, Instance, Tag, User, DeploymentPrivilege, SitePrivilege, SlicePrivilege
READ = 'r'
READWRITE = 'rw'
models = []
@@ -374,35 +394,35 @@
deployment_priv_objs = [Image, NetworkTemplate, Flavor]
site_priv_objs = [Node, Slice, User]
- slice_priv_objs = [Instance, Network]
-
+ slice_priv_objs = [Instance, Network]
+
# maps the set of objects a paticular role has write access
write_map = {
- DeploymentPrivilege : {
+ DeploymentPrivilege: {
'admin': deployment_priv_objects,
},
- SitePrivilege : {
- 'admin' : site_priv_objs,
- 'pi' : [Slice, User],
+ SitePrivilege: {
+ 'admin': site_priv_objs,
+ 'pi': [Slice, User],
'tech': [Node],
- },
- SlicePrivilege : {
- 'admin': slice_priv_objs,
- },
+ },
+ SlicePrivilege: {
+ 'admin': slice_priv_objs,
+ },
}
-
+
privilege_map = {
- DeploymentPrivilege : (Deployment, deployment_priv_objs),
- SitePrivilege : (Site, site_priv_objs),
- SlicePrivilege : (Slice, slice_priv_objs)
+ DeploymentPrivilege: (Deployment, deployment_priv_objs),
+ SitePrivilege: (Site, site_priv_objs),
+ SlicePrivilege: (Slice, slice_priv_objs)
}
permissions = []
- permission_dict = lambda x,y: {'object': x, 'permission': y}
+ permission_dict = lambda x, y: {'object': x, 'permission': y}
for privilege_model, (model, affected_models) in privileg_map.items():
if models and model not in models:
continue
- # get the objects affected by this privilege model
+ # get the objects affected by this privilege model
affected_objects = []
for affected_model in affected_models:
affected_objects.extend(affected_model.select_by_user(self))
@@ -410,10 +430,11 @@
if self.is_admin:
# assume admin users have read/write access to all objects
for affected_object in affected_objects:
- permissions.append(permission_dict(affected_object, READWRITE))
+ permissions.append(permission_dict(
+ affected_object, READWRITE))
else:
# create a dict of the user's per object privileges
- # ex: {princeton_tmack : ['admin']
+ # ex: {princeton_tmack : ['admin']
privileges = privilege_model.objects.filter(user=self)
for privilege in privileges:
object_roles = defaultdict(list)
@@ -424,32 +445,33 @@
obj = getattr(privilege, field)
if obj:
object_roles[obj].append(privilege.role.role)
-
+
# loop through all objects the user has access to and determine
# if they also have write access
for affected_object in affected_objects:
if affected_object not in objects_roles:
- permissions.append(permission_dict(affected_object, READ))
+ permissions.append(
+ permission_dict(affected_object, READ))
else:
has_write_permission = False
for write_role, models in write_dict.items():
if affected_object._meta.model in models and \
- write_role in object_roles[affected_object]:
- has_write_permission = True
- break
+ write_role in object_roles[affected_object]:
+ has_write_permission = True
+ break
if has_write_permission:
- permissions.append(permission_dict(affected_object, WRITE))
+ permissions.append(
+ permission_dict(affected_object, WRITE))
else:
- permissions.append(permission_dict(affected_object, READ))
-
- return permissions
-
+ permissions.append(
+ permission_dict(affected_object, READ))
+
+ return permissions
def get_tenant_permissions(self):
from core.models import Site, Slice
- return self.get_object_permissions(filter_by=[Site,Slice])
+ return self.get_object_permissions(filter_by=[Site, Slice])
-
@staticmethod
def select_by_user(user):
if user.is_admin:
@@ -458,7 +480,8 @@
# can see all users at any site where this user has pi role
from core.models.site import SitePrivilege
site_privs = SitePrivilege.objects.filter(user=user)
- sites = [sp.site for sp in site_privs if sp.role.role in ['Admin', 'admin', 'pi']]
+ sites = [sp.site for sp in site_privs if sp.role.role in [
+ 'Admin', 'admin', 'pi']]
# get site privs of users at these sites
site_privs = SitePrivilege.objects.filter(site__in=sites)
user_ids = [sp.user.id for sp in site_privs] + [user.id]
@@ -468,29 +491,34 @@
def save_by_user(self, user, *args, **kwds):
if not self.can_update(user):
if getattr(self, "_cant_update_fieldName", None) is not None:
- raise PermissionDenied("You do not have permission to update field %s on object %s" % (self._cant_update_fieldName, self.__class__.__name__))
+ raise PermissionDenied("You do not have permission to update field %s on object %s" % (
+ self._cant_update_fieldName, self.__class__.__name__))
else:
- raise PermissionDenied("You do not have permission to update %s objects" % self.__class__.__name__)
+ raise PermissionDenied(
+ "You do not have permission to update %s objects" % self.__class__.__name__)
self.save(*args, **kwds)
def delete_by_user(self, user, *args, **kwds):
if not self.can_update(user):
- raise PermissionDenied("You do not have permission to delete %s objects" % self.__class__.__name__)
+ raise PermissionDenied(
+ "You do not have permission to delete %s objects" % self.__class__.__name__)
self.delete(*args, **kwds)
def apply_profile(self, profile):
- if profile=="regular":
+ if profile == "regular":
self.is_appuser = False
self.is_admin = False
- elif profile=="cp":
+ elif profile == "cp":
self.is_appuser = True
self.is_admin = False
for db in self.userdashboardviews.all():
db.delete()
+
class UserDashboardView(PlCoreBase):
- user = models.ForeignKey(User, related_name='userdashboardviews')
- dashboardView = models.ForeignKey(DashboardView, related_name='userdashboardviews')
- order = models.IntegerField(default=0)
+ user = models.ForeignKey(User, related_name='userdashboardviews')
+ dashboardView = models.ForeignKey(
+ DashboardView, related_name='userdashboardviews')
+ order = models.IntegerField(default=0)
diff --git a/xos/synchronizers/onos/steps/sync_onosapp.py b/xos/synchronizers/onos/steps/sync_onosapp.py
index 1fc6579..77c9e91 100644
--- a/xos/synchronizers/onos/steps/sync_onosapp.py
+++ b/xos/synchronizers/onos/steps/sync_onosapp.py
@@ -16,6 +16,7 @@
from core.models import Service, Slice, Controller, ControllerSlice, ControllerUser, Node, TenantAttribute, Tag
from services.onos.models import ONOSService, ONOSApp
from xos.logger import Logger, logging
+from services.vrouter.models import VRouterService
# hpclibrary will be in steps/..
parentdir = os.path.join(os.path.dirname(__file__),"..")
@@ -226,14 +227,17 @@
data["apps"]["org.onosproject.cordvtn"]["cordvtn"]["nodes"].append(node_dict)
# Generate apps->org.onosproject.cordvtn->cordvtn->publicGateways
- # This should come from the vRouter service, but stick it in an attribute for now
- gatewayIp = self.attribute_default(o, attrs, "gatewayIp", "10.168.0.1")
- gatewayMac = self.attribute_default(o, attrs, "gatewayMac", "02:42:0a:a8:00:01")
- gateway_dict = {
- "gatewayIp": gatewayIp,
- "gatewayMac": gatewayMac
- }
- data["apps"]["org.onosproject.cordvtn"]["cordvtn"]["publicGateways"].append(gateway_dict)
+ # Pull the gateway information from vRouter
+ vrouters = VRouterService.get_service_objects().all()
+ if vrouters:
+ for gateway in vrouters[0].get_gateways():
+ gatewayIp = gateway['gateway_ip'].split('/',1)[0]
+ gatewayMac = gateway['gateway_mac']
+ gateway_dict = {
+ "gatewayIp": gatewayIp,
+ "gatewayMac": gatewayMac
+ }
+ data["apps"]["org.onosproject.cordvtn"]["cordvtn"]["publicGateways"].append(gateway_dict)
return json.dumps(data, indent=4, sort_keys=True)
diff --git a/xos/tests/api/.gitignore b/xos/tests/api/.gitignore
deleted file mode 100644
index 3c3629e..0000000
--- a/xos/tests/api/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
diff --git a/xos/tests/api/apiary.apib b/xos/tests/api/apiary.apib
index 43a81c7..fb917bc 100644
--- a/xos/tests/api/apiary.apib
+++ b/xos/tests/api/apiary.apib
@@ -3,6 +3,23 @@
# XOS
+# Group Example
+
+## Example Services Collection [/api/service/exampleservice/]
+
+### List all Example Services [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "MyExample",
+ "id": 1,
+ "service_message": "This is the test message"
+ }
+ ]
+
+
# Group ONOS Services
## ONOS Services Collection [/api/service/onos/]
diff --git a/xos/tests/api/helpers/subscriber.py b/xos/tests/api/helpers/subscriber.py
index 0ff02c2..4ede030 100644
--- a/xos/tests/api/helpers/subscriber.py
+++ b/xos/tests/api/helpers/subscriber.py
@@ -60,6 +60,9 @@
for s in NetworkSlice.objects.all():
s.delete(purge=True)
+ for s in AddressPool.objects.all():
+ s.delete(purge=True)
+
print 'DB Cleaned'
@@ -79,6 +82,22 @@
subscriber = CordSubscriberRoot(name='Test Subscriber 1', id=1)
subscriber.save()
+ # vRouter service
+ vrouter_service = VRouterService()
+ vrouter_service.name = 'service_vrouter'
+ vrouter_service.save()
+
+ # address pools
+ ap_vsg = AddressPool()
+ ap_vsg.service = vrouter_service
+ ap_vsg.name = 'addresses_vsg'
+ ap_vsg.addresses = '10.168.0.0'
+ ap_vsg.gateway_ip = '10.168.0.1'
+ ap_vsg.gateway_mac = '02:42:0a:a8:00:01'
+ ap_vsg.save()
+
+ print 'vRouter created'
+
# Site
site = Site.objects.get(name='MySite')
@@ -102,6 +121,7 @@
volt_service.name = 'service_volt'
volt_service.save()
+
# vcpe slice
vcpe_slice = Slice()
vcpe_slice.name = site.login_base + "_testVcpe"
@@ -110,7 +130,7 @@
vcpe_slice.caller = user
vcpe_slice.save()
- print 'vcpe_slice created'
+ # print 'vcpe_slice created'
# create a lan network
lan_net = Network()
@@ -119,7 +139,7 @@
lan_net.template = private_template
lan_net.save()
- print 'lan_network created'
+ # print 'lan_network created'
# add relation between vcpe slice and lan network
vcpe_network = NetworkSlice()
@@ -127,14 +147,14 @@
vcpe_network.slice = vcpe_slice
vcpe_network.save()
- print 'vcpe network relation added'
+ # print 'vcpe network relation added'
# vbng service
vbng_service = VBNGService()
vbng_service.name = 'service_vbng'
vbng_service.save()
- print 'vbng_service creater'
+ # print 'vbng_service creater'
# volt tenant
vt = VOLTTenant(subscriber=subscriber.id, id=1)
diff --git a/xos/tests/api/hooks.py b/xos/tests/api/hooks.py
index 6779014..e327852 100644
--- a/xos/tests/api/hooks.py
+++ b/xos/tests/api/hooks.py
@@ -51,6 +51,9 @@
for s in NetworkSlice.objects.all():
s.delete(purge=True)
+ for s in AddressPool.objects.all():
+ s.delete(purge=True)
+
# print 'DB Cleaned'
@@ -70,6 +73,22 @@
subscriber = CordSubscriberRoot(name='Test Subscriber 1', id=1)
subscriber.save()
+ # vRouter service
+ vrouter_service = VRouterService()
+ vrouter_service.name = 'service_vrouter'
+ vrouter_service.save()
+
+ # address pools
+ ap_vsg = AddressPool()
+ ap_vsg.service = vrouter_service
+ ap_vsg.name = 'addresses_vsg'
+ ap_vsg.addresses = '10.168.0.0'
+ ap_vsg.gateway_ip = '10.168.0.1'
+ ap_vsg.gateway_mac = '02:42:0a:a8:00:01'
+ ap_vsg.save()
+
+ # print 'vRouter created'
+
# Site
site = Site.objects.get(name='MySite')
@@ -164,6 +183,7 @@
@hooks.before_each
def my_before_each_hook(transaction):
# print "-------------------------------- Before Each Hook --------------------------------"
+ # print transaction['name']
auth = doLogin('padmin@vicci.org', 'letmein')
transaction['request']['headers']['X-CSRFToken'] = auth['token']
transaction['request']['headers']['Cookie'] = "xossessionid=%s; xoscsrftoken=%s" % (auth['sessionid'], auth['token'])
@@ -192,3 +212,8 @@
def test4(transaction):
# transaction['skip'] = True
VOLTTenant.objects.get(kind='vOLT').delete()
+
+
+@hooks.before("Example > Example Services Collection > List all Example Services")
+def exampleTest(transaction):
+ transaction['skip'] = True
diff --git a/xos/tests/api/source/service/exampleservice.md b/xos/tests/api/source/service/exampleservice.md
new file mode 100644
index 0000000..96a19c7
--- /dev/null
+++ b/xos/tests/api/source/service/exampleservice.md
@@ -0,0 +1,15 @@
+# Group Example
+
+## Example Services Collection [/api/service/exampleservice/]
+
+### List all Example Services [GET]
+
++ Response 200 (application/json)
+
+ [
+ {
+ "humanReadableName": "MyExample",
+ "id": 1,
+ "service_message": "This is the test message"
+ }
+ ]
\ No newline at end of file
diff --git a/xos/xos/xml_util.py b/xos/xos/xml_util.py
index d3aefb1..77b968f 100644
--- a/xos/xos/xml_util.py
+++ b/xos/xos/xml_util.py
@@ -113,8 +113,8 @@
specified root_node if specified, otherwise start at tree's root.
"""
- if not element_name.startswith('//'):
- element_name = '//' + element_name
+ if not name.startswith('//'):
+ name = '//' + name
elements = self.element.xpath('%s ' % name, namespaces=self.namespaces)
for element in elements:
parent = element.getparent()