Parcourir la source

fixtures: add created and last_udpated fields.

switched fixtures to json to avoid https://code.djangoproject.com/ticket/18867
Zach Moody il y a 8 ans
Parent
commit
677700aadf

Fichier diff supprimé car celui-ci est trop grand
+ 5868 - 0
netbox/dcim/fixtures/dcim.json


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 1794
netbox/dcim/fixtures/dcim.yaml


+ 47 - 0
netbox/extras/fixtures/extras.json

@@ -0,0 +1,47 @@
+[
+{
+    "model": "extras.graph",
+    "pk": 1,
+    "fields": {
+        "type": 300,
+        "weight": 1000,
+        "name": "Site Test Graph",
+        "source": "http://localhost/na.png",
+        "link": ""
+    }
+},
+{
+    "model": "extras.graph",
+    "pk": 2,
+    "fields": {
+        "type": 200,
+        "weight": 1000,
+        "name": "Provider Test Graph",
+        "source": "http://localhost/provider_graph.png",
+        "link": ""
+    }
+},
+{
+    "model": "extras.graph",
+    "pk": 3,
+    "fields": {
+        "type": 100,
+        "weight": 1000,
+        "name": "Interface Test Graph",
+        "source": "http://localhost/interface_graph.png",
+        "link": ""
+    }
+},
+{
+    "model": "extras.useraction",
+    "pk": 1,
+    "fields": {
+        "time": "2016-06-23T04:30:37.586Z",
+        "user": 1,
+        "content_type": 10,
+        "object_id": 1,
+        "action": 1,
+        "message": "Created site <a href=\"/dcim/sites/test/\">TEST</a>"
+    }
+}
+]

+ 0 - 12
netbox/extras/fixtures/extras.yaml

@@ -1,12 +0,0 @@
-- model: extras.graph
-  pk: 1
-  fields: {type: 300, weight: 1000, name: Site Test Graph, source: 'http://localhost/na.png',
-    link: ''}
-- model: extras.graph
-  pk: 2
-  fields: {type: 200, weight: 1000, name: Provider Test Graph, source: 'http://localhost/provider_graph.png',
-    link: ''}
-- model: extras.graph
-  pk: 3
-  fields: {type: 100, weight: 1000, name: Interface Test Graph, source: 'http://localhost/interface_graph.png',
-    link: ''}

+ 329 - 0
netbox/ipam/fixtures/ipam.json

@@ -0,0 +1,329 @@
+[
+{
+    "model": "ipam.rir",
+    "pk": 1,
+    "fields": {
+        "name": "RFC1918",
+        "slug": "rfc1918"
+    }
+},
+{
+    "model": "ipam.aggregate",
+    "pk": 1,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "prefix": "10.0.0.0/8",
+        "rir": 1,
+        "date_added": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.role",
+    "pk": 1,
+    "fields": {
+        "name": "Lab Network",
+        "slug": "lab-network",
+        "weight": 1000
+    }
+},
+{
+    "model": "ipam.prefix",
+    "pk": 1,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "prefix": "10.1.1.0/24",
+        "site": 1,
+        "vrf": null,
+        "vlan": null,
+        "status": 1,
+        "role": 1,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.prefix",
+    "pk": 2,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "prefix": "10.0.255.0/24",
+        "site": 1,
+        "vrf": null,
+        "vlan": null,
+        "status": 1,
+        "role": 1,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 1,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "10.0.255.1/32",
+        "vrf": null,
+        "interface": 3,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 2,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "169.254.254.1/31",
+        "vrf": null,
+        "interface": 4,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 3,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "10.0.255.2/32",
+        "vrf": null,
+        "interface": 185,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 4,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "169.254.1.1/31",
+        "vrf": null,
+        "interface": 213,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 5,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "10.0.254.1/24",
+        "vrf": null,
+        "interface": 12,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 8,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "10.15.21.1/31",
+        "vrf": null,
+        "interface": 218,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 9,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "10.15.21.2/31",
+        "vrf": null,
+        "interface": 9,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 10,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "10.15.22.1/31",
+        "vrf": null,
+        "interface": 8,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 11,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "10.15.20.1/31",
+        "vrf": null,
+        "interface": 7,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 12,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "10.16.20.1/31",
+        "vrf": null,
+        "interface": 216,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 13,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "10.15.22.2/31",
+        "vrf": null,
+        "interface": 206,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 14,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "10.16.22.1/31",
+        "vrf": null,
+        "interface": 217,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 15,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "10.16.22.2/31",
+        "vrf": null,
+        "interface": 205,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 16,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "10.16.20.2/31",
+        "vrf": null,
+        "interface": 211,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 17,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "10.15.22.2/31",
+        "vrf": null,
+        "interface": 212,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 19,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "10.0.254.2/32",
+        "vrf": null,
+        "interface": 188,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 20,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "169.254.1.1/31",
+        "vrf": null,
+        "interface": 200,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.ipaddress",
+    "pk": 21,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "family": 4,
+        "address": "169.254.1.2/31",
+        "vrf": null,
+        "interface": 194,
+        "nat_inside": null,
+        "description": ""
+    }
+},
+{
+    "model": "ipam.vlan",
+    "pk": 1,
+    "fields": {
+        "created": "2016-06-23",
+        "last_updated": "2016-06-23T03:19:56.521Z",
+        "site": 1,
+        "vid": 999,
+        "name": "TEST",
+        "status": 1,
+        "role": 1
+    }
+}
+]

+ 0 - 92
netbox/ipam/fixtures/ipam.yaml

@@ -1,92 +0,0 @@
-- model: ipam.role
-  pk: 1
-  fields: {name: Lab Network, slug: lab-network, weight: 1000}
-- model: ipam.rir
-  pk: 1
-  fields: {name: RFC1918, slug: rfc1918}
-- model: ipam.aggregate
-  pk: 1
-  fields: {family: 4, prefix: 10.0.0.0/8, rir: 1, date_added: 2016-01-01, description: ''}
-- model: ipam.prefix
-  pk: 1
-  fields: {family: 4, prefix: 10.1.1.0/24, site: 1, vrf: null, vlan: null, status: 1,
-    role: 1, description: ''}
-- model: ipam.prefix
-  pk: 2
-  fields: {family: 4, prefix: 10.0.255.0/24, site: 1, vrf: null, vlan: null, status: 1,
-    role: 1, description: ''}
-- model: ipam.ipaddress
-  pk: 1
-  fields: {family: 4, address: 10.0.255.1/32, vrf: null, interface: 3, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 2
-  fields: {family: 4, address: 169.254.254.1/31, vrf: null, interface: 4, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 3
-  fields: {family: 4, address: 10.0.255.2/32, vrf: null, interface: 185, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 4
-  fields: {family: 4, address: 169.254.1.1/31, vrf: null, interface: 213, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 5
-  fields: {family: 4, address: 10.0.254.1/24, vrf: null, interface: 12, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 8
-  fields: {family: 4, address: 10.15.21.1/31, vrf: null, interface: 218, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 9
-  fields: {family: 4, address: 10.15.21.2/31, vrf: null, interface: 9, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 10
-  fields: {family: 4, address: 10.15.22.1/31, vrf: null, interface: 8, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 11
-  fields: {family: 4, address: 10.15.20.1/31, vrf: null, interface: 7, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 12
-  fields: {family: 4, address: 10.16.20.1/31, vrf: null, interface: 216, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 13
-  fields: {family: 4, address: 10.15.22.2/31, vrf: null, interface: 206, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 14
-  fields: {family: 4, address: 10.16.22.1/31, vrf: null, interface: 217, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 15
-  fields: {family: 4, address: 10.16.22.2/31, vrf: null, interface: 205, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 16
-  fields: {family: 4, address: 10.16.20.2/31, vrf: null, interface: 211, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 17
-  fields: {family: 4, address: 10.15.22.2/31, vrf: null, interface: 212, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 19
-  fields: {family: 4, address: 10.0.254.2/32, vrf: null, interface: 188, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 20
-  fields: {family: 4, address: 169.254.1.1/31, vrf: null, interface: 200, nat_inside: null,
-    description: ''}
-- model: ipam.ipaddress
-  pk: 21
-  fields: {family: 4, address: 169.254.1.2/31, vrf: null, interface: 194, nat_inside: null,
-    description: ''}
-- model: ipam.vlan
-  pk: 1
-  fields: {site: 1, vid: 999, name: TEST, status: 1, role: 1}