organized
Tony Mack [Tue, 9 Apr 2013 20:08:43 +0000 (16:08 -0400)]
27 files changed:
plstackapi/core/admin.py [moved from plstackapi/planetstack/admin.py with 91% similarity]
plstackapi/core/api/__init__.py [moved from plstackapi/planetstack/api/__init__.py with 100% similarity]
plstackapi/core/api/auth.py [moved from plstackapi/planetstack/api/auth.py with 100% similarity]
plstackapi/core/api/deployment_networks.py [moved from plstackapi/planetstack/api/deployment_networks.py with 85% similarity]
plstackapi/core/api/flavors.py [moved from plstackapi/planetstack/api/flavors.py with 79% similarity]
plstackapi/core/api/images.py [moved from plstackapi/planetstack/api/images.py with 79% similarity]
plstackapi/core/api/keys.py [moved from plstackapi/planetstack/api/keys.py with 91% similarity]
plstackapi/core/api/roles.py [moved from plstackapi/planetstack/api/roles.py with 87% similarity]
plstackapi/core/api/sites.py [moved from plstackapi/planetstack/api/sites.py with 92% similarity]
plstackapi/core/api/users.py [moved from plstackapi/planetstack/api/users.py with 95% similarity]
plstackapi/core/fixtures/__init__.py [moved from plstackapi/planetstack/fixtures/__init__.py with 100% similarity]
plstackapi/core/fixtures/initial_data.json [moved from plstackapi/planetstack/fixtures/initial_data.json with 100% similarity]
plstackapi/core/models.py [moved from plstackapi/planetstack/models.py with 96% similarity]
plstackapi/core/serializers.py [moved from plstackapi/planetstack/serializers.py with 99% similarity]
plstackapi/core/urls.py [moved from plstackapi/planetstack/urls.py with 79% similarity]
plstackapi/core/views/__init__.py [moved from plstackapi/planetstack/views/__init__.py with 100% similarity]
plstackapi/core/views/api_root.py [moved from plstackapi/planetstack/views/api_root.py with 100% similarity]
plstackapi/core/views/deployment_networks.py [moved from plstackapi/planetstack/views/deployment_networks.py with 91% similarity]
plstackapi/core/views/flavors.py [moved from plstackapi/planetstack/views/flavors.py with 91% similarity]
plstackapi/core/views/images.py [moved from plstackapi/planetstack/views/images.py with 92% similarity]
plstackapi/core/views/keys.py [moved from plstackapi/planetstack/views/keys.py with 93% similarity]
plstackapi/core/views/roles.py [moved from plstackapi/planetstack/views/roles.py with 93% similarity]
plstackapi/core/views/sites.py [moved from plstackapi/planetstack/views/sites.py with 94% similarity]
plstackapi/core/views/users.py [moved from plstackapi/planetstack/views/users.py with 93% similarity]
plstackapi/importer/plclassic/site_importer.py
plstackapi/importer/plclassic/slice_importer.py
setup.py

similarity index 91%
rename from plstackapi/planetstack/admin.py
rename to plstackapi/core/admin.py
index 7b48aae..c3b655f 100644 (file)
@@ -1,4 +1,4 @@
-from plstackapi.planetstack.models import *
+from plstackapi.core.models import *
 from django.contrib import admin
 
 from django.contrib.auth.admin import UserAdmin
@@ -1,7 +1,7 @@
 from plstackapi.openstack.client import OpenStackClient
 from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.planetstack.api.auth import auth_check
-from plstackapi.planetstack.models import DeploymentNetwork
+from plstackapi.core.api.auth import auth_check
+from plstackapi.core.models import DeploymentNetwork
  
 
 def add_deployment_network(auth, name):
similarity index 79%
rename from plstackapi/planetstack/api/flavors.py
rename to plstackapi/core/api/flavors.py
index c6a67b5..a2d0b23 100644 (file)
@@ -1,7 +1,7 @@
 from plstackapi.openstack.client import OpenStackClient
 from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.planetstack.api.auth import auth_check
-from plstackapi.planetstack.models import Flavor
+from plstackapi.core.api.auth import auth_check
+from plstackapi.core.models import Flavor
  
 
 def add_flavor(auth, fields={}):
similarity index 79%
rename from plstackapi/planetstack/api/images.py
rename to plstackapi/core/api/images.py
index 042219d..b773b0b 100644 (file)
@@ -1,7 +1,7 @@
 from plstackapi.openstack.client import OpenStackClient
 from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.planetstack.api.auth import auth_check
-from plstackapi.planetstack.models import Image
+from plstackapi.core.api.auth import auth_check
+from plstackapi.core.models import Image
  
 
 def add_image(auth, fields={}):
similarity index 91%
rename from plstackapi/planetstack/api/keys.py
rename to plstackapi/core/api/keys.py
index b42eed5..af21f41 100644 (file)
@@ -1,7 +1,7 @@
 from plstackapi.openstack.client import OpenStackClient
 from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.planetstack.api.auth import auth_check
-from plstackapi.planetstack.models import Key, User
+from plstackapi.core.api.auth import auth_check
+from plstackapi.core.models import Key, User
  
 def lookup_user(fields):
     user = None
similarity index 87%
rename from plstackapi/planetstack/api/roles.py
rename to plstackapi/core/api/roles.py
index 5155767..844fb4f 100644 (file)
@@ -1,7 +1,7 @@
 from plstackapi.openstack.client import OpenStackClient
 from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.planetstack.api.auth import auth_check
-from plstackapi.planetstack.models import Role
+from plstackapi.core.api.auth import auth_check
+from plstackapi.core.models import Role
  
 
 def add_role(auth, name):
similarity index 92%
rename from plstackapi/planetstack/api/sites.py
rename to plstackapi/core/api/sites.py
index b9899a7..0d07605 100644 (file)
@@ -1,7 +1,7 @@
 from plstackapi.openstack.client import OpenStackClient
 from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.planetstack.api.auth import auth_check
-from plstackapi.planetstack.models import Site
+from plstackapi.core.api.auth import auth_check
+from plstackapi.core.models import Site
  
 
 def add_site(auth, fields):
similarity index 95%
rename from plstackapi/planetstack/api/users.py
rename to plstackapi/core/api/users.py
index f02f9d2..6862e30 100644 (file)
@@ -1,7 +1,7 @@
 from plstackapi.openstack.client import OpenStackClient
 from plstackapi.openstack.driver import OpenStackDriver
-from plstackapi.planetstack.api.auth import auth_check
-from plstackapi.planetstack.models import User, Site
+from plstackapi.core.api.auth import auth_check
+from plstackapi.core.models import User, Site
  
 def lookup_site(fields):
     site = None
similarity index 96%
rename from plstackapi/planetstack/models.py
rename to plstackapi/core/models.py
index 7561b5e..1ae0a44 100644 (file)
@@ -171,7 +171,7 @@ class SubNet(PlCoreBase):
     ip_version = models.IntegerField()
     start = models.IPAddressField()
     end = models.IPAddressField()
-    slice = models.ForeignKey(Slice )
+    slice = models.ForeignKey(Slice, related_name='subnets')
 
     def __unicode__(self):  return u'%s' % (self.name)
 
@@ -232,18 +232,6 @@ class Key(PlCoreBase):
 
     def __unicode__(self):  return u'%s' % (self.name)
 
-    def save(self, *args, **kwds):
-        driver  = OpenStackDriver()
-        if not self.id:
-            keypair = driver.create_keypair(name=self.name, key=self.key)
-        super(Key, self).save(*args, **kwds)
-
-    def delete(self, *args, **kwds):
-        driver  = OpenStackDriver()
-        driver.delete_keypair(self.name)
-        super(Key, self).delete(*args, **kwds)
-
-
 class Sliver(PlCoreBase):
     instance_id = models.CharField(max_length=200, help_text="Nova instance id")    
     name = models.CharField(max_length=200, help_text="Sliver name")
similarity index 99%
rename from plstackapi/planetstack/serializers.py
rename to plstackapi/core/serializers.py
index 4a38059..0ffd86b 100644 (file)
@@ -1,6 +1,6 @@
 from django.forms import widgets
 from rest_framework import serializers
-from plstackapi.planetstack.models import *
+from plstackapi.core.models import *
 
 
 class RoleSerializer(serializers.HyperlinkedModelSerializer):
similarity index 79%
rename from plstackapi/planetstack/urls.py
rename to plstackapi/core/urls.py
index a57d251..b34e89a 100644 (file)
@@ -2,15 +2,15 @@ from django.conf.urls import patterns, include, url
 
 # Uncomment the next two lines to enable the admin:
 from django.contrib import admin
-from plstackapi.planetstack.views.roles import RoleListCreate, RoleRetrieveUpdateDestroy
-from plstackapi.planetstack.views.sites import SiteListCreate, SiteRetrieveUpdateDestroy
-from plstackapi.planetstack.views.users import UserListCreate, UserRetrieveUpdateDestroy
-from plstackapi.planetstack.views.keys import KeyListCreate, KeyRetrieveUpdateDestroy
-from plstackapi.planetstack.views.deployment_networks import DeploymentNetworkListCreate, DeploymentNetworkRetrieveUpdateDestroy
-from plstackapi.planetstack.views.images import ImageListCreate, ImageRetrieveUpdateDestroy
-from plstackapi.planetstack.views.flavors import FlavorListCreate, FlavorRetrieveUpdateDestroy
-from plstackapi.planetstack.views.api_root import api_root
-from plstackapi.planetstack.models import Site
+from plstackapi.core.views.roles import RoleListCreate, RoleRetrieveUpdateDestroy
+from plstackapi.core.views.sites import SiteListCreate, SiteRetrieveUpdateDestroy
+from plstackapi.core.views.users import UserListCreate, UserRetrieveUpdateDestroy
+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.flavors import FlavorListCreate, FlavorRetrieveUpdateDestroy
+from plstackapi.core.models import Site
+from plstackapi.planetstack.api_root import api_root
 from rest_framework import generics
 
 admin.autodiscover()
@@ -3,8 +3,8 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.planetstack.api.deployment_networks import add_deployment_network, delete_deployment_network, get_deployment_networks
-from plstackapi.planetstack.serializers import DeploymentNetworkSerializer
+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
 
 
similarity index 91%
rename from plstackapi/planetstack/views/flavors.py
rename to plstackapi/core/views/flavors.py
index a522dfc..ef48499 100644 (file)
@@ -3,8 +3,8 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.planetstack.api.flavors import add_flavor, delete_flavor, get_flavors
-from plstackapi.planetstack.serializers import FlavorSerializer
+from plstackapi.core.api.flavors import add_flavor, delete_flavor, get_flavors
+from plstackapi.core.serializers import FlavorSerializer
 from plstackapi.util.request import parse_request
 
 
similarity index 92%
rename from plstackapi/planetstack/views/images.py
rename to plstackapi/core/views/images.py
index 8df0aa9..f48cb71 100644 (file)
@@ -3,8 +3,8 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.planetstack.api.images import add_image, delete_image, get_images
-from plstackapi.planetstack.serializers import ImageSerializer
+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
 
 
similarity index 93%
rename from plstackapi/planetstack/views/keys.py
rename to plstackapi/core/views/keys.py
index a15d020..6b52b8e 100644 (file)
@@ -3,8 +3,8 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.planetstack.api.keys import add_key, delete_key, get_keys, update_key
-from plstackapi.planetstack.serializers import KeySerializer
+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
 
 
similarity index 93%
rename from plstackapi/planetstack/views/roles.py
rename to plstackapi/core/views/roles.py
index 639b008..05eb77e 100644 (file)
@@ -3,8 +3,8 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.planetstack.api.roles import add_role, delete_role, get_roles
-from plstackapi.planetstack.serializers import RoleSerializer
+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
 
 
similarity index 94%
rename from plstackapi/planetstack/views/sites.py
rename to plstackapi/core/views/sites.py
index e003938..700547c 100644 (file)
@@ -3,8 +3,8 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.planetstack.api.sites import add_site, delete_site, get_sites
-from plstackapi.planetstack.serializers import SiteSerializer
+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
 
 
similarity index 93%
rename from plstackapi/planetstack/views/users.py
rename to plstackapi/core/views/users.py
index b0445d0..0ec867f 100644 (file)
@@ -3,8 +3,8 @@ from rest_framework.views import APIView
 from rest_framework.response import Response
 from rest_framework import status
 
-from plstackapi.planetstack.api.users import add_user, delete_user, get_users, update_user
-from plstackapi.planetstack.serializers import UserSerializer
+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
 
 
index 9311890..ca89bf5 100644 (file)
@@ -1,4 +1,4 @@
-from plstackapi.planetstack.models import Site
+from plstackapi.core.models import Site
 
 class SiteImporter:
 
index a3b6382..4f57c3b 100644 (file)
@@ -1,4 +1,4 @@
-from plstackapi.planetstack.models import Slice
+from plstackapi.core.models import Slice
 
 class SliceImporter:
 
@@ -15,7 +15,7 @@ class SliceImporter:
         
 
         if not local_sites:
-            from models import Site
+            from plstackapi.core.models import Site
             sites = Site.objects.all()
             for site in sites:
                 local_sites[site.login_base] = site            
index 7132d80..cd77de2 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ from plstackapi.util.glob import recursive_glob
 setup(name='plstackapi',
       version='0.1',
       description='PlanetStack API',
-      packages=['plstackapi', 'plstackapi/planetstack', 'plstackapi/planetstack/views', 'plstackapi/planetstack/api', 'plstackapi/planetstack/fixtures', 'plstackapi/openstack' ,'plstackapi/util', 'plstackapi/importer', 'plstackapi/importer/plclassic'],
+      packages=['plstackapi', 'plstackapi/core', 'plstackapi/planetstack', 'plstackapi/planetstack/views', 'plstackapi/planetstack/api', 'plstackapi/planetstack/fixtures', 'plstackapi/openstack' ,'plstackapi/util', 'plstackapi/importer', 'plstackapi/importer/plclassic'],
       scripts=['plstackapi/plstackapi-debug-server.py'],
       data_files=[
         ('/etc/planetstack/', ['config/plstackapi_config']),