rename camelcase fields in slice
diff --git a/planetstack/core/dashboard/views/tenant.py b/planetstack/core/dashboard/views/tenant.py
index 02f388a..762409e 100644
--- a/planetstack/core/dashboard/views/tenant.py
+++ b/planetstack/core/dashboard/views/tenant.py
@@ -52,7 +52,7 @@
serviceClass = ServiceClass.objects.get(name=serviceClass)
site = request.user.site
image = Image.objects.get(name=imageName)
- newSlice = Slice(name=sliceName,serviceClass=serviceClass,site=site,imagePreference=image,mountDataSets=mountDataSets)
+ newSlice = Slice(name=sliceName,serviceClass=serviceClass,site=site,image_preference=image,mount_data_sets=mountDataSets)
newSlice.save()
privateTemplate="Private"
publicTemplate="Public shared IPv4"
@@ -103,8 +103,8 @@
if(entry.name==sliceName):
if (actionToDo == "update"):
setattr(entry,'serviceClass',serviceClass)
- setattr(entry,'imagePreference',imageName)
- setattr(entry,'mountDataSets',dataSet)
+ setattr(entry,'image_preference',imageName)
+ setattr(entry,'mount_data_sets',dataSet)
entry.save()
break
addOrModifyPorts(networkPorts,sliceName)
@@ -179,8 +179,8 @@
sliceName = Slice.objects.get(id=entry.id).name
slice = Slice.objects.get(name=Slice.objects.get(id=entry.id).name)
sliceServiceClass = entry.serviceClass.name
- preferredImage = entry.imagePreference
- #sliceDataSet = entry.mountDataSets
+ preferredImage = entry.image_preference
+ #sliceDataSet = entry.mount_data_sets
sliceNetwork = {}
numSliver = 0
sliceImage=""
diff --git a/planetstack/core/fixtures/initial_data.json b/planetstack/core/fixtures/initial_data.json
index 516f216..5906936 100644
--- a/planetstack/core/fixtures/initial_data.json
+++ b/planetstack/core/fixtures/initial_data.json
@@ -2010,7 +2010,7 @@
"omf_friendly": false,
"network": null,
"max_slivers": 10,
- "mountDataSets": null,
+ "mount_data_sets": null,
"backend_status": "Provisioning in progress",
"creator": 7,
"enacted": "2014-09-19T21:20:35.271Z"
@@ -2034,7 +2034,7 @@
"omf_friendly": false,
"network": null,
"max_slivers": 10,
- "mountDataSets": null,
+ "mount_data_sets": null,
"backend_status": "Provisioning in progress",
"creator": 7,
"enacted": "2014-10-09T18:47:35.832Z"
@@ -2058,7 +2058,7 @@
"omf_friendly": false,
"network": "Private Only",
"max_slivers": 100,
- "mountDataSets": "GenBank",
+ "mount_data_sets": "GenBank",
"backend_status": "Provisioning in progress",
"creator": 6,
"enacted": "2014-10-09T18:48:00.386Z"
@@ -2082,7 +2082,7 @@
"omf_friendly": false,
"network": "Private Only",
"max_slivers": 10,
- "mountDataSets": "GenBank",
+ "mount_data_sets": "GenBank",
"backend_status": "Provisioning in progress",
"creator": 8,
"enacted": "2014-09-23T19:06:55.420Z"
@@ -2106,7 +2106,7 @@
"omf_friendly": false,
"network": "Private Only",
"max_slivers": 10,
- "mountDataSets": "GenBank",
+ "mount_data_sets": "GenBank",
"backend_status": "",
"creator": 8,
"enacted": "2014-09-19T21:20:04.708Z"
@@ -2130,7 +2130,7 @@
"omf_friendly": false,
"network": "Private Only",
"max_slivers": 10,
- "mountDataSets": "GenBank",
+ "mount_data_sets": "GenBank",
"backend_status": "Provisioning in progress",
"creator": 8,
"enacted": "2014-09-30T22:43:42.489Z"
@@ -2154,7 +2154,7 @@
"omf_friendly": false,
"network": "Private Only",
"max_slivers": 10,
- "mountDataSets": "GenBank",
+ "mount_data_sets": "GenBank",
"backend_status": "NameError(\"global name 'User' is not defined\",)",
"creator": null,
"enacted": null
@@ -2178,7 +2178,7 @@
"omf_friendly": false,
"network": "Private Only",
"max_slivers": 10,
- "mountDataSets": "GenBank",
+ "mount_data_sets": "GenBank",
"backend_status": "NameError(\"global name 'User' is not defined\",)",
"creator": null,
"enacted": null
@@ -2202,7 +2202,7 @@
"omf_friendly": false,
"network": "Private Only",
"max_slivers": 10,
- "mountDataSets": "GenBank",
+ "mount_data_sets": "GenBank",
"backend_status": "NameError(\"global name 'User' is not defined\",)",
"creator": null,
"enacted": null
@@ -2226,7 +2226,7 @@
"omf_friendly": false,
"network": "Private Only",
"max_slivers": 10,
- "mountDataSets": "GenBank",
+ "mount_data_sets": "GenBank",
"backend_status": "Provisioning in progress",
"creator": 6,
"enacted": "2014-10-10T14:57:41.282Z"
@@ -2250,7 +2250,7 @@
"omf_friendly": false,
"network": "Private Only",
"max_slivers": 10,
- "mountDataSets": "GenBank",
+ "mount_data_sets": "GenBank",
"backend_status": "NameError(\"global name 'User' is not defined\",)",
"creator": 8,
"enacted": null
diff --git a/planetstack/core/models/slice.py b/planetstack/core/models/slice.py
index 8854a75..52a5dd6 100644
--- a/planetstack/core/models/slice.py
+++ b/planetstack/core/models/slice.py
@@ -24,15 +24,16 @@
slice_url = models.URLField(blank=True, max_length=512)
site = models.ForeignKey(Site, related_name='slices', help_text="The Site this Slice belongs to")
max_slivers = models.IntegerField(default=10)
- imagePreference = models.CharField(default="Ubuntu 12.04 LTS", null=True, blank=True, max_length=256)
service = models.ForeignKey(Service, related_name='service', null=True, blank=True)
network = models.CharField(default="Private Only",null=True, blank=True, max_length=256)
- mountDataSets = models.CharField(default="GenBank",null=True, blank=True, max_length=256)
tags = generic.GenericRelation(Tag)
-
serviceClass = models.ForeignKey(ServiceClass, related_name = "slices", null=True, default=get_default_serviceclass)
creator = models.ForeignKey(User, related_name='slices', blank=True, null=True)
+ # for tenant view
+ image_preference = models.CharField(default="Ubuntu 12.04 LTS", null=True, blank=True, max_length=256)
+ mount_data_sets = models.CharField(default="GenBank",null=True, blank=True, max_length=256)
+
def __unicode__(self): return u'%s' % (self.name)
@property
diff --git a/planetstack/core/xoslib/methods/sliceplus.py b/planetstack/core/xoslib/methods/sliceplus.py
index 7e9ae89..48102df 100644
--- a/planetstack/core/xoslib/methods/sliceplus.py
+++ b/planetstack/core/xoslib/methods/sliceplus.py
@@ -32,7 +32,7 @@
class Meta:
model = SlicePlus
- fields = ('humanReadableName', 'id','created','updated','enacted','name','enabled','omf_friendly','description','slice_url','site','max_slivers','imagePreference','service','network','mountDataSets','serviceClass','creator','networks','availableNetworks','sliceInfo','backendIcon','backendHtml')
+ fields = ('humanReadableName', 'id','created','updated','enacted','name','enabled','omf_friendly','description','slice_url','site','max_slivers','image_preference','service','network','mount_data_sets','serviceClass','creator','networks','availableNetworks','sliceInfo','backendIcon','backendHtml')
class SlicePlusList(generics.ListCreateAPIView):
queryset = SlicePlus.objects.select_related().all()