From a3a40cfb71870165581beca678549ce076898b5a Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Tue, 2 Apr 2013 11:21:21 -0400 Subject: [PATCH] fix bugs --- plstackapi/core/models.py | 1 + plstackapi/importer/plclassic/slice_importer.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plstackapi/core/models.py b/plstackapi/core/models.py index 3eb0f20..25fa4dd 100644 --- a/plstackapi/core/models.py +++ b/plstackapi/core/models.py @@ -47,6 +47,7 @@ class Site(PlCoreBase): class Slice(PlCoreBase): tenant_id = models.CharField(max_length=200, help_text="Keystone tenant id") name = models.CharField(help_text="The Name of the Slice", max_length=80) + enabled = models.BooleanField(default=True, help_text="Status for this Slice") SLICE_CHOICES = (('plc', 'PLC'), ('delegated', 'Delegated'), ('controller','Controller'), ('none','None')) instantiation = models.CharField(help_text="The instantiation type of the slice", max_length=80, choices=SLICE_CHOICES) omf_friendly = models.BooleanField() diff --git a/plstackapi/importer/plclassic/slice_importer.py b/plstackapi/importer/plclassic/slice_importer.py index 45ff6e6..d9e44fb 100644 --- a/plstackapi/importer/plclassic/slice_importer.py +++ b/plstackapi/importer/plclassic/slice_importer.py @@ -25,14 +25,14 @@ class SliceImporter: self.local_slices[db_slice.name] = db_slice print "%s local slices" % len(db_slices) - slices = api.GetSlices() + slices = self.api.GetSlices() print "%s remote sites" % len(slices) count = 0 for slice in slices: - self.remote_slice[slice['slice_id']] = slice + self.remote_slices[slice['slice_id']] = slice if slice['name'] not in self.local_slices: site = local_sites[remote_sites[slice['site_id']]['login_base']] - new_slices = Slice(name=slice['name'], + new_slice = Slice(name=slice['name'], instantiation=slice['instantiation'], omf_friendly = False, description = slice['description'], -- 2.47.0