Validate entire job, not just op
[ganeti_webmgr.git] / deprecated / ganeti / migrations / 0004_version_0_6_import_nodes.py
blob05b8494e6e50a7a0e0a0a1e493cb3ae6492fd552
1 # encoding: utf-8
2 import datetime
3 from south.db import db
4 from south.v2 import DataMigration
5 from django.db import models
7 class Migration(DataMigration):
9 def forwards(self, orm):
10 """ do a one time import of node for each cluster """
11 Cluster = orm['ganeti.Cluster']
12 for cluster in Cluster.objects.all():
13 cluster.sync_nodes()
15 def backwards(self, orm):
16 """no migration needed, Node table will be removed"""
17 pass
20 models = {
21 'auth.group': {
22 'Meta': {'object_name': 'Group'},
23 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
24 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
25 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
27 'auth.permission': {
28 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
29 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
30 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
31 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
32 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
34 'auth.user': {
35 'Meta': {'object_name': 'User'},
36 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
37 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
38 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
39 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
40 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
41 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
42 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
43 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
44 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
45 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
46 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
47 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
48 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
50 'contenttypes.contenttype': {
51 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
52 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
53 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
54 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
55 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
57 'ganeti.cluster': {
58 'Meta': {'object_name': 'Cluster'},
59 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
60 'description': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
61 'disk': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
62 'hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
63 'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
64 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
65 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
66 'last_job': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'cluster_last_job'", 'null': 'True', 'to': "orm['ganeti.Job']"}),
67 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
68 'password': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
69 'port': ('django.db.models.fields.PositiveIntegerField', [], {'default': '5080'}),
70 'ram': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
71 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
72 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}),
73 'username': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
74 'virtual_cpus': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
76 'ganeti.clusteruser': {
77 'Meta': {'object_name': 'ClusterUser'},
78 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
79 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
80 'real_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']", 'null': 'True'})
82 'ganeti.ganetierror': {
83 'Meta': {'object_name': 'GanetiError'},
84 'cleared': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
85 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.Cluster']"}),
86 'code': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
87 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
88 'msg': ('django.db.models.fields.TextField', [], {}),
89 'obj_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
90 'obj_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ganeti_errors'", 'to': "orm['contenttypes.ContentType']"}),
91 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
93 'ganeti.job': {
94 'Meta': {'object_name': 'Job'},
95 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
96 'cleared': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
97 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'jobs'", 'to': "orm['ganeti.Cluster']"}),
98 'cluster_hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
99 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
100 'finished': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
101 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
102 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
103 'job_id': ('django.db.models.fields.IntegerField', [], {}),
104 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
105 'object_id': ('django.db.models.fields.IntegerField', [], {}),
106 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
107 'status': ('django.db.models.fields.CharField', [], {'max_length': '10'})
109 'ganeti.node': {
110 'Meta': {'object_name': 'Node'},
111 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
112 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nodes'", 'to': "orm['ganeti.Cluster']"}),
113 'cluster_hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
114 'disk_total': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
115 'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
116 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
117 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
118 'last_job': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.Job']", 'null': 'True'}),
119 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
120 'offline': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
121 'ram_total': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
122 'role': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
123 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'})
125 'ganeti.organization': {
126 'Meta': {'object_name': 'Organization', '_ormbases': ['ganeti.ClusterUser']},
127 'clusteruser_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['ganeti.ClusterUser']", 'unique': 'True', 'primary_key': 'True'}),
128 'group': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'organization'", 'unique': 'True', 'to': "orm['auth.Group']"})
130 'ganeti.profile': {
131 'Meta': {'object_name': 'Profile', '_ormbases': ['ganeti.ClusterUser']},
132 'clusteruser_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['ganeti.ClusterUser']", 'unique': 'True', 'primary_key': 'True'}),
133 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
135 'ganeti.quota': {
136 'Meta': {'object_name': 'Quota'},
137 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'quotas'", 'to': "orm['ganeti.Cluster']"}),
138 'disk': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'}),
139 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
140 'ram': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'}),
141 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'quotas'", 'to': "orm['ganeti.ClusterUser']"}),
142 'virtual_cpus': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'})
144 'ganeti.sshkey': {
145 'Meta': {'object_name': 'SSHKey'},
146 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
147 'key': ('django.db.models.fields.TextField', [], {}),
148 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
150 'ganeti.testmodel': {
151 'Meta': {'object_name': 'TestModel'},
152 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
153 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.Cluster']"}),
154 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
155 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
156 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
157 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'})
159 'ganeti.virtualmachine': {
160 'Meta': {'unique_together': "(('cluster', 'hostname'),)", 'object_name': 'VirtualMachine'},
161 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
162 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'default': '0', 'related_name': "'virtual_machines'", 'to': "orm['ganeti.Cluster']"}),
163 'cluster_hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
164 'disk_size': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
165 'hostname': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
166 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
167 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
168 'last_job': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.Job']", 'null': 'True'}),
169 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
170 'operating_system': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
171 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'virtual_machines'", 'null': 'True', 'to': "orm['ganeti.ClusterUser']"}),
172 'pending_delete': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
173 'primary_node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'primary_vms'", 'null': 'True', 'to': "orm['ganeti.Node']"}),
174 'ram': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
175 'secondary_node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'secondary_vms'", 'null': 'True', 'to': "orm['ganeti.Node']"}),
176 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
177 'status': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
178 'template': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.VirtualMachineTemplate']", 'null': 'True'}),
179 'virtual_cpus': ('django.db.models.fields.IntegerField', [], {'default': '-1'})
181 'ganeti.virtualmachinetemplate': {
182 'Meta': {'object_name': 'VirtualMachineTemplate'},
183 'boot_order': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
184 'cdrom_image_path': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}),
185 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti.Cluster']", 'null': 'True'}),
186 'disk_size': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
187 'disk_template': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
188 'disk_type': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
189 'iallocator': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
190 'iallocator_hostname': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
191 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
192 'kernel_path': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
193 'memory': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
194 'name_check': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
195 'nic_link': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
196 'nic_mode': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
197 'nic_type': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
198 'os': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
199 'pnode': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
200 'root_path': ('django.db.models.fields.CharField', [], {'default': "'/'", 'max_length': '255', 'null': 'True', 'blank': 'True'}),
201 'serial_console': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
202 'snode': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
203 'start': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
204 'template_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
205 'vcpus': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
209 complete_apps = ['ganeti']