reconcile with master
diff --git a/xos/core/models/service.py b/xos/core/models/service.py
index 104b4cf..b341e83 100644
--- a/xos/core/models/service.py
+++ b/xos/core/models/service.py
@@ -673,26 +673,15 @@
from core.models import Image
# Implement the logic here to pick the image that should be used when
# instantiating the VM that will hold the container.
+
slice = self.provider_service.slices.all()
if not slice:
raise XOSProgrammingError("provider service has no slice")
slice = slice[0]
- if slice.default_isolation in ["container", "container_vm"]:
- look_for_images = self.LOOK_FOR_CONTAINER_IMAGES
- else:
- look_for_images = self.LOOK_FOR_IMAGES
-
- for image_name in look_for_images:
-
- images = Image.objects.filter(name=image_name)
-
- if images:
- return images[0]
- else:
- images = Image.objects.filter(name = slice.default_image)
- if images:
- return images[0]
+ # If slice has default_image set then use it
+ if slice.default_image:
+ return slice.default_image
raise XOPSProgrammingError("Please set a default image for %s" % self.slice.name)
@@ -743,7 +732,6 @@
if not instance:
slice = self.provider_service.slices.all()[0]
- flavors = Flavor.objects.filter(name=slice.default_flavor) #MCORD
flavor = slice.default_flavor
if not flavor:
@@ -751,8 +739,6 @@
if not flavors:
raise XOSConfigurationError("No m1.small flavor")
flavor = flavors[0]
-# default_flavor = slice.default_flavor #MCORD
-
if slice.default_isolation == "container_vm":
(node, parent) = ContainerVmScheduler(slice).pick()