Use IPv6-field and adds ipv6 test data
This commit is contained in:
1 parent
c332f7bc40
commit
a07edd160b
4 files changed
+1414
-1358
No files matched your search
@@ -8,8 +8,14 @@ A Django app for managing computer equipment.
|
|||||||
python manage.py migrate
|
python manage.py migrate
|
||||||
python manage.py runserver
|
python manage.py runserver
|
||||||
|
|
||||||
|
## Development tasks
|
||||||
|
Dump test data:
|
||||||
|
|
||||||
|
python manage.py dumpdata mdb --natural-foreign --indent=4 > mdb/fixtures/test_data.json
|
||||||
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
* Creates DHCPD configuration files
|
* Creates DHCPD configuration files
|
||||||
* Creates DNS zone files for BIND
|
* Creates DNS zone files for BIND
|
||||||
* TODO: Creates PXE config files (with random secret for use with Puppet autosign)
|
* TODO: Creates PXE config files (with random secret for use with Puppet autosign)
|
||||||
+1386
-1352
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,19 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import models, migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('mdb', '0007_auto_20151003_1313'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='ip6address',
|
||||||
|
name='address',
|
||||||
|
field=models.GenericIPAddressField(protocol='IPv6'),
|
||||||
|
),
|
||||||
|
]
|
||||||
+2
-5
@@ -353,10 +353,7 @@ class Ip4Subnet(models.Model):
|
|||||||
|
|
||||||
def last_address(self):
|
def last_address(self):
|
||||||
subnet = ipaddress.IPv4Network(self.network + "/" + self.netmask)
|
subnet = ipaddress.IPv4Network(self.network + "/" + self.netmask)
|
||||||
for curr in subnet.hosts():
|
return list(subnet.hosts())[-1]
|
||||||
pass # horribly inefficient
|
|
||||||
|
|
||||||
return curr
|
|
||||||
|
|
||||||
broadcast_address.short_description = 'broadcast'
|
broadcast_address.short_description = 'broadcast'
|
||||||
num_addresses.short_description = '#addresses'
|
num_addresses.short_description = '#addresses'
|
||||||
@@ -560,7 +557,7 @@ class Interface(models.Model):
|
|||||||
@python_2_unicode_compatible
|
@python_2_unicode_compatible
|
||||||
class Ip6Address(models.Model):
|
class Ip6Address(models.Model):
|
||||||
subnet = models.ForeignKey(Ip6Subnet)
|
subnet = models.ForeignKey(Ip6Subnet)
|
||||||
address = models.CharField(max_length=64)
|
address = models.GenericIPAddressField(protocol='IPv6')
|
||||||
interface = models.ForeignKey(Interface)
|
interface = models.ForeignKey(Interface)
|
||||||
|
|
||||||
def full_address(self):
|
def full_address(self):
|
||||||
|
|||||||
Reference in new issue
Block a user