added availability_zone field to Deployment model
diff --git a/planetstack/core/admin.py b/planetstack/core/admin.py
index 1d64d9c..6fcc3f9 100644
--- a/planetstack/core/admin.py
+++ b/planetstack/core/admin.py
@@ -535,7 +535,7 @@
class DeploymentAdmin(PlanetStackBaseAdmin):
model = Deployment
- fieldList = ['backend_status_text', 'name', 'sites', 'images', 'flavors', 'accessControl']
+ fieldList = ['backend_status_text', 'name', 'availability_zone', 'sites', 'images', 'flavors', 'accessControl']
fieldsets = [(None, {'fields': fieldList, 'classes':['suit-tab suit-tab-sites']})]
inlines = [DeploymentPrivilegeInline,NodeInline,TagInline] # ,ImageDeploymentsInline]
list_display = ['backend_status_icon', 'name']
@@ -700,6 +700,15 @@
'service': LinkedSelect
}
+ def clean(self):
+ cleaned_data = super(SliceForm, self).clean()
+ name = cleaned_data.get('name')
+ site_id = cleaned_data.get('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)
+ return cleaned_data
+
class SliceAdmin(PlanetStackBaseAdmin):
form = SliceForm
fieldList = ['backend_status_text', 'site', 'name', 'serviceClass', 'enabled','description', 'service', 'slice_url', 'max_slivers']
diff --git a/planetstack/core/models/site.py b/planetstack/core/models/site.py
index 67f38aa..160b426 100644
--- a/planetstack/core/models/site.py
+++ b/planetstack/core/models/site.py
@@ -174,6 +174,7 @@
admin_tenant = models.CharField(max_length=200, null=True, blank=True, help_text="Name of the tenant the admin user belongs to")
auth_url = models.CharField(max_length=200, null=True, blank=True, help_text="Auth url for the deployment")
backend_type = models.CharField(max_length=200, null=True, blank=True, help_text="Type of deployment, e.g. EC2, OpenStack, or OpenStack version")
+ availability_zone = models.CharField(max_length=200, null=True, blank=True, help_text="OpenStack availability zone")
# smbaker: the default of 'allow all' is intended for evolutions of existing
# deployments. When new deployments are created via the GUI, they are