Refactor to /opt/planetstack, final tweaks to make sure planetstack can run in non...
Siobhan Tully [Fri, 10 May 2013 12:59:56 +0000 (08:59 -0400)]
76 files changed:
planetstack/__init__.py [moved from plstackapi/__init__.py with 100% similarity]
planetstack/core/__init__.py [moved from plstackapi/core/__init__.py with 100% similarity]
planetstack/core/admin.py [moved from plstackapi/core/admin.py with 91% similarity]
planetstack/core/api/__init__.py [moved from plstackapi/core/api/__init__.py with 100% similarity]
planetstack/core/api/auth.py [moved from plstackapi/core/api/auth.py with 80% similarity]
planetstack/core/api/deployment_networks.py [moved from plstackapi/core/api/deployment_networks.py with 83% similarity]
planetstack/core/api/images.py [moved from plstackapi/core/api/images.py with 78% similarity]
planetstack/core/api/keys.py [moved from plstackapi/core/api/keys.py with 78% similarity]
planetstack/core/api/nodes.py [moved from plstackapi/core/api/nodes.py with 79% similarity]
planetstack/core/api/roles.py [moved from plstackapi/core/api/roles.py with 83% similarity]
planetstack/core/api/site_privileges.py [moved from plstackapi/core/api/site_privileges.py with 80% similarity]
planetstack/core/api/sites.py [moved from plstackapi/core/api/sites.py with 89% similarity]
planetstack/core/api/slice_memberships.py [moved from plstackapi/core/api/slice_memberships.py with 83% similarity]
planetstack/core/api/slices.py [moved from plstackapi/core/api/slices.py with 91% similarity]
planetstack/core/api/slivers.py [moved from plstackapi/core/api/slivers.py with 79% similarity]
planetstack/core/api/subnets.py [moved from plstackapi/core/api/subnets.py with 90% similarity]
planetstack/core/api/users.py [moved from plstackapi/core/api/users.py with 74% similarity]
planetstack/core/api_root.py [moved from plstackapi/core/api_root.py with 100% similarity]
planetstack/core/fixtures/__init__.py [moved from plstackapi/core/fixtures/__init__.py with 100% similarity]
planetstack/core/fixtures/initial_data.json [moved from plstackapi/core/fixtures/initial_data.json with 100% similarity]
planetstack/core/models/__init__.py [new file with mode: 0644]
planetstack/core/models/deploymentnetwork.py [moved from plstackapi/core/models/deploymentnetwork.py with 85% similarity]
planetstack/core/models/image.py [moved from plstackapi/core/models/image.py with 89% similarity]
planetstack/core/models/key.py [moved from plstackapi/core/models/key.py with 74% similarity]
planetstack/core/models/node.py [moved from plstackapi/core/models/node.py with 73% similarity]
planetstack/core/models/plcorebase.py [moved from plstackapi/core/models/plcorebase.py with 100% similarity]
planetstack/core/models/role.py [moved from plstackapi/core/models/role.py with 93% similarity]
planetstack/core/models/site.py [moved from plstackapi/core/models/site.py with 81% similarity]
planetstack/core/models/slice.py [moved from plstackapi/core/models/slice.py with 80% similarity]
planetstack/core/models/sliver.py [moved from plstackapi/core/models/sliver.py with 78% similarity]
planetstack/core/models/subnet.py [moved from plstackapi/core/models/subnet.py with 89% similarity]
planetstack/core/models/user.py [moved from plstackapi/core/models/pluser.py with 69% similarity]
planetstack/core/serializers.py [moved from plstackapi/core/serializers.py with 98% similarity]
planetstack/core/views/__init__.py [moved from plstackapi/core/views/__init__.py with 100% similarity]
planetstack/core/views/deployment_networks.py [moved from plstackapi/core/views/deployment_networks.py with 89% similarity]
planetstack/core/views/images.py [moved from plstackapi/core/views/images.py with 90% similarity]
planetstack/core/views/keys.py [moved from plstackapi/core/views/keys.py with 92% similarity]
planetstack/core/views/nodes.py [moved from plstackapi/core/views/nodes.py with 89% similarity]
planetstack/core/views/roles.py [moved from plstackapi/core/views/roles.py with 91% similarity]
planetstack/core/views/site_privileges.py [moved from plstackapi/core/views/site_privileges.py with 90% similarity]
planetstack/core/views/sites.py [moved from plstackapi/core/views/sites.py with 92% similarity]
planetstack/core/views/slice_memberships.py [moved from plstackapi/core/views/slice_memberships.py with 90% similarity]
planetstack/core/views/slices.py [moved from plstackapi/core/views/slices.py with 91% similarity]
planetstack/core/views/slivers.py [moved from plstackapi/core/views/slivers.py with 91% similarity]
planetstack/core/views/subnets.py [moved from plstackapi/core/views/subnets.py with 91% similarity]
planetstack/core/views/users.py [moved from plstackapi/core/views/users.py with 91% similarity]
planetstack/importer/__init__.py [moved from plstackapi/importer/__init__.py with 100% similarity]
planetstack/importer/plclassic/__init__.py [moved from plstackapi/importer/plclassic/__init__.py with 100% similarity]
planetstack/importer/plclassic/importer.py [moved from plstackapi/importer/plclassic/importer.py with 83% similarity]
planetstack/importer/plclassic/role_importer.py [moved from plstackapi/importer/plclassic/role_importer.py with 100% similarity]
planetstack/importer/plclassic/site_importer.py [moved from plstackapi/importer/plclassic/site_importer.py with 96% similarity]
planetstack/importer/plclassic/slice_importer.py [moved from plstackapi/importer/plclassic/slice_importer.py with 94% similarity]
planetstack/importer/plclassic/sliver_importer.py [moved from plstackapi/importer/plclassic/sliver_importer.py with 100% similarity]
planetstack/importer/plclassic/user_importer.py [moved from plstackapi/importer/plclassic/user_importer.py with 100% similarity]
planetstack/manage.py [moved from plstackapi/manage.py with 67% similarity]
planetstack/openstack/__init__.py [moved from plstackapi/openstack/__init__.py with 100% similarity]
planetstack/openstack/client.py [moved from plstackapi/openstack/client.py with 53% similarity]
planetstack/openstack/driver.py [moved from plstackapi/openstack/driver.py with 95% similarity]
planetstack/openstack/manager.py [moved from plstackapi/openstack/manager.py with 91% similarity]
planetstack/openstack/siteagent.py [moved from plstackapi/openstack/siteagent.py with 76% similarity]
planetstack/openstack/sliveragent.py [moved from plstackapi/openstack/sliveragent.py with 86% similarity]
planetstack/planetstack/__init__.py [moved from plstackapi/planetstack/__init__.py with 100% similarity]
planetstack/planetstack/config.py [moved from plstackapi/planetstack/config.py with 98% similarity]
planetstack/planetstack/settings.py [moved from plstackapi/planetstack/settings.py with 90% similarity]
planetstack/planetstack/tests.py [moved from plstackapi/planetstack/tests.py with 100% similarity]
planetstack/planetstack/urls.py [moved from plstackapi/core/urls.py with 73% similarity]
planetstack/planetstack/wsgi.py [moved from plstackapi/planetstack/wsgi.py with 94% similarity]
planetstack/plstackapi-debug-server.py [moved from plstackapi/plstackapi-debug-server.py with 71% similarity]
planetstack/plstackapi_config [moved from config/plstackapi_config with 100% similarity]
planetstack/templates/admin/base_site.html [new file with mode: 0644]
planetstack/templates/admin/core/SiteDeploymentNetwork/sitedepnettabular.html [new file with mode: 0644]
planetstack/util/__init__.py [moved from plstackapi/util/__init__.py with 100% similarity]
planetstack/util/glob.py [moved from plstackapi/util/glob.py with 100% similarity]
planetstack/util/request.py [moved from plstackapi/util/request.py with 100% similarity]
planetstack/util/xml.py [moved from plstackapi/util/xml.py with 100% similarity]
plstackapi/core/models/__init__.py [deleted file]

similarity index 91%
rename from plstackapi/core/admin.py
rename to planetstack/core/admin.py
index 86b48a2..6a8b71e 100644 (file)
@@ -1,6 +1,6 @@
-from plstackapi.core.models import Site
-from plstackapi.core.models import *
-from plstackapi.openstack.manager import OpenStackManager
+from core.models import Site
+from core.models import *
+from openstack.manager import OpenStackManager
 
 from django.contrib import admin
 from django.contrib.auth.models import Group
@@ -37,12 +37,16 @@ class SiteInline(admin.TabularInline):
     model = Site
     extra = 0
 
+class UserInline(admin.TabularInline):
+    model = User
+    extra = 0
+
 class SliceInline(admin.TabularInline):
     model = Slice
     extra = 0
 
 class UserInline(admin.TabularInline):
-    model = PLUser
+    model = User
     extra = 0
 
 class RoleInline(admin.TabularInline):
@@ -65,13 +69,13 @@ class OSModelAdmin(PlanetStackBaseAdmin):
 
     def save_model(self, request, obj, form, change):
         auth = request.session.get('auth', {})
-        auth['tenant'] = request.user.site.login_base
+        #auth['tenant'] = request.user.site.login_base
         obj.os_manager = OpenStackManager(auth=auth, caller=request.user)
         obj.save()
 
     def delete_model(self, request, obj):
         auth = request.session.get('auth', {})
-        auth['tenant'] = request.user.site.login_base
+        #auth['tenant'] = request.user.site.login_base
         obj.os_manager = OpenStackManager(auth=auth, caller=request.user)
         obj.delete() 
 
@@ -133,7 +137,7 @@ class SiteAdmin(OSModelAdmin):
     ]
     list_display = ('name', 'login_base','site_url', 'enabled')
     filter_horizontal = ('deployments',)
-    inlines = [NodeInline,]
+    inlines = [NodeInline, UserInline]
     search_fields = ['name']
 
     def get_formsets(self, request, obj=None):
@@ -143,7 +147,7 @@ class SiteAdmin(OSModelAdmin):
                 continue
             # give inline object access to driver and caller
             auth = request.session.get('auth', {})
-            auth['tenant'] = request.user.site.login_base
+            #auth['tenant'] = request.user.site.login_base
             inline.model.os_manager = OpenStackManager(auth=auth, caller=request.user)
             yield inline.get_formset(request, obj)
 
@@ -156,22 +160,22 @@ class SitePrivilegeAdmin(PlanetStackBaseAdmin):
     def save_model(self, request, obj, form, change):
         # update openstack connection to use this site/tenant   
         auth = request.session.get('auth', {})
-        auth['tenant'] = obj.site.login_base
+        #auth['tenant'] = obj.site.login_base
         obj.os_manager = OpenStackManager(auth=auth, caller=request.user)
         obj.save()
 
     def delete_model(self, request, obj):
         # update openstack connection to use this site/tenant   
         auth = request.session.get('auth', {})
-        auth['tenant'] = obj.site.login_base
+        #auth['tenant'] = obj.site.login_base
         obj.os_manager = OpenStackManager(auth=auth, caller=request.user)
         obj.delete()
 
 class KeyAdmin(OSModelAdmin):
     fieldsets = [
-        ('Key', {'fields': ['name', 'key', 'type', 'blacklisted', 'user']})
+        ('Key', {'fields': ['name', 'key', 'type', 'blacklisted']})
     ]
-    list_display = ['name', 'key', 'type', 'blacklisted', 'user']
+    list_display = ['name', 'key', 'type', 'blacklisted']
 
     def get_queryset(self, request):
         # get keys user is allowed to see
@@ -183,8 +187,8 @@ class KeyAdmin(OSModelAdmin):
         
 
 class SliceAdmin(OSModelAdmin):
-    fields = ['name', 'site', 'serviceClass', 'instantiation', 'description', 'slice_url']
-    list_display = ('name', 'site','serviceClass', 'slice_url', 'instantiation')
+    fields = ['name', 'site', 'serviceClass', 'description', 'slice_url']
+    list_display = ('name', 'site','serviceClass', 'slice_url')
     inlines = [SliverInline]
 
     def get_formsets(self, request, obj=None):
@@ -290,8 +294,8 @@ class UserCreationForm(forms.ModelForm):
     password2 = forms.CharField(label='Password confirmation', widget=forms.PasswordInput)
 
     class Meta:
-        model = PLUser
-        fields = ('email', 'firstname', 'lastname', 'phone', 'site')
+        model = User
+        fields = ('email', 'firstname', 'lastname', 'phone', 'key', 'site')
 
     def clean_password2(self):
         # Check that the two password entries match
@@ -319,7 +323,7 @@ class UserChangeForm(forms.ModelForm):
     password = ReadOnlyPasswordHashField()
 
     class Meta:
-        model = PLUser
+        model = User
 
     def clean_password(self):
         # Regardless of what the user provides, return the initial value.
@@ -328,7 +332,7 @@ class UserChangeForm(forms.ModelForm):
         return self.initial["password"]
 
 
-class PLUserAdmin(UserAdmin, OSModelAdmin):
+class UserAdmin(UserAdmin, OSModelAdmin):
     class Meta:
         app_label = "core"
 
@@ -343,13 +347,13 @@ class PLUserAdmin(UserAdmin, OSModelAdmin):
     list_filter = ('site',)
     fieldsets = (
         (None, {'fields': ('email', 'password')}),
-        ('Personal info', {'fields': ('firstname','lastname','phone','site')}),
+        ('Personal info', {'fields': ('firstname','lastname','phone','site', 'key')}),
         #('Important dates', {'fields': ('last_login',)}),
     )
     add_fieldsets = (
         (None, {
             'classes': ('wide',),
-            'fields': ('email', 'firstname', 'lastname', 'phone', 'site', 'password1', 'password2')}
+            'fields': ('email', 'firstname', 'lastname', 'phone', 'site', 'password1', 'password2', 'key')}
         ),
     )
     search_fields = ('email',)
@@ -364,20 +368,20 @@ def cache_credentials(sender, user, request, **kwds):
 user_logged_in.connect(cache_credentials)
 
 # Now register the new UserAdmin...
-admin.site.register(PLUser, PLUserAdmin)
+admin.site.register(User, UserAdmin)
 # ... and, since we're not using Django's builtin permissions,
 # unregister the Group model from admin.
 admin.site.unregister(Group)
 
 admin.site.register(Site, SiteAdmin)
-admin.site.register(SitePrivilege, SitePrivilegeAdmin)
+#admin.site.register(SitePrivilege, SitePrivilegeAdmin)
 admin.site.register(Slice, SliceAdmin)
-admin.site.register(SliceMembership, SliceMembershipAdmin)
+#admin.site.register(SliceMembership, SliceMembershipAdmin)
 admin.site.register(Subnet, SubnetAdmin)
-admin.site.register(Image, ImageAdmin)
-admin.site.register(Node, NodeAdmin)
+#admin.site.register(Image, ImageAdmin)
+#admin.site.register(Node, NodeAdmin)
 admin.site.register(Sliver, SliverAdmin)
 admin.site.register(Key, KeyAdmin)
-admin.site.register(Role, RoleAdmin)
+#admin.site.register(Role, RoleAdmin)
 admin.site.register(DeploymentNetwork, DeploymentNetworkAdmin)
 
similarity index 80%
rename from plstackapi/core/api/auth.py
rename to planetstack/core/api/auth.py
index 412df00..8796f14 100644 (file)
@@ -1,4 +1,4 @@
-from plstackapi.openstack.client import OpenStackClient
+from openstack.client import OpenStackClient
 
 def auth_check(username, password, tenant):
     client = OpenStackClient(username=username,
similarity index 83%
rename from plstackapi/core/api/deployment_networks.py
rename to planetstack/core/api/deployment_networks.py
index 00ee2e8..51fa03e 100644 (file)
@@ -1,8 +1,8 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
-from plstackapi.core.models import DeploymentNetwork
+from openstack.client import OpenStackClient
+from openstack.driver import OpenStackDriver
+from core.api.auth import auth_check
+from core.models import DeploymentNetwork
 
 def _get_deployment_networks(filter):
     if isinstance(filter, StringTypes) and filter.isdigit():
similarity index 78%
rename from plstackapi/core/api/images.py
rename to planetstack/core/api/images.py
index 8fd6141..c080a55 100644 (file)
@@ -1,8 +1,8 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
-from plstackapi.core.models import Image
+from openstack.client import OpenStackClient
+from openstack.driver import OpenStackDriver
+from core.api.auth import auth_check
+from core.models import Image
  
 def _get_images(filter):
     if isinstance(filter, StringTypes) and filter.isdigit():
similarity index 78%
rename from plstackapi/core/api/keys.py
rename to planetstack/core/api/keys.py
index 3b70cac..e653690 100644 (file)
@@ -1,9 +1,9 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
-from plstackapi.core.models import Key
-from plstackapi.core.api.users import _get_users
+from openstack.client import OpenStackClient
+from openstack.driver import OpenStackDriver
+from core.models import Key
+from core.api.auth import auth_check
+from core.api.users import _get_users
 
 
 def _get_keys(filter):
@@ -27,7 +27,7 @@ def add_key(auth, fields):
     nova_fields = {'name': key.name,
                    'key': key.key} 
     nova_key = driver.create_keypair(**nova_fields)
-    key.key_id = nova_key.id
+    key.nkey_id = nova_key.id
     key.save()
     return key
 
@@ -38,7 +38,7 @@ def delete_key(auth, filter={}):
     driver = OpenStackDriver(client = auth_check(auth))   
     keys = _get_keys(filter)
     for key in keys:
-        driver.delete_keypair(id=key.key_id) 
+        driver.delete_keypair(id=key.nkey_id) 
         key.delete()
     return 1
 
similarity index 79%
rename from plstackapi/core/api/nodes.py
rename to planetstack/core/api/nodes.py
index 9b6a65c..6514e54 100644 (file)
@@ -1,8 +1,8 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
-from plstackapi.core.models import Node
+from openstack.client import OpenStackClient
+from openstack.driver import OpenStackDriver
+from core.api.auth import auth_check
+from core.models import Node
  
 def _get_nodes(filter):
     if isinstance(filter, StringTypes) and filter.isdigit():
similarity index 83%
rename from plstackapi/core/api/roles.py
rename to planetstack/core/api/roles.py
index b243d78..a799c01 100644 (file)
@@ -1,8 +1,8 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
-from plstackapi.core.models import Role
+from openstack.client import OpenStackClient
+from openstack.driver import OpenStackDriver
+from core.api.auth import auth_check
+from core.models import Role
  
 
 def _get_roles(filter):
similarity index 80%
rename from plstackapi/core/api/site_privileges.py
rename to planetstack/core/api/site_privileges.py
index ac56dd1..85a8a83 100644 (file)
@@ -1,12 +1,12 @@
 from types import StringTypes
 import re
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
-from plstackapi.core.models import SitePrivilege
-from plstackapi.core.api.users import _get_users
-from plstackapi.core.api.sites import _get_sites
-from plstackapi.core.api.roles import _get_roles
+from openstack.client import OpenStackClient
+from openstack.driver import OpenStackDriver
+from core.api.auth import auth_check
+from core.models import SitePrivilege
+from core.api.users import _get_users
+from core.api.sites import _get_sites
+from core.api.roles import _get_roles
 
 
 def _get_site_privileges(filter):
@@ -35,7 +35,7 @@ def add_site_privilege(auth, fields):
     site_privilege = SitePrivilege(**fields)
 
     # update nova role
-    driver.add_user_role(site_privilege.user.user_id, 
+    driver.add_user_role(site_privilege.user.kuser_id, 
                          site_privilege.site.tenant_id, 
                          site_privilege.role.name)
     
@@ -49,7 +49,7 @@ def delete_site_privilege(auth, filter={}):
     driver = OpenStackDriver(client = auth_check(auth))   
     site_privileges = _get_site_privileges(filter)
     for site_privilege in site_privileges:
-        driver.delete_user_role(user_id=site_privilege.user.id,
+        driver.delete_user_role(kuser_id=site_privilege.user.id,
                                 tenant_id = site_privilege.site.tenant_id,
                                 role_name = site_privilege.role.name) 
         site_privilege.delete()
similarity index 89%
rename from plstackapi/core/api/sites.py
rename to planetstack/core/api/sites.py
index b8c463d..cfca6cf 100644 (file)
@@ -1,8 +1,8 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
-from plstackapi.core.models import Site
+from openstack.client import OpenStackClient
+from openstack.driver import OpenStackDriver
+from core.api.auth import auth_check
+from core.models import Site
 
 
 def _get_sites(filter):
similarity index 83%
rename from plstackapi/core/api/slice_memberships.py
rename to planetstack/core/api/slice_memberships.py
index 431552d..77d79bf 100644 (file)
@@ -1,11 +1,11 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
-from plstackapi.core.models import SliceMembership
-from plstackapi.core.api.users import _get_users
-from plstackapi.core.api.slices import _get_slices
-from plstackapi.core.api.roles import _get_roles
+from openstack.client import OpenStackClient
+from openstack.driver import OpenStackDriver
+from core.api.auth import auth_check
+from core.models import SliceMembership
+from core.api.users import _get_users
+from core.api.slices import _get_slices
+from core.api.roles import _get_roles
 
 def _get_slice_memberships(filter):
     if isinstance(filter, StringTypes) and filter.isdigit():
@@ -48,7 +48,7 @@ def delete_slice_membership(auth, filter={}):
     driver = OpenStackDriver(client = auth_check(auth))   
     slice_memberships = _get_slice_memberships(filter)
     for slice_membership in slice_memberships:
-        driver.delete_user_role(user_id=slice_membership.user.id,
+        driver.delete_user_role(kuser_id=slice_membership.user.id,
                                 tenant_id = slice_membership.slice.tenant_id,
                                 role_name = slice_membership.role.name) 
         slice_membership.delete()
similarity index 91%
rename from plstackapi/core/api/slices.py
rename to planetstack/core/api/slices.py
index eda2249..f03dd6f 100644 (file)
@@ -1,11 +1,11 @@
 import re
 from types import StringTypes
 from django.contrib.auth import authenticate
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
-from plstackapi.core.models import Slice
-from plstackapi.core.api.sites import _get_sites
+from openstack.client import OpenStackClient
+from openstack.driver import OpenStackDriver
+from core.api.auth import auth_check
+from core.models import Slice
+from core.api.sites import _get_sites
 
 def _get_slices(filter):
     if isinstance(filter, StringTypes) and filter.isdigit():
similarity index 79%
rename from plstackapi/core/api/slivers.py
rename to planetstack/core/api/slivers.py
index cc45b8d..e3244a4 100644 (file)
@@ -1,14 +1,14 @@
 from types import StringTypes
 from django.contrib.auth import authenticate
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
-from plstackapi.core.models import Sliver, Slice
-from plstackapi.core.api.images import _get_images
-from plstackapi.core.api.keys import _get_keys
-from plstackapi.core.api.slices import _get_slices
-from plstackapi.core.api.deployment_networks import _get_deployment_networks
-from plstackapi.core.api.nodes import _get_nodes
+from openstack.client import OpenStackClient
+from openstack.driver import OpenStackDriver
+from core.api.auth import auth_check
+from core.models import Sliver, Slice
+from core.api.images import _get_images
+from core.api.keys import _get_keys
+from core.api.slices import _get_slices
+from core.api.deployment_networks import _get_deployment_networks
+from core.api.nodes import _get_nodes
  
 
 def _get_slivers(filter):
similarity index 90%
rename from plstackapi/core/api/subnets.py
rename to planetstack/core/api/subnets.py
index b62a7ef..d618eda 100644 (file)
@@ -1,10 +1,10 @@
 import commands
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
-from plstackapi.core.models import Subnet
-from plstackapi.core.api.slices import _get_slices
+from openstack.client import OpenStackClient
+from openstack.driver import OpenStackDriver
+from core.api.auth import auth_check
+from core.models import Subnet
+from core.api.slices import _get_slices
 
 
 def _get_subnets(filter):
similarity index 74%
rename from plstackapi/core/api/users.py
rename to planetstack/core/api/users.py
index 5b89389..3b157ac 100644 (file)
@@ -1,19 +1,19 @@
 from types import StringTypes
-from plstackapi.openstack.client import OpenStackClient
-from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.core.api.auth import auth_check
-from plstackapi.core.models import PLUser, Site
-from plstackapi.core.api.sites import _get_sites
+from openstack.client import OpenStackClient
+from openstack.driver import OpenStackDriver
+from core.api.auth import auth_check
+from core.models import User, Site
+from core.api.sites import _get_sites
 
 def _get_users(filter):
     if isinstance(filter, StringTypes) and filter.isdigit():
         filter = int(filter)
     if isinstance(filter, int):
-        users = PLUser.objects.filter(id=filter)
+        users = User.objects.filter(id=filter)
     elif isinstance(filter, StringTypes):
-        users = PLUser.objects.filter(email=filter)
+        users = User.objects.filter(email=filter)
     elif isinstance(filter, dict):
-        users = PLUser.objects.filter(**filter)
+        users = User.objects.filter(**filter)
     else:
         users = []
     return users 
@@ -22,20 +22,20 @@ def add_user(auth, fields):
     driver = OpenStackDriver(client = auth_check(auth))
     sites = _get_sites(fields.get('site')) 
     if sites: fields['site'] = sites[0]     
-    user = PLUser(**fields)
+    user = User(**fields)
     nova_fields = {'name': user.email[:user.email.find('@')],
                    'email': user.email, 
                    'password': fields.get('password'),
                    'enabled': user.enabled}    
     nova_user = driver.create_user(**nova_fields)
     #driver.add_user_user(user.id, user.site.tenant_id, 'user')
-    user.user_id=nova_user.id
+    user.kuser_id=nova_user.id
     user.save()
     return user
 
 def update_user(auth, id, **fields):
     driver = OpenStackDriver(client = auth_check(auth))
-    users = PLUser.objects.filter(id=id)
+    users = User.objects.filter(id=id)
     if not users:
         return
 
@@ -48,7 +48,7 @@ def update_user(auth, id, **fields):
         nova_fields['password'] = fields['password']
     if 'enabled' in fields:
         nova_fields['enabled'] = fields['enabled']
-    driver.update_user(user.user_id, **nova_fields)
+    driver.update_user(user.kuser_id, **nova_fields)
     sites = _get_sites(fields.get('site'))
     if sites: fields['site'] = sites[0]
     user.update(**fields)
@@ -58,7 +58,7 @@ def delete_user(auth, filter={}):
     driver = OpenStackDriver(client = auth_check(auth))   
     users = _get_users(filter)
     for user in users:
-        driver.delete_user(id=user.user_id) 
+        driver.delete_user(id=user.kuser_id) 
         user.delete()
     return 1
 
diff --git a/planetstack/core/models/__init__.py b/planetstack/core/models/__init__.py
new file mode 100644 (file)
index 0000000..4d9387b
--- /dev/null
@@ -0,0 +1,14 @@
+from .plcorebase import PlCoreBase
+from .deploymentnetwork import DeploymentNetwork
+from .site import Site
+from .site import SitePrivilege
+from .image import Image
+from .key import Key
+from .user import User
+from .role import Role
+from .node import Node
+from .slice import Slice
+from .slice import SliceMembership
+from .sliver import Sliver
+from .subnet import Subnet
+
similarity index 85%
rename from plstackapi/core/models/deploymentnetwork.py
rename to planetstack/core/models/deploymentnetwork.py
index 740be33..4068ee9 100644 (file)
@@ -1,6 +1,6 @@
 import os
 from django.db import models
-from plstackapi.core.models import PlCoreBase
+from core.models import PlCoreBase
 
 # Create your models here.
 
similarity index 89%
rename from plstackapi/core/models/image.py
rename to planetstack/core/models/image.py
index 930b7df..b4803e2 100644 (file)
@@ -1,6 +1,6 @@
 import os
 from django.db import models
-from plstackapi.core.models import PlCoreBase
+from core.models import PlCoreBase
 
 # Create your models here.
 
similarity index 74%
rename from plstackapi/core/models/key.py
rename to planetstack/core/models/key.py
index afbebff..98cfb9b 100644 (file)
@@ -1,17 +1,15 @@
 import os
 from django.db import models
-from plstackapi.core.models import PlCoreBase
-from plstackapi.core.models import PLUser
+from core.models import PlCoreBase
 
 # Create your models here.
 
 class Key(PlCoreBase):
     name = models.CharField(max_length=256, unique=True)
-    key_id = models.CharField(max_length=256, unique=True)
+    nkey_id = models.CharField(max_length=256, unique=True)
     key = models.CharField(max_length=512)
     type = models.CharField(max_length=256)
     blacklisted = models.BooleanField(default=False)
-    user = models.ForeignKey(PLUser, related_name='keys')
 
     def __unicode__(self):  return u'%s' % (self.name)
 
similarity index 73%
rename from plstackapi/core/models/node.py
rename to planetstack/core/models/node.py
index a4252b1..a249628 100644 (file)
@@ -1,8 +1,8 @@
 import os
 from django.db import models
-from plstackapi.core.models import PlCoreBase
-from plstackapi.core.models import Site
-from plstackapi.core.models import DeploymentNetwork
+from core.models import PlCoreBase
+from core.models import Site
+from core.models import DeploymentNetwork
 
 # Create your models here.
 
similarity index 93%
rename from plstackapi/core/models/role.py
rename to planetstack/core/models/role.py
index 41bfd62..b3611c1 100644 (file)
@@ -1,7 +1,7 @@
 import os
 import datetime
 from django.db import models
-from plstackapi.core.models import PlCoreBase
+from core.models import PlCoreBase
 
 class Role(PlCoreBase):
 
similarity index 81%
rename from plstackapi/core/models/site.py
rename to planetstack/core/models/site.py
index f23ef3f..ebf2ab9 100644 (file)
@@ -1,7 +1,7 @@
 import os
 from django.db import models
-from plstackapi.core.models import PlCoreBase
-from plstackapi.core.models import DeploymentNetwork
+from core.models import PlCoreBase
+from core.models import DeploymentNetwork
 
 
 class Site(PlCoreBase):
@@ -32,18 +32,18 @@ class Site(PlCoreBase):
 
 class SitePrivilege(PlCoreBase):
 
-    user = models.ForeignKey('PLUser', related_name='site_privileges')
+    user = models.ForeignKey('User', related_name='site_privileges')
     site = models.ForeignKey('Site', related_name='site_privileges')
     role = models.ForeignKey('Role')
 
     def __unicode__(self):  return u'%s %s %s' % (self.site, self.user, self.role)
 
     def save(self, *args, **kwds):
-        self.os_manager.driver.add_user_role(self.user.user_id, self.site.tenant_id, self.role.role_type)
+        self.os_manager.driver.add_user_role(self.user.kuser_id, self.site.tenant_id, self.role.role_type)
         super(SitePrivilege, self).save(*args, **kwds)
 
     def delete(self, *args, **kwds):
-        self.os_manager.driver.delete_user_role(self.user.user_id, self.site.tenant_id, self.role.role_type)
+        self.os_manager.driver.delete_user_role(self.user.kuser_id, self.site.tenant_id, self.role.role_type)
         super(SitePrivilege, self).delete(*args, **kwds)
 
 
similarity index 80%
rename from plstackapi/core/models/slice.py
rename to planetstack/core/models/slice.py
index d509cc0..539be24 100644 (file)
@@ -1,10 +1,10 @@
 import os
 from django.db import models
-from plstackapi.core.models import PlCoreBase
-from plstackapi.core.models import Site
-from plstackapi.core.models import PLUser
-from plstackapi.core.models import Role
-from plstackapi.core.models import DeploymentNetwork
+from core.models import PlCoreBase
+from core.models import Site
+from core.models import User
+from core.models import Role
+from core.models import DeploymentNetwork
 
 # Create your models here.
 
@@ -36,16 +36,16 @@ class Slice(PlCoreBase):
         super(Slice, self).delete(*args, **kwds)    
 
 class SliceMembership(PlCoreBase):
-    user = models.ForeignKey('PLUser', related_name='slice_memberships')
+    user = models.ForeignKey('User', related_name='slice_memberships')
     slice = models.ForeignKey('Slice', related_name='slice_memberships')
     role = models.ForeignKey('Role')
 
     def __unicode__(self):  return u'%s %s %s' % (self.slice, self.user, self.role)
 
     def save(self, *args, **kwds):
-        self.os_manager.driver.add_user_role(self.user.user_id, self.slice.tenant_id, self.role.role_type)
+        self.os_manager.driver.add_user_role(self.user.kuser_id, self.slice.tenant_id, self.role.role_type)
         super(SliceMembership, self).save(*args, **kwds)
 
     def delete(self, *args, **kwds):
-        self.os_manager.driver.delete_user_role(self.user.user_id, self.slice.tenant_id, self.role.role_type)
+        self.os_manager.driver.delete_user_role(self.user.kuser_id, self.slice.tenant_id, self.role.role_type)
         super(SliceMembership, self).delete(*args, **kwds)
similarity index 78%
rename from plstackapi/core/models/sliver.py
rename to planetstack/core/models/sliver.py
index 9a3ca81..580c2af 100644 (file)
@@ -1,13 +1,13 @@
 import os
 from django.db import models
 from django.core import exceptions
-from plstackapi.core.models import PlCoreBase
-from plstackapi.core.models import Image
-from plstackapi.core.models import Key
-from plstackapi.core.models import Slice
-from plstackapi.core.models import Node
-from plstackapi.core.models import Site
-from plstackapi.core.models import DeploymentNetwork
+from core.models import PlCoreBase
+from core.models import Image
+from core.models import Key
+from core.models import Slice
+from core.models import Node
+from core.models import Site
+from core.models import DeploymentNetwork
 
 # Create your models here.
 class Sliver(PlCoreBase):
@@ -23,7 +23,7 @@ class Sliver(PlCoreBase):
     numberCores = models.IntegerField(verbose_name="Number of Cores", help_text="Number of cores for sliver", default=2)
 
 
-    def __unicode__(self):  return u'%s::%s' % (self.slice, self.deploymentNetwork)
+    def __unicode__(self):  return u'%s' % (self.instance_name)
 
     def save(self, *args, **kwds):
         if not self.slice.subnet.exists():
similarity index 89%
rename from plstackapi/core/models/subnet.py
rename to planetstack/core/models/subnet.py
index be8c938..cad9fea 100644 (file)
@@ -1,8 +1,8 @@
 import os
 import commands    
 from django.db import models
-from plstackapi.core.models import PlCoreBase
-from plstackapi.core.models import Slice
+from core.models import PlCoreBase
+from core.models import Slice
 
 # Create your models here.
 
similarity index 69%
rename from plstackapi/core/models/pluser.py
rename to planetstack/core/models/user.py
index 474f044..6c776b1 100644 (file)
@@ -1,14 +1,16 @@
 import os
 import datetime
 from django.db import models
-from plstackapi.core.models import PlCoreBase
-from plstackapi.core.models import Site
-from plstackapi.openstack.manager import OpenStackManager
-from django.contrib.auth.models import User, AbstractBaseUser, UserManager, BaseUserManager
+from core.models import PlCoreBase
+from core.models import Site
+from core.models import Key
+from openstack.manager import OpenStackManager
+from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
 
 # Create your models here.
+has_openstack = False
 
-class PLUserManager(BaseUserManager):
+class UserManager(BaseUserManager):
     def create_user(self, email, firstname, lastname, password=None):
         """
         Creates and saves a User with the given email, date of
@@ -18,12 +20,12 @@ class PLUserManager(BaseUserManager):
             raise ValueError('Users must have an email address')
 
         user = self.model(
-            email=PLUserManager.normalize_email(email),
+            email=UserManager.normalize_email(email),
             firstname=firstname,
-            lastname=lastname
+            lastname=lastname,
+            password=password
         )
-
-        user.set_password(password)
+        #user.set_password(password)
         user.is_admin = True
         user.save(using=self._db)
         return user
@@ -43,7 +45,7 @@ class PLUserManager(BaseUserManager):
         return user
 
 
-class PLUser(AbstractBaseUser):
+class User(AbstractBaseUser):
 
     class Meta:
         app_label = "core"
@@ -55,19 +57,20 @@ class PLUser(AbstractBaseUser):
         db_index=True,
     )
 
-    user_id = models.CharField(help_text="keystone user id", max_length=200) 
+    kuser_id = models.CharField(help_text="keystone user id", max_length=200) 
     firstname = models.CharField(help_text="person's given name", max_length=200)
     lastname = models.CharField(help_text="person's surname", max_length=200)
 
     phone = models.CharField(null=True, blank=True, help_text="phone number contact", max_length=100)
     user_url = models.URLField(null=True, blank=True)
     site = models.ForeignKey(Site, related_name='users', verbose_name="Site this user will be homed too", null=True)
+    key = models.ForeignKey(Key, related_name='user', null=True, blank=True)
 
     is_active = models.BooleanField(default=True)
     is_admin = models.BooleanField(default=True)
     is_staff = models.BooleanField(default=True)
 
-    objects = PLUserManager()
+    objects = UserManager()
 
     USERNAME_FIELD = 'email'
     REQUIRED_FIELDS = ['firstname', 'lastname']
@@ -101,16 +104,19 @@ class PLUser(AbstractBaseUser):
 
 
     def save(self, *args, **kwds):
-        if not hasattr(self, 'os_manager'):
-            setattr(self, 'os_manager', OpenStackManager())
+        if has_openstack:
+            if not hasattr(self, 'os_manager'):
+                setattr(self, 'os_manager', OpenStackManager())
 
-        self.os_manager.save_user(self)
-        self.set_password(self.password)    
-        super(PLUser, self).save(*args, **kwds)   
+            self.os_manager.save_user(self)
+        if not self.id:
+            self.set_password(self.password)    
+        super(User, self).save(*args, **kwds)   
 
     def delete(self, *args, **kwds):
-        if not hasattr(self, 'os_manager'):
-            setattr(self, 'os_manager', OpenStackManager())
+        if has_openstack:
+            if not hasattr(self, 'os_manager'):
+                setattr(self, 'os_manager', OpenStackManager())
 
-        self.os_manager.delete_user(self)
-        super(PLUser, self).delete(*args, **kwds)    
+            self.os_manager.delete_user(self)
+        super(User, self).delete(*args, **kwds)    
similarity index 98%
rename from plstackapi/core/serializers.py
rename to planetstack/core/serializers.py
index a341508..55cf7c8 100644 (file)
@@ -1,6 +1,6 @@
 from django.forms import widgets
 from rest_framework import serializers
-from plstackapi.core.models import *
+from core.models import *
 
 
 class RoleSerializer(serializers.HyperlinkedModelSerializer):
@@ -20,9 +20,10 @@ class UserSerializer(serializers.HyperlinkedModelSerializer):
     slice_memberships = serializers.HyperlinkedRelatedField(view_name='slice-membership-detail')
     site_privileges = serializers.HyperlinkedRelatedField(view_name='site-privilege-detail')
     class Meta:
-        model = PLUser
+        model = User
         fields = ('id',
                   'user_id', 
+                  'kuser_id', 
                   'firstname', 
                   'lastname',
                   'email', 
@@ -193,7 +194,7 @@ class ImageSerializer(serializers.HyperlinkedModelSerializer):
 
 serializerLookUp = { 
                  Role: RoleSerializer,
-                 PLUser: UserSerializer,
+                 User: UserSerializer,
                  Key: KeySerializer,
                  Site: SiteSerializer,
                  SitePrivilege: SitePrivilegeSerializer,
similarity index 89%
rename from plstackapi/core/views/deployment_networks.py
rename to planetstack/core/views/deployment_networks.py
index 1508b0c..63220a4 100644 (file)
@@ -3,9 +3,9 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.core.api.deployment_networks import add_deployment_network, delete_deployment_network, get_deployment_networks
-from plstackapi.core.serializers import DeploymentNetworkSerializer
-from plstackapi.util.request import parse_request
+from core.api.deployment_networks import add_deployment_network, delete_deployment_network, get_deployment_networks
+from core.serializers import DeploymentNetworkSerializer
+from util.request import parse_request
 
 
 class DeploymentNetworkListCreate(APIView):
similarity index 90%
rename from plstackapi/core/views/images.py
rename to planetstack/core/views/images.py
index 4a548ac..7e0ab59 100644 (file)
@@ -3,9 +3,9 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.core.api.images import add_image, delete_image, get_images
-from plstackapi.core.serializers import ImageSerializer
-from plstackapi.util.request import parse_request
+from core.api.images import add_image, delete_image, get_images
+from core.serializers import ImageSerializer
+from util.request import parse_request
 
 
 class ImageListCreate(APIView):
similarity index 92%
rename from plstackapi/core/views/keys.py
rename to planetstack/core/views/keys.py
index 80a378d..a5d0995 100644 (file)
@@ -3,9 +3,9 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.core.api.keys import add_key, delete_key, get_keys, update_key
-from plstackapi.core.serializers import KeySerializer
-from plstackapi.util.request import parse_request
+from core.api.keys import add_key, delete_key, get_keys, update_key
+from core.serializers import KeySerializer
+from util.request import parse_request
 
 
 class KeyListCreate(APIView):
similarity index 89%
rename from plstackapi/core/views/nodes.py
rename to planetstack/core/views/nodes.py
index baa9f17..0f1977e 100644 (file)
@@ -3,9 +3,9 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.core.api.nodes import add_node, delete_node, get_nodes, update_node
-from plstackapi.core.serializers import NodeSerializer
-from plstackapi.util.request import parse_request
+from core.api.nodes import add_node, delete_node, get_nodes, update_node
+from core.serializers import NodeSerializer
+from util.request import parse_request
 
 
 class NodeListCreate(APIView):
similarity index 91%
rename from plstackapi/core/views/roles.py
rename to planetstack/core/views/roles.py
index b8c279c..37bb149 100644 (file)
@@ -3,9 +3,9 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.core.api.roles import add_role, delete_role, get_roles
-from plstackapi.core.serializers import RoleSerializer
-from plstackapi.util.request import parse_request
+from core.api.roles import add_role, delete_role, get_roles
+from core.serializers import RoleSerializer
+from util.request import parse_request
 
 
 class RoleListCreate(APIView):
similarity index 90%
rename from plstackapi/core/views/site_privileges.py
rename to planetstack/core/views/site_privileges.py
index b104fa7..37fc371 100644 (file)
@@ -3,9 +3,9 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.core.api.site_privileges import add_site_privilege, delete_site_privilege, get_site_privileges, update_site_privilege
-from plstackapi.core.serializers import SitePrivilegeSerializer
-from plstackapi.util.request import parse_request
+from core.api.site_privileges import add_site_privilege, delete_site_privilege, get_site_privileges, update_site_privilege
+from core.serializers import SitePrivilegeSerializer
+from util.request import parse_request
 
 
 class SitePrivilegeListCreate(APIView):
similarity index 92%
rename from plstackapi/core/views/sites.py
rename to planetstack/core/views/sites.py
index 700547c..6449b67 100644 (file)
@@ -3,9 +3,9 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.core.api.sites import add_site, delete_site, get_sites
-from plstackapi.core.serializers import SiteSerializer
-from plstackapi.util.request import parse_request
+from core.api.sites import add_site, delete_site, get_sites
+from core.serializers import SiteSerializer
+from util.request import parse_request
 
 
 class SiteListCreate(APIView):
similarity index 90%
rename from plstackapi/core/views/slice_memberships.py
rename to planetstack/core/views/slice_memberships.py
index a4f6848..4bb581c 100644 (file)
@@ -3,9 +3,9 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.core.api.slice_memberships import add_slice_membership, delete_slice_membership, get_slice_memberships, update_slice_membership
-from plstackapi.core.serializers import SliceMembershipSerializer
-from plstackapi.util.request import parse_request
+from core.api.slice_memberships import add_slice_membership, delete_slice_membership, get_slice_memberships, update_slice_membership
+from core.serializers import SliceMembershipSerializer
+from util.request import parse_request
 
 
 class SliceMembershipListCreate(APIView):
similarity index 91%
rename from plstackapi/core/views/slices.py
rename to planetstack/core/views/slices.py
index 10bc42c..5954d0c 100644 (file)
@@ -3,9 +3,9 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.core.api.slices import add_slice, delete_slice, get_slices, update_slice
-from plstackapi.core.serializers import SliceSerializer
-from plstackapi.util.request import parse_request
+from core.api.slices import add_slice, delete_slice, get_slices, update_slice
+from core.serializers import SliceSerializer
+from util.request import parse_request
 
 
 class SliceListCreate(APIView):
similarity index 91%
rename from plstackapi/core/views/slivers.py
rename to planetstack/core/views/slivers.py
index 2f5842c..3741cce 100644 (file)
@@ -3,9 +3,9 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.core.api.slivers import add_sliver, delete_sliver, get_slivers, update_sliver
-from plstackapi.core.serializers import SliverSerializer
-from plstackapi.util.request import parse_request
+from core.api.slivers import add_sliver, delete_sliver, get_slivers, update_sliver
+from core.serializers import SliverSerializer
+from util.request import parse_request
 
 
 class SliverListCreate(APIView):
similarity index 91%
rename from plstackapi/core/views/subnets.py
rename to planetstack/core/views/subnets.py
index d96d048..881f615 100644 (file)
@@ -3,9 +3,9 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.core.api.subnets import add_subnet, delete_subnet, get_subnets, update_subnet
-from plstackapi.core.serializers import SubnetSerializer
-from plstackapi.util.request import parse_request
+from core.api.subnets import add_subnet, delete_subnet, get_subnets, update_subnet
+from core.serializers import SubnetSerializer
+from util.request import parse_request
 
 
 class SubnetListCreate(APIView):
similarity index 91%
rename from plstackapi/core/views/users.py
rename to planetstack/core/views/users.py
index 0ec867f..8b27928 100644 (file)
@@ -3,9 +3,9 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.core.api.users import add_user, delete_user, get_users, update_user
-from plstackapi.core.serializers import UserSerializer
-from plstackapi.util.request import parse_request
+from core.api.users import add_user, delete_user, get_users, update_user
+from core.serializers import UserSerializer
+from util.request import parse_request
 
 
 class UserListCreate(APIView):
similarity index 83%
rename from plstackapi/importer/plclassic/importer.py
rename to planetstack/importer/plclassic/importer.py
index b113787..3a65dc3 100644 (file)
@@ -1,13 +1,13 @@
 import os
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "plstackapi.planetstack.settings")
+#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
 import sys
 from optparse import OptionParser
 from getpass import getpass
 import xmlrpclib
-from plstackapi.importer.plclassic.site_importer import SiteImporter
-from plstackapi.importer.plclassic.user_importer import UserImporter
-from plstackapi.importer.plclassic.slice_importer import SliceImporter
-from plstackapi.importer.plclassic.sliver_importer import SliverImporter
+from plclassic.site_importer import SiteImporter
+from plclassic.user_importer import UserImporter
+from plclassic.slice_importer import SliceImporter
+from plclassic.sliver_importer import SliverImporter
 
 
 class Call:
@@ -1,4 +1,4 @@
-from plstackapi.core.models import Site
+from core.models import Site
 
 class SiteImporter:
 
@@ -1,4 +1,4 @@
-from plstackapi.core.models import Slice
+from core.models import Slice
 
 class SliceImporter:
 
@@ -15,7 +15,7 @@ class SliceImporter:
         
 
         if not local_sites:
-            from plstackapi.core.models import Site
+            from core.models import Site
             sites = Site.objects.all()
             for site in sites:
                 local_sites[site.login_base] = site            
similarity index 67%
rename from plstackapi/manage.py
rename to planetstack/manage.py
index ea36bda..c12bf36 100644 (file)
@@ -3,7 +3,7 @@ import os
 import sys
 
 if __name__ == "__main__":
-    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "plstackapi.planetstack.settings")
+    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
 
     from django.core.management import execute_from_command_line
 
similarity index 53%
rename from plstackapi/openstack/client.py
rename to planetstack/openstack/client.py
index 04aef25..f3abbb2 100644 (file)
@@ -1,9 +1,21 @@
-from keystoneclient.v2_0 import client as keystone_client
-from glance import client as glance_client
-from novaclient.v1_1 import client as nova_client
-from quantumclient.v2_0 import client as quantum_client
-
-from plstackapi.planetstack.config import Config
+try:
+    from keystoneclient.v2_0 import client as keystone_client
+    from glance import client as glance_client
+    from novaclient.v1_1 import client as nova_client
+    from quantumclient.v2_0 import client as quantum_client
+    has_openstack = True
+except:
+    has_openstack = False
+
+from planetstack.config import Config
+
+def require_enabled(callable):
+    def wrapper(*args, **kwds):
+        if has_openstack:
+            return callable(*args, **kwds)
+        else:
+            return None
+    return wrapper
 
 def parse_novarc(filename):
     opts = {}
@@ -27,6 +39,7 @@ class Client:
             config = Config(config)
         else:
             config = Config()
+        self.has_openstack = has_openstack
         self.username = config.nova_admin_user
         self.password = config.nova_admin_password
         self.tenant = config.nova_admin_tenant
@@ -47,14 +60,17 @@ class Client:
 class KeystoneClient(Client):
     def __init__(self, *args, **kwds):
         Client.__init__(self, *args, **kwds)
-        self.client = keystone_client.Client(username=self.username,
-                                             password=self.password,
-                                             tenant_name=self.tenant,
-                                             auth_url=self.url)
+        if has_openstack:
+            self.client = keystone_client.Client(username=self.username,
+                                                 password=self.password,
+                                                 tenant_name=self.tenant,
+                                                 auth_url=self.url)
 
+    @require_enabled
     def connect(self, *args, **kwds):
         self.__init__(*args, **kwds)
 
+    @require_enabled
     def __getattr__(self, name):
         return getattr(self.client, name)
 
@@ -62,43 +78,51 @@ class KeystoneClient(Client):
 class GlanceClient(Client):
     def __init__(self, *args, **kwds):
         Client.__init__(self, *args, **kwds)
-        self.client = glance_client.get_client(host='0.0.0.0',
-                                               username=self.username,
-                                               password=self.password,
-                                               tenant=self.tenant,
-                                               auth_url=self.url)
+        if has_openstack:
+            self.client = glance_client.get_client(host='0.0.0.0',
+                                                   username=self.username,
+                                                   password=self.password,
+                                                   tenant=self.tenant,
+                                                   auth_url=self.url)
+    @require_enabled
     def __getattr__(self, name):
         return getattr(self.client, name)
 
 class NovaClient(Client):
     def __init__(self, *args, **kwds):
         Client.__init__(self, *args, **kwds)
-        self.client = nova_client.Client(username=self.username,
-                                         api_key=self.password,
-                                         project_id=self.tenant,
-                                         auth_url=self.url,
-                                         region_name='',
-                                         extensions=[],
-                                         service_type='compute',
-                                         service_name='',
-                                         )
-
+        if has_openstack:
+            self.client = nova_client.Client(username=self.username,
+                                             api_key=self.password,
+                                             project_id=self.tenant,
+                                             auth_url=self.url,
+                                             region_name='',
+                                             extensions=[],
+                                             service_type='compute',
+                                             service_name='',
+                                             )
+
+    @require_enabled
     def connect(self, *args, **kwds):
         self.__init__(*args, **kwds)
 
+    @require_enabled
     def __getattr__(self, name):
         return getattr(self.client, name)
 
 class QuantumClient(Client):
     def __init__(self, *args, **kwds):
         Client.__init__(self, *args, **kwds)
-        self.client = quantum_client.Client(username=self.username,
-                                            password=self.password,
-                                            tenant_name=self.tenant,
-                                            auth_url=self.url)
+        if has_openstack:
+            self.client = quantum_client.Client(username=self.username,
+                                                password=self.password,
+                                                tenant_name=self.tenant,
+                                                auth_url=self.url)
+    @require_enabled
     def connect(self, *args, **kwds):
         self.__init__(*args, **kwds)
 
+    @require_enabled
     def __getattr__(self, name):
         return getattr(self.client, name)
 
@@ -115,9 +139,10 @@ class OpenStackClient:
         self.nova = NovaClient(*args, **kwds)
         self.quantum = QuantumClient(*args, **kwds)
 
+    @require_enabled
     def connect(self, *args, **kwds):
         self.__init__(*args, **kwds)
-        
 
+    @require_enabled
     def authenticate(self):
         return self.keystone.authenticate()
similarity index 95%
rename from plstackapi/openstack/driver.py
rename to planetstack/openstack/driver.py
index 640176f..6b04b5d 100644 (file)
@@ -1,6 +1,7 @@
-from plstackapi.planetstack.config import Config
-from plstackapi.openstack.client import OpenStackClient
+from planetstack.config import Config
+from openstack.client import OpenStackClient
 
+has_openstack = False
 class OpenStackDriver:
 
     def __init__(self, config = None, client=None): 
@@ -10,7 +11,10 @@ class OpenStackDriver:
             self.config = Config() 
 
         self.admin_client = OpenStackClient()
-        self.admin_user = self.admin_client.keystone.users.find(name=self.admin_client.keystone.username)
+        if has_openstack:
+            self.admin_user = self.admin_client.keystone.users.find(name=self.admin_client.keystone.username)
+        else:
+            self.admin_user = None
 
         if client:
             self.shell = client
@@ -71,8 +75,8 @@ class OpenStackDriver:
             self.shell.keystone.users.delete(user)
         return 1 
 
-    def add_user_role(self, user_id, tenant_id, role_name):
-        user = self.shell.keystone.users.find(id=user_id)
+    def add_user_role(self, kuser_id, tenant_id, role_name):
+        user = self.shell.keystone.users.find(id=kuser_id)
         tenant = self.shell.keystone.tenants.find(id=tenant_id)
         role = self.shell.keystone.roles.find(name=role_name)
 
@@ -86,8 +90,8 @@ class OpenStackDriver:
 
         return 1
 
-    def delete_user_role(self, user_id, tenant_id, role_name):
-        user = self.shell.keystone.users.find(id=user_id)
+    def delete_user_role(self, kuser_id, tenant_id, role_name):
+        user = self.shell.keystone.users.find(id=kuser_id)
         tenant = self.shell.keystone.tenants.find(id=tenant_id)
         role = self.shell.keystone.roles.find(name=role_name)
 
similarity index 91%
rename from plstackapi/openstack/manager.py
rename to planetstack/openstack/manager.py
index c55e752..788a621 100644 (file)
@@ -1,16 +1,20 @@
-from plstackapi.planetstack import settings
-from django.core import management
-management.setup_environ(settings)
+from planetstack import settings
+#from django.core import management
+#management.setup_environ(settings)
+import os
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+
 try:
-    from plstackapi.openstack.client import OpenStackClient
-    from plstackapi.openstack.driver import OpenStackDriver
-    from plstackapi.planetstack.config import Config
-    from plstackapi.core.models import * 
+    from openstack.client import OpenStackClient
+    from openstack.driver import OpenStackDriver
+    from planetstack.config import Config
+    from core.models import * 
     has_openstack = True
 except:
-    has_openpstack = False
+    has_openstack = False
 
-manager_enabled = Config().api_nova_enabled
+#manager_enabled = Config().api_nova_enabled
+manager_enabled = False
 
 def require_enabled(callable):
     def wrapper(*args, **kwds):
@@ -34,7 +38,7 @@ class OpenStackManager:
         self.caller=caller
         if not self.caller:
             self.caller = self.driver.admin_user
-            self.caller.user_id = self.caller.id 
+            self.caller.kuser_id = self.caller.id 
 
     @require_enabled
     def save_role(self, role):
@@ -62,19 +66,19 @@ class OpenStackManager:
 
     @require_enabled
     def save_user(self, user):
-        if not user.user_id:
+        if not user.kuser_id:
             name = user.email[:user.email.find('@')]
             user_fields = {'name': name,
                            'email': user.email,
                            'password': user.password,
                            'enabled': True}
             keystone_user = self.driver.create_user(**user_fields)
-            user.user_id = keystone_user.id
+            user.kuser_id = keystone_user.id
     
     @require_enabled
     def delete_user(self, user):
-        if user.user_id:
-            self.driver.delete_user(user.user_id)        
+        if user.kuser_id:
+            self.driver.delete_user(user.kuser_id)        
     
 
     
@@ -86,7 +90,7 @@ class OpenStackManager:
                                                enabled=site.enabled)
             site.tenant_id = tenant.id
             # give caller an admin role at the tenant they've created
-            self.driver.add_user_role(self.caller.user_id, tenant.id, 'admin')
+            self.driver.add_user_role(self.caller.kuser_id, tenant.id, 'admin')
 
         # update the record
         if site.id and site.tenant_id:
@@ -109,7 +113,7 @@ class OpenStackManager:
             slice.tenant_id = tenant.id
 
             # give caller an admin role at the tenant they've created
-            self.driver.add_user_role(self.caller.user_id, tenant.id, 'admin')
+            self.driver.add_user_role(self.caller.kuser_id, tenant.id, 'admin')
 
             # refresh credentials using this tenant
             self.driver.shell.connect(username=self.driver.shell.keystone.username,
similarity index 76%
rename from plstackapi/openstack/siteagent.py
rename to planetstack/openstack/siteagent.py
index dab9e8a..a57fa0b 100644 (file)
@@ -1,9 +1,9 @@
 import os
 import sys
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "plstackapi.planetstack.settings")
+#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
 import time
-from plstackapi.core.models.site import Site
-from plstackapi.openstack.manager import OpenStackManager    
+from core.models.site import Site
+from openstack.manager import OpenStackManager    
 
 class SiteAgent:
     def run(self):
similarity index 86%
rename from plstackapi/openstack/sliveragent.py
rename to planetstack/openstack/sliveragent.py
index f07f603..b2f29cf 100644 (file)
@@ -1,9 +1,9 @@
 import os
 import sys
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "plstackapi.planetstack.settings")
+#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
 import time
-from plstackapi.core.models.sliver import Sliver
-from plstackapi.openstack.manager import OpenStackManager
+from core.models.sliver import Sliver
+from openstack.manager import OpenStackManager
 
 class SliverAgent:
 
similarity index 98%
rename from plstackapi/planetstack/config.py
rename to planetstack/planetstack/config.py
index 2f98e6f..7927803 100644 (file)
@@ -6,7 +6,7 @@ import ConfigParser
 import tempfile
 import codecs
 from StringIO import StringIO
-from plstackapi.util.xml import Xml
+from util.xml import Xml
 
 default_config = \
 """
@@ -20,7 +20,7 @@ def str2bool(v):
 
 class Config:
 
-    def __init__(self, config_file='/etc/planetstack/plstackapi_config'):
+    def __init__(self, config_file='/opt/planetstack/plstackapi_config'):
         self._files = []
         self.config_path = os.path.dirname(config_file)
         self.config = ConfigParser.ConfigParser()
similarity index 90%
rename from plstackapi/planetstack/settings.py
rename to planetstack/planetstack/settings.py
index 40e839a..8970c42 100644 (file)
@@ -9,22 +9,20 @@ ADMINS = (
 
 MANAGERS = ADMINS
 
-AUTH_USER_MODEL = 'core.PLUser'
-
-from plstackapi.planetstack.config import Config
-config = Config()
 DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
-        'NAME': config.db_name,                      # Or path to database file if using sqlite3.
+        'NAME': 'planetstack',                      # Or path to database file if using sqlite3.
         # The following settings are not used with sqlite3:
-        'USER': config.db_user,
-        'PASSWORD': config.db_password,
-        'HOST': config.db_host,                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
+        'USER': 'postgres',
+        'PASSWORD': 'admin',
+        'HOST': 'localhost',                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
         'PORT': '',                      # Set to empty string for default.
     }
 }
 
+AUTH_USER_MODEL = 'core.User'
+
 # Hosts/domain names that are valid for this site; required if DEBUG is False
 # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
 ALLOWED_HOSTS = []
@@ -106,15 +104,16 @@ MIDDLEWARE_CLASSES = (
     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 )
 
-ROOT_URLCONF = 'plstackapi.core.urls'
+ROOT_URLCONF = 'planetstack.urls'
 
 # Python dotted path to the WSGI application used by Django's runserver.
-WSGI_APPLICATION = 'plstackapi.planetstack.wsgi.application'
+WSGI_APPLICATION = 'planetstack.wsgi.application'
 
 TEMPLATE_DIRS = (
     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
     # Always use forward slashes, even on Windows.
     # Don't forget to use absolute paths, not relative paths.
+    "/opt/planetstack/templates"
 )
 
 INSTALLED_APPS = (
@@ -130,9 +129,8 @@ INSTALLED_APPS = (
     'django.contrib.admindocs',
     'rest_framework',
     'django_extensions',
+    'core',
     'django_evolution',
-    #'plstackapi.planetstack',
-    'plstackapi.core',
 )
 
 # A sample logging configuration. The only tangible logging
similarity index 73%
rename from plstackapi/core/urls.py
rename to planetstack/planetstack/urls.py
index 2e8814f..58d9ce7 100644 (file)
@@ -2,20 +2,20 @@ from django.conf.urls import patterns, include, url
 
 # Uncomment the next two lines to enable the admin:
 from django.contrib import admin
-from plstackapi.core.views.roles import RoleListCreate, RoleRetrieveUpdateDestroy
-from plstackapi.core.views.sites import SiteListCreate, SiteRetrieveUpdateDestroy
-from plstackapi.core.views.site_privileges import SitePrivilegeListCreate, SitePrivilegeRetrieveUpdateDestroy
-from plstackapi.core.views.users import UserListCreate, UserRetrieveUpdateDestroy
-from plstackapi.core.views.slices import SliceListCreate, SliceRetrieveUpdateDestroy
-from plstackapi.core.views.slice_memberships import SliceMembershipListCreate, SliceMembershipRetrieveUpdateDestroy
-from plstackapi.core.views.subnets import SubnetListCreate, SubnetRetrieveUpdateDestroy
-from plstackapi.core.views.slivers import SliverListCreate, SliverRetrieveUpdateDestroy
-from plstackapi.core.views.keys import KeyListCreate, KeyRetrieveUpdateDestroy
-from plstackapi.core.views.deployment_networks import DeploymentNetworkListCreate, DeploymentNetworkRetrieveUpdateDestroy
-from plstackapi.core.views.images import ImageListCreate, ImageRetrieveUpdateDestroy
-from plstackapi.core.views.nodes import NodeListCreate, NodeRetrieveUpdateDestroy
-from plstackapi.core.models import Site
-from plstackapi.core.api_root import api_root
+from core.views.roles import RoleListCreate, RoleRetrieveUpdateDestroy
+from core.views.sites import SiteListCreate, SiteRetrieveUpdateDestroy
+from core.views.site_privileges import SitePrivilegeListCreate, SitePrivilegeRetrieveUpdateDestroy
+from core.views.users import UserListCreate, UserRetrieveUpdateDestroy
+from core.views.slices import SliceListCreate, SliceRetrieveUpdateDestroy
+from core.views.slice_memberships import SliceMembershipListCreate, SliceMembershipRetrieveUpdateDestroy
+from core.views.subnets import SubnetListCreate, SubnetRetrieveUpdateDestroy
+from core.views.slivers import SliverListCreate, SliverRetrieveUpdateDestroy
+from core.views.keys import KeyListCreate, KeyRetrieveUpdateDestroy
+from core.views.deployment_networks import DeploymentNetworkListCreate, DeploymentNetworkRetrieveUpdateDestroy
+from core.views.images import ImageListCreate, ImageRetrieveUpdateDestroy
+from core.views.nodes import NodeListCreate, NodeRetrieveUpdateDestroy
+from core.models import Site
+from core.api_root import api_root
 from rest_framework import generics
 
 admin.autodiscover()
similarity index 94%
rename from plstackapi/planetstack/wsgi.py
rename to planetstack/planetstack/wsgi.py
index 11c4ce5..6e03e11 100644 (file)
@@ -19,7 +19,7 @@ import os
 # if running multiple sites in the same mod_wsgi process. To fix this, use
 # mod_wsgi daemon mode with each site in its own daemon process, or use
 # os.environ["DJANGO_SETTINGS_MODULE"] = "planetstack.settings"
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "plstackapi.planetstack.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
 
 # This application object is used by any WSGI server configured to use this
 # file. This includes Django's development server, if the WSGI_APPLICATION
similarity index 71%
rename from plstackapi/plstackapi-debug-server.py
rename to planetstack/plstackapi-debug-server.py
index 56542bf..aa60119 100644 (file)
@@ -3,14 +3,13 @@ import os
 import sys
 import threading
 
-from plstackapi.planetstack.config import Config 
-from plstackapi.openstack.sliveragent import SliverAgent
-from plstackapi.openstack.siteagent import SiteAgent
+from planetstack.config import Config 
+from openstack.sliveragent import SliverAgent
+from openstack.siteagent import SiteAgent
 
 if __name__ == '__main__':
 
     # bootstrap envirnment
-    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "plstackapi.planetstack.settings")
     from django.core.management import ManagementUtility
     config = Config()
     url = "%s:%s" % (config.api_host, config.api_port)
diff --git a/planetstack/templates/admin/base_site.html b/planetstack/templates/admin/base_site.html
new file mode 100644 (file)
index 0000000..2bd6c82
--- /dev/null
@@ -0,0 +1,18 @@
+{% extends "admin/base.html" %}
+{% load i18n %}
+{% block title %}{{ title }} | {% trans 'PlanetStack' %}{% endblock %}
+{% block extrastyle %}
+<style>
+#header{ background-color: #333940; border-bottom: solid 3px #999; }
+#branding h1{ color: #fff; }
+.module h2, .module caption, .inline-group h2 { background:#ccc url(/admin_media/img/admin/nav-bg.gif) bottom left repeat-x; color: #333940; }
+a.section:link, a.section:visited { color: #666666; }
+</style>
+{% endblock %}
+
+{% block branding %}
+<h1 id="site-name">{% trans 'PlanetStack Administration' %}</h1>
+{% endblock %}
+
+{% block nav-global %}{% endblock %}
diff --git a/planetstack/templates/admin/core/SiteDeploymentNetwork/sitedepnettabular.html b/planetstack/templates/admin/core/SiteDeploymentNetwork/sitedepnettabular.html
new file mode 100644 (file)
index 0000000..71a62ba
--- /dev/null
@@ -0,0 +1,79 @@
+{% load i18n admin_static admin_modify %}
+<div class="inline-group" id="{{ inline_admin_formset.formset.prefix }}-group">
+  <div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
+{{ inline_admin_formset.formset.management_form }}
+<fieldset class="module">
+   <h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
+   {{ inline_admin_formset.formset.non_form_errors }}
+   <table>
+     <thead><tr>
+     {% for field in inline_admin_formset.fields %}
+       {% if not field.widget.is_hidden %}
+         <th{% if forloop.first %} colspan="2"{% endif %}{% if field.required %} class="required"{% endif %}>{{ field.label|capfirst }}
+         {% if field.help_text %}&nbsp;<img src="{% static "admin/img/icon-unknown.gif" %}" class="help help-tooltip" width="10" height="10" alt="({{ field.help_text|striptags }})" title="{{ field.help_text|striptags }}" />{% endif %}
+         </th>
+       {% endif %}
+     {% endfor %}
+     {% if inline_admin_formset.formset.can_delete %}<th>{% trans "Delete?" %}</th>{% endif %}
+     </tr></thead>
+
+     <tbody>
+     {% for inline_admin_form in inline_admin_formset %}
+        {% if inline_admin_form.form.non_field_errors %}
+        <tr><td colspan="{{ inline_admin_form|cell_count }}">{{ inline_admin_form.form.non_field_errors }}</td></tr>
+        {% endif %}
+        <tr class="form-row {% cycle "row1" "row2" %} {% if inline_admin_form.original or inline_admin_form.show_url %}has_original{% endif %}{% if forloop.last %} empty-form{% endif %}"
+             id="{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}">
+        <td class="original">
+          {% if inline_admin_form.original or inline_admin_form.show_url %}<p>
+          {% if inline_admin_form.original %} {{ inline_admin_form.original }}{% endif %}
+          {% if inline_admin_form.show_url %}<a href="{% url 'admin:view_on_site' inline_admin_form.original_content_type_id inline_admin_form.original.pk %}">{% trans "View on site" %}</a>{% endif %}
+            </p>{% endif %}
+          {% if inline_admin_form.has_auto_field %}{{ inline_admin_form.pk_field.field }}{% endif %}
+          {{ inline_admin_form.fk_field.field }}
+          {% spaceless %}
+          {% for fieldset in inline_admin_form %}
+            {% for line in fieldset %}
+              {% for field in line %}
+                {% if field.is_hidden %} {{ field.field }} {% endif %}
+              {% endfor %}
+            {% endfor %}
+          {% endfor %}
+          {% endspaceless %}
+        </td>
+        {% for fieldset in inline_admin_form %}
+          {% for line in fieldset %}
+            {% for field in line %}
+              <td{% if field.field.name %} class="field-{{ field.field.name }}"{% endif %}>
+              {% if field.is_readonly %}
+                  <p>{{ field.contents|linebreaksbr }}</p>
+              {% else %}
+                  {{ field.field.errors.as_ul }}
+                  {{ field.field }}
+              {% endif %}
+              </td>
+            {% endfor %}
+          {% endfor %}
+        {% endfor %}
+        {% if inline_admin_formset.formset.can_delete %}
+          <td class="delete">{% if inline_admin_form.original %}{{ inline_admin_form.deletion_field.field }}{% endif %}</td>
+        {% endif %}
+        </tr>
+     {% endfor %}
+     </tbody>
+   </table>
+</fieldset>
+  </div>
+</div>
+
+<script type="text/javascript">
+
+(function($) {
+  $("#{{ inline_admin_formset.formset.prefix }}-group .tabular.inline-related tbody tr").tabularFormset({
+    prefix: "{{ inline_admin_formset.formset.prefix }}",
+    adminStaticPrefix: '{% static "admin/" %}',
+    addText: "{% blocktrans with inline_admin_formset.opts.verbose_name|title as verbose_name %}Add another {{ verbose_name }}{% endblocktrans %}",
+    deleteText: "{% trans 'Remove' %}"
+  });
+})(django.jQuery);
+</script>
diff --git a/plstackapi/core/models/__init__.py b/plstackapi/core/models/__init__.py
deleted file mode 100644 (file)
index e893c6d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-from plstackapi.core.models.plcorebase import PlCoreBase
-from plstackapi.core.models.deploymentnetwork import DeploymentNetwork
-from plstackapi.core.models.site import Site
-from plstackapi.core.models.site import SitePrivilege
-from plstackapi.core.models.image import Image
-from plstackapi.core.models.pluser import PLUser
-from plstackapi.core.models.role import Role
-from plstackapi.core.models.key import Key
-from plstackapi.core.models.node import Node
-from plstackapi.core.models.slice import Slice
-from plstackapi.core.models.slice import SliceMembership
-from plstackapi.core.models.sliver import Sliver
-from plstackapi.core.models.subnet import Subnet
-