Merge remote-tracking branch 'origin/master' into feature/lts
diff --git a/apiary.apib b/apiary.apib
index fe1b221..ee28967 100644
--- a/apiary.apib
+++ b/apiary.apib
@@ -323,6 +323,40 @@
         
  
  
+# Group Utility
+
+List of the XOS Utility API
+
+## Login [/api/utility/login/]
+
+### Log a user in the system [POST]
+
++ Request (application/json)
+
+        {
+            "username": "padmin@vicci.org",
+            "password": "letmein"
+        }
+
++ Response 200 (application/json)
+
+        {
+            "xoscsrftoken":"xuvsRC1jkXAsnrdRlgJvcXpmtthTAqqf",
+            "xossessionid":"7ds5a3wzjlgbjqo4odkd25qsm0j2s6zg",
+            "user": "{\"policed\": null, \"site\": 3, \"is_appuser\": false, \"is_staff\": true, \"backend_status\": \"Provisioning in progress\", \"id\": 3, \"is_registering\": false, \"last_login\": \"2016-04-30T22:51:04.788675+00:00\", \"email\": \"padmin@vicci.org\", \"no_sync\": false, \"username\": \"padmin@vicci.org\", \"dashboards\": [11], \"login_page\": null, \"firstname\": \"XOS\", \"user_url\": null, \"deleted\": false, \"lastname\": \"admin\", \"is_active\": true, \"lazy_blocked\": false, \"phone\": null, \"is_admin\": true, \"enacted\": null, \"public_key\": null, \"is_readonly\": false, \"no_policy\": false, \"write_protect\": false}"
+        }
+
+## Logout [/api/utility/logout/]
+
+### Log a user out of the system [POST]
+
++ Request (application/json)
+        {xossessionid: "sessionId"}
+
++ Response 200 (application/json)
+
+ 
+ 
 # Group Example
 
 ## Example Services Collection [/api/service/exampleservice/]
@@ -381,71 +415,6 @@
         ]
  
  
-# Group Utility
-
-List of the XOS Utility API
-
-## Login [/api/utility/login/]
-
-### Log a user in the system [POST]
-
-+ Request (application/json)
-
-        {
-            "username": "padmin@vicci.org",
-            "password": "letmein"
-        }
-
-+ Response 200 (application/json)
-
-        {
-            "xoscsrftoken":"xuvsRC1jkXAsnrdRlgJvcXpmtthTAqqf",
-            "xossessionid":"7ds5a3wzjlgbjqo4odkd25qsm0j2s6zg",
-            "user": {
-                "policed": null,
-                "site": 1,
-                "is_appuser": false,
-                "is_staff": true,
-                "backend_status": "Provisioning in progress",
-                "id": 1,
-                "is_registering": false,
-                "last_login": "2016-04-29T20:35:58.979122+00:00",
-                "email": "padmin@vicci.org",
-                "no_sync": false,
-                "username": "padmin@vicci.org",
-                "dashboards": [
-                    4,
-                    3,
-                    5
-                ],
-                "login_page": null,
-                "firstname": "XOS",
-                "user_url": null,
-                "deleted": false,
-                "lastname": "admin",
-                "is_active": true,
-                "lazy_blocked": false,
-                "phone": null,
-                "is_admin": true,
-                "enacted": null,
-                "public_key": null,
-                "is_readonly": false,
-                "no_policy": false,
-                "write_protect": false
-            }
-        }
-
-## Logout [/api/utility/logout/]
-
-### Log a user out of the system [POST]
-
-+ Request (application/json)
-        {xossessionid: "sessionId"}
-
-+ Response 200 (application/json)
-
- 
- 
 # Group Subscribers
 
 Resource related to the CORD Subscribers.
diff --git a/xos/configurations/cord-pod/Makefile b/xos/configurations/cord-pod/Makefile
index ce1baf8..950f758 100644
--- a/xos/configurations/cord-pod/Makefile
+++ b/xos/configurations/cord-pod/Makefile
@@ -1,11 +1,16 @@
 .PHONY: xos
-xos: nodes.yaml images.yaml
+xos: up bootstrap
+
+up:
 	sudo docker-compose up -d
 	../common/wait_for_xos_port.sh 80
+
+bootstrap: nodes.yaml images.yaml
 	sudo docker-compose run xos python /opt/xos/tosca/run.py none /opt/xos/configurations/common/fixtures.yaml
 	sudo docker-compose run xos python /opt/xos/tosca/run.py none /opt/xos/configurations/common/mydeployment.yaml
 	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/setup.yaml
 	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/nodes.yaml
+	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/nodes.yaml
 	sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/images.yaml
 
 vtn: vtn-external.yaml
diff --git a/xos/core/models/service.py b/xos/core/models/service.py
index 1c19e56..4bac02c 100644
--- a/xos/core/models/service.py
+++ b/xos/core/models/service.py
@@ -67,7 +67,7 @@
     kind = StrippedCharField(
         max_length=30, help_text="Kind of service", default=KIND)
     name = StrippedCharField(max_length=30, help_text="Service Name")
-    versionNumber = StrippedCharField(
+    versionNumber = StrippedCharField(blank=True, null=True,
         max_length=30, help_text="Version of Service Definition")
     published = models.BooleanField(default=True)
     view_url = StrippedCharField(blank=True, null=True, max_length=1024)
diff --git a/xos/core/models/slice.py b/xos/core/models/slice.py
index a449691..3934f3f 100644
--- a/xos/core/models/slice.py
+++ b/xos/core/models/slice.py
@@ -7,7 +7,7 @@
 from core.models import Role
 from core.models import Controller,ControllerLinkManager,ControllerLinkDeletionManager
 from core.models import ServiceClass
-from core.models.serviceclass import get_default_serviceclass
+#from core.models.serviceclass import get_default_serviceclass
 from core.models import Tag
 from django.contrib.contenttypes import generic
 from core.models import Service
@@ -34,7 +34,7 @@
     network = models.CharField(null=True, blank=True, max_length=256, choices=NETWORK_CHOICES)
     exposed_ports = models.CharField(null=True, blank=True, max_length=256)
     tags = generic.GenericRelation(Tag)
-    serviceClass = models.ForeignKey(ServiceClass, related_name = "slices", null=True, default=get_default_serviceclass)
+    serviceClass = models.ForeignKey(ServiceClass, related_name = "slices", null=True, blank=True)  # DEPRECATED
     creator = models.ForeignKey(User, related_name='slices', blank=True, null=True)
 
     # for tenant view
@@ -62,12 +62,6 @@
         if " " in self.name:
             raise XOSValidationError('slice name must not contain spaces')
 
-        if self.serviceClass is None:
-            # We allowed None=True for serviceClass because Django evolution
-            # will fail unless it is allowed. But, we we really don't want it to
-            # ever save None, so fix it up here.
-            self.serviceClass = ServiceClass.get_default()
-        
         # set creator on first save
         if not self.creator and hasattr(self, 'caller'):
             self.creator = self.caller
diff --git a/xos/tests/api/hooks.py b/xos/tests/api/hooks.py
index 83354c7..60440e0 100644
--- a/xos/tests/api/hooks.py
+++ b/xos/tests/api/hooks.py
@@ -54,6 +54,9 @@
     for s in AddressPool.objects.all():
         s.delete(purge=True)
 
+    for s in Flavor.objects.all():
+        s.delete(purge=True)
+
     # print 'DB Cleaned'
 
 
@@ -61,6 +64,11 @@
 
     cleanDB()
 
+    # create flavors
+    small = Flavor()
+    small.name = "m1.small"
+    small.save()
+
     # load user
     user = User.objects.get(email="padmin@vicci.org")
 
@@ -229,3 +237,16 @@
 @hooks.before("Example > Example Services Collection > List all Example Services")
 def exampleTest(transaction):
     transaction['skip'] = True
+
+
+@hooks.before("Utility > Login > Log a user in the system")
+def before_logout_hook(transaction):
+    transaction['skip'] = True
+    # auth = doLogin('padmin@vicci.org', 'letmein')
+    # transaction['request']['body'] = {}
+    # transaction['request']['body']['xossessionid'] = auth['sessionid']
+
+
+@hooks.before("Utility > Logout > Log a user out of the system")
+def skip_for_now(transaction):
+    transaction['skip'] = True
\ No newline at end of file
diff --git a/xos/tests/api/source/utility/utility.md b/xos/tests/api/source/utility/utility.md
index 4f6efd0..63379be 100644
--- a/xos/tests/api/source/utility/utility.md
+++ b/xos/tests/api/source/utility/utility.md
@@ -18,38 +18,7 @@
         {
             "xoscsrftoken":"xuvsRC1jkXAsnrdRlgJvcXpmtthTAqqf",
             "xossessionid":"7ds5a3wzjlgbjqo4odkd25qsm0j2s6zg",
-            "user": {
-                "policed": null,
-                "site": 1,
-                "is_appuser": false,
-                "is_staff": true,
-                "backend_status": "Provisioning in progress",
-                "id": 1,
-                "is_registering": false,
-                "last_login": "2016-04-29T20:35:58.979122+00:00",
-                "email": "padmin@vicci.org",
-                "no_sync": false,
-                "username": "padmin@vicci.org",
-                "dashboards": [
-                    4,
-                    3,
-                    5
-                ],
-                "login_page": null,
-                "firstname": "XOS",
-                "user_url": null,
-                "deleted": false,
-                "lastname": "admin",
-                "is_active": true,
-                "lazy_blocked": false,
-                "phone": null,
-                "is_admin": true,
-                "enacted": null,
-                "public_key": null,
-                "is_readonly": false,
-                "no_policy": false,
-                "write_protect": false
-            }
+            "user": "{\"policed\": null, \"site\": 3, \"is_appuser\": false, \"is_staff\": true, \"backend_status\": \"Provisioning in progress\", \"id\": 3, \"is_registering\": false, \"last_login\": \"2016-04-30T22:51:04.788675+00:00\", \"email\": \"padmin@vicci.org\", \"no_sync\": false, \"username\": \"padmin@vicci.org\", \"dashboards\": [11], \"login_page\": null, \"firstname\": \"XOS\", \"user_url\": null, \"deleted\": false, \"lastname\": \"admin\", \"is_active\": true, \"lazy_blocked\": false, \"phone\": null, \"is_admin\": true, \"enacted\": null, \"public_key\": null, \"is_readonly\": false, \"no_policy\": false, \"write_protect\": false}"
         }
 
 ## Logout [/api/utility/logout/]