From 78d938f62ba05e5ea907dcebfa09077aaba76eb0 Mon Sep 17 00:00:00 2001 From: nemesisdesign Date: Wed, 27 Nov 2013 19:13:19 +0100 Subject: [PATCH] fixed setup.py --- nodeshot/networking/dns/__init__.py | 0 nodeshot/networking/dns/admin.py | 68 -------- nodeshot/networking/dns/dnsscript.py | 8 - nodeshot/networking/dns/models.py | 183 -------------------- nodeshot/networking/dns/script/__init__.py | 0 nodeshot/networking/dns/script/dnsimport.py | 9 - nodeshot/networking/dns/script/dnsscript.py | 8 - nodeshot/networking/dns/tests.py | 16 -- nodeshot/networking/dns/views.py | 1 - setup.py | 4 +- 10 files changed, 2 insertions(+), 295 deletions(-) delete mode 100755 nodeshot/networking/dns/__init__.py delete mode 100755 nodeshot/networking/dns/admin.py delete mode 100755 nodeshot/networking/dns/dnsscript.py delete mode 100755 nodeshot/networking/dns/models.py delete mode 100755 nodeshot/networking/dns/script/__init__.py delete mode 100755 nodeshot/networking/dns/script/dnsimport.py delete mode 100755 nodeshot/networking/dns/script/dnsscript.py delete mode 100755 nodeshot/networking/dns/tests.py delete mode 100755 nodeshot/networking/dns/views.py diff --git a/nodeshot/networking/dns/__init__.py b/nodeshot/networking/dns/__init__.py deleted file mode 100755 index e69de29b..00000000 diff --git a/nodeshot/networking/dns/admin.py b/nodeshot/networking/dns/admin.py deleted file mode 100755 index 0239ad3b..00000000 --- a/nodeshot/networking/dns/admin.py +++ /dev/null @@ -1,68 +0,0 @@ -from django.contrib import admin -from nodeshot.contrib import dns - - -class BaseAdmin(admin.ModelAdmin): - """ - Abstract administration model for BaseDate models. - * 'added' and 'updated' fields are everytime readonly - * save on top button is everytime present - """ - save_on_top = True - readonly_fields = ['added', 'updated'] - - class Meta: - abstract = True - - -class DomainAdmin(BaseAdmin): - """ - Domain administration model - """ - list_display = ['name', 'type'] - search_fields = ['name'] - - - -class RecordAdmin(BaseAdmin): - """ - Record administration model - * Is readonly because is generated by the plugin - """ - list_display = ['name', 'type', 'content', 'ttl'] - list_filter = ('domain',) - - search_fields = ['name', 'content'] - - readonly_fields = ['added', 'updated', 'domain', 'name', 'type', 'content', 'ttl', 'prio', 'change_date'] - - -class DomainPolicyAdmin(BaseAdmin): - list_display = ['name'] - list_filter = ('domain',) - - search_fields = ['name'] - - -class UserRecordAdmin(BaseAdmin): - """ - User generated Record administration model - """ - list_display = ['name', 'domain', 'type', 'content'] - list_filter = ('domain',) - - search_fields = ['name', 'content'] - - fieldsets = [ - ('record', {'fields': ['name', 'domain', 'type', 'content'], 'classes': ['wide']}), - (None, {'fields': ['user']}), - ] - - -admin.site.register(dns.models.Domain, DomainAdmin) -admin.site.register(dns.models.Record, RecordAdmin) -admin.site.register(dns.models.DomainPolicy, DomainPolicyAdmin) -admin.site.register(dns.models.UserRecord, UserRecordAdmin) -#admin.site.register(dns.models.DomainManager) - - diff --git a/nodeshot/networking/dns/dnsscript.py b/nodeshot/networking/dns/dnsscript.py deleted file mode 100755 index 645b42f8..00000000 --- a/nodeshot/networking/dns/dnsscript.py +++ /dev/null @@ -1,8 +0,0 @@ -from nodeshot.contrib import dns - -class dnsscript: - - def prova(self): - print 'hello,world' - - return True diff --git a/nodeshot/networking/dns/models.py b/nodeshot/networking/dns/models.py deleted file mode 100755 index 8826247d..00000000 --- a/nodeshot/networking/dns/models.py +++ /dev/null @@ -1,183 +0,0 @@ -# models for nodeshot DNS (integration with powerDNS). - -from django.db import models -from django.utils.translation import ugettext_lazy as _ -from django.contrib.contenttypes import generic -from django.contrib.auth import get_user_model -User = get_user_model() - -from nodeshot.core.base.models import BaseDate -from nodeshot.networking.net.models import Device, Interface - -import hashlib - -ACCESS_LEVELS = ( - ('owner', _('owner')), - ('manager', _('manager')) -) - -DOMAIN_TYPE = ( - 'NATIVE', - 'MASTER', - 'SLAVE', - 'SUPERSLAVE' -) - -RECORD_TYPE = ( #Can be implemented into a table with USER_RECORD_TYPE - 'A', - 'AAAA', - 'AFSDB', - 'CERT', - 'CNAME', - 'DNSKEY', - 'DS', - 'HINFO', - 'KEY', - 'LOC', - 'MX', - 'NAPTR', - 'NS', - 'NSEC', - 'PTR', - 'RP', - 'RRSIG', - 'SOA', - 'SPF', - 'SSHFP', - 'SRV', - 'TXT' -) - -USER_RECORD_TYPE = ( - 'A', - 'AAAA', - 'CNAME', - 'MX' -) - -class Domain(BaseDate): - """ - Domain PowerDNS table - """ - name = models.CharField(_('name'), max_length=255, unique=True, db_index=True) - type = models.CharField(_('type'),max_length=6, choices=((x,x) for x in DOMAIN_TYPE)) - notified_serial = models.PositiveIntegerField(_('notified serial'), null=True, blank=True, default=None) - master = models.CharField(_('master'),max_length=128, null=True,blank=True, default=None) - last_check = models.PositiveIntegerField(_('last check'), null=True, blank=True, default=None) - account = models.CharField(_('account'), max_length=40, null=True, blank=True, default=None) - - class Meta: - db_table = 'domains' - ordering = ('name', 'type') - - def __unicode__(self): - return self.name - - -class Record(BaseDate): - """ - Record PowerDNS table - """ - domain = models.ForeignKey('Domain', verbose_name=_('domain')) - name = models.CharField(_('name'), max_length=255, db_index=True) - type = models.CharField(_('type'),max_length=6, db_index=True, choices=((x,x) for x in RECORD_TYPE)) - content = models.CharField(_('content'),max_length=255) - ttl = models.PositiveIntegerField() - prio = models.PositiveIntegerField(_('priority'), null=True, blank=True) - change_date = models.PositiveIntegerField(_('change date'), null=True, blank=True) - is_automatized = models.BooleanField(_('is automatized'), default=False) - md5hash = models.CharField(_('hash'), max_length=32, null=True, blank=True) - - class Meta: - db_table = 'records' - ordering = ('name', 'type') - unique_together = ('name', 'type', 'content') - - def __unicode__(self): - return self.name - - def save(self, *args, **kwargs): - id_hash = hashlib.md5(self.name + self.type + self.content).hexdigest() - self.md5hash = id_hash - super(Record, self).save(*args, **kwargs) - - -class Supermaster(BaseDate): - """ - Supermaster PowerDNS table (deprecated) - """ - nameserver = models.CharField(max_length=255, db_index=True) - account = models.CharField(max_length=40, null=True, blank=True, db_index=True) - - class Meta: - db_table = 'supermasters' - ordering = ('nameserver', 'account') - unique_together = ('nameserver', 'account') - - def __unicode__(self): - return self.nameserver - - -class LayerToDns(models.Model): - """ - OneToOne tables for customize automatic DNS names - """ - layer = models.OneToOneField('layers.Layer', db_index=True, unique=True) - value = models.SlugField(_('value'), max_length=20) - -class NodeToDns(models.Model): - layer = models.OneToOneField('nodes.Node', db_index=True, unique=True) - value = models.SlugField(_('value'), max_length=20) - -class DeviceToDns(models.Model): - layer = models.OneToOneField(Device, db_index=True, unique=True) - value = models.SlugField(_('value'), max_length=20) - -class InterfaceToDns(models.Model): - layer = models.OneToOneField(Interface, db_index=True) - value = models.SlugField(_('value'), max_length=20) - - -class DomainPolicy(BaseDate): - """ - Domains and Subdomains restrictions and policies for users - """ - name = models.CharField(max_length=255, db_index=True, unique=True) - domain = models.ForeignKey(Domain) - is_automatized = models.BooleanField(default=False) - can_request = models.IntegerField(default=0) - needs_confirmation = models.BooleanField(default=False) - managers = models.ManyToManyField(User, through='DomainManager', verbose_name=_('name')) - - def __unicode__(self): - return u'%s' % self.domain.name - - -class DomainManager(BaseDate): - """ - ManyToMany relation between users and (sub)domains - """ - user = models.ForeignKey(User) - domain = models.ForeignKey(DomainPolicy) - access_level = models.CharField(_('access level'), max_length=10, choices=ACCESS_LEVELS) - - class Meta: - unique_together = ('user', 'domain') - - -class UserRecord(Record): - """ - User's Records table - """ - - user = models.ForeignKey(User) - -class DNSScriptCache(models.Model): - """ - DNS Script Caching table - name is the domain without the extension - content is the IPv4/IPv6 Address - """ - name = models.CharField(_('name'), max_length=255) - content = models.CharField(max_length=29) - diff --git a/nodeshot/networking/dns/script/__init__.py b/nodeshot/networking/dns/script/__init__.py deleted file mode 100755 index e69de29b..00000000 diff --git a/nodeshot/networking/dns/script/dnsimport.py b/nodeshot/networking/dns/script/dnsimport.py deleted file mode 100755 index 82610def..00000000 --- a/nodeshot/networking/dns/script/dnsimport.py +++ /dev/null @@ -1,9 +0,0 @@ -class DnsImport: - - def domainize(self, *args, **kwargs) - """ - Method who convert a string in a domain compatible name, just containing a-z and - - """ - return True - - diff --git a/nodeshot/networking/dns/script/dnsscript.py b/nodeshot/networking/dns/script/dnsscript.py deleted file mode 100755 index 01439b8c..00000000 --- a/nodeshot/networking/dns/script/dnsscript.py +++ /dev/null @@ -1,8 +0,0 @@ -from nodeshot.contrib import dns - -class dnsscript: - - def test(self): - print 'hello,world' - - return True diff --git a/nodeshot/networking/dns/tests.py b/nodeshot/networking/dns/tests.py deleted file mode 100755 index 501deb77..00000000 --- a/nodeshot/networking/dns/tests.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -This file demonstrates writing tests using the unittest module. These will pass -when you run "manage.py test". - -Replace this with more appropriate tests for your application. -""" - -from django.test import TestCase - - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.assertEqual(1 + 1, 2) diff --git a/nodeshot/networking/dns/views.py b/nodeshot/networking/dns/views.py deleted file mode 100755 index 60f00ef0..00000000 --- a/nodeshot/networking/dns/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/setup.py b/setup.py index d3c8a518..5586a929 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages from setuptools.command.test import test -from .nodeshot import get_version +from nodeshot import get_version #class TestCommand(test): @@ -16,7 +16,7 @@ description="Extensible Django web application for management of community-led georeferenced data.", long_description=open('README.md').read(), author='Federico Capoano', - author_email='federico[at]nemesisdesign[dot]net', + author_email='nemesis[at]ninux[dot]org', license='GPL3', url='https://github.com/nemesisdesign/nodeshot', packages=find_packages(exclude=['docs', 'docs.*']),