Add more information on deploying; fix format.
[ganeti_webmgr.git] / ganeti_web / migrations / 0010_remove_cleared_jobs.py
blob79ec1514aaf78a8cab05fdf90a5a844b8a0ae7b3
1 # -*- coding: utf-8 -*-
2 from south.v2 import DataMigration
4 class Migration(DataMigration):
6 def forwards(self, orm):
7 # Nuke all Jobs that have been cleared already.
8 for job in orm.Job.objects.filter(cleared=True):
9 job.delete()
12 def backwards(self, orm):
13 raise RuntimeError("Irreversible migration. Sorry. :c")
16 models = {
17 'auth.group': {
18 'Meta': {'object_name': 'Group'},
19 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
20 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
21 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
23 'auth.permission': {
24 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
25 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
26 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
27 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
28 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
30 'auth.user': {
31 'Meta': {'object_name': 'User'},
32 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
33 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
34 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
35 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
36 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
37 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
38 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
39 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
40 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
41 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
42 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
43 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
44 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
46 'contenttypes.contenttype': {
47 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
48 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
49 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
50 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
51 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
53 'ganeti_web.cluster': {
54 'Meta': {'ordering': "['hostname', 'description']", 'object_name': 'Cluster'},
55 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
56 'description': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
57 'disk': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
58 'hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
59 'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
60 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
61 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
62 'last_job': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'cluster_last_job'", 'null': 'True', 'to': "orm['ganeti_web.Job']"}),
63 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
64 'password': ('ganeti_web.fields.PatchedEncryptedCharField', [], {'max_length': '293', 'null': 'True', 'cipher': "'AES'", 'blank': 'True'}),
65 'port': ('django.db.models.fields.PositiveIntegerField', [], {'default': '5080'}),
66 'ram': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
67 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
68 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
69 'username': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
70 'virtual_cpus': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
72 'ganeti_web.cluster_perms': {
73 'Meta': {'object_name': 'Cluster_Perms'},
74 'admin': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
75 'create_vm': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
76 'export': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
77 'group': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'Cluster_gperms'", 'null': 'True', 'to': "orm['auth.Group']"}),
78 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
79 'migrate': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
80 'obj': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'operms'", 'to': "orm['ganeti_web.Cluster']"}),
81 'replace_disks': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
82 'tags': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
83 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'Cluster_uperms'", 'null': 'True', 'to': "orm['auth.User']"})
85 'ganeti_web.clusteruser': {
86 'Meta': {'object_name': 'ClusterUser'},
87 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
88 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
89 'real_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']", 'null': 'True'})
91 'ganeti_web.ganetierror': {
92 'Meta': {'ordering': "('-timestamp', 'code', 'msg')", 'object_name': 'GanetiError'},
93 'cleared': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
94 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti_web.Cluster']"}),
95 'code': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
96 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
97 'msg': ('django.db.models.fields.TextField', [], {}),
98 'obj_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
99 'obj_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ganeti_errors'", 'to': "orm['contenttypes.ContentType']"}),
100 'timestamp': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
102 'ganeti_web.job': {
103 'Meta': {'object_name': 'Job'},
104 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
105 'cleared': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
106 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'jobs'", 'to': "orm['ganeti_web.Cluster']"}),
107 'cluster_hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
108 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
109 'finished': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
110 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
111 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
112 'job_id': ('django.db.models.fields.IntegerField', [], {}),
113 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
114 'object_id': ('django.db.models.fields.IntegerField', [], {}),
115 'op': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
116 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
117 'status': ('django.db.models.fields.CharField', [], {'max_length': '10'})
119 'ganeti_web.node': {
120 'Meta': {'object_name': 'Node'},
121 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
122 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'nodes'", 'to': "orm['ganeti_web.Cluster']"}),
123 'cluster_hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
124 'cpus': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
125 'disk_free': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
126 'disk_total': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
127 'hostname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
128 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
129 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
130 'last_job': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti_web.Job']", 'null': 'True'}),
131 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
132 'offline': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
133 'ram_free': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
134 'ram_total': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
135 'role': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
136 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'})
138 'ganeti_web.organization': {
139 'Meta': {'object_name': 'Organization', '_ormbases': ['ganeti_web.ClusterUser']},
140 'clusteruser_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['ganeti_web.ClusterUser']", 'unique': 'True', 'primary_key': 'True'}),
141 'group': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'organization'", 'unique': 'True', 'to': "orm['auth.Group']"})
143 'ganeti_web.profile': {
144 'Meta': {'object_name': 'Profile', '_ormbases': ['ganeti_web.ClusterUser']},
145 'clusteruser_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['ganeti_web.ClusterUser']", 'unique': 'True', 'primary_key': 'True'}),
146 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
148 'ganeti_web.quota': {
149 'Meta': {'object_name': 'Quota'},
150 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'quotas'", 'to': "orm['ganeti_web.Cluster']"}),
151 'disk': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'}),
152 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
153 'ram': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'}),
154 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'quotas'", 'to': "orm['ganeti_web.ClusterUser']"}),
155 'virtual_cpus': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True'})
157 'ganeti_web.sshkey': {
158 'Meta': {'object_name': 'SSHKey'},
159 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
160 'key': ('django.db.models.fields.TextField', [], {}),
161 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'ssh_keys'", 'to': "orm['auth.User']"})
163 'ganeti_web.testmodel': {
164 'Meta': {'object_name': 'TestModel'},
165 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
166 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti_web.Cluster']"}),
167 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
168 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
169 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
170 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'})
172 'ganeti_web.virtualmachine': {
173 'Meta': {'ordering': "['hostname']", 'unique_together': "(('cluster', 'hostname'),)", 'object_name': 'VirtualMachine'},
174 'cached': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
175 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'default': '0', 'related_name': "'virtual_machines'", 'to': "orm['ganeti_web.Cluster']"}),
176 'cluster_hash': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
177 'disk_size': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
178 'hostname': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}),
179 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
180 'ignore_cache': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
181 'last_job': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti_web.Job']", 'null': 'True'}),
182 'mtime': ('ganeti_web.fields.PreciseDateTimeField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '6'}),
183 'operating_system': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
184 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'virtual_machines'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['ganeti_web.ClusterUser']"}),
185 'pending_delete': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
186 'primary_node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'primary_vms'", 'null': 'True', 'to': "orm['ganeti_web.Node']"}),
187 'ram': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
188 'secondary_node': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'secondary_vms'", 'null': 'True', 'to': "orm['ganeti_web.Node']"}),
189 'serialized_info': ('django.db.models.fields.TextField', [], {'default': 'None', 'null': 'True'}),
190 'status': ('django.db.models.fields.CharField', [], {'max_length': '14'}),
191 'template': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'instances'", 'null': 'True', 'to': "orm['ganeti_web.VirtualMachineTemplate']"}),
192 'virtual_cpus': ('django.db.models.fields.IntegerField', [], {'default': '-1'})
194 'ganeti_web.virtualmachine_perms': {
195 'Meta': {'object_name': 'VirtualMachine_Perms'},
196 'admin': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
197 'group': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'VirtualMachine_gperms'", 'null': 'True', 'to': "orm['auth.Group']"}),
198 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
199 'modify': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
200 'obj': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'operms'", 'to': "orm['ganeti_web.VirtualMachine']"}),
201 'power': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
202 'remove': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
203 'tags': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
204 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'VirtualMachine_uperms'", 'null': 'True', 'to': "orm['auth.User']"})
206 'ganeti_web.virtualmachinetemplate': {
207 'Meta': {'unique_together': "(('cluster', 'template_name'),)", 'object_name': 'VirtualMachineTemplate'},
208 'boot_order': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
209 'cdrom2_image_path': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}),
210 'cdrom_image_path': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}),
211 'cluster': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['ganeti_web.Cluster']", 'null': 'True'}),
212 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
213 'disk_template': ('django.db.models.fields.CharField', [], {'max_length': '16'}),
214 'disk_type': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
215 'disks': ('django_fields.fields.PickleField', [], {'null': 'True', 'blank': 'True'}),
216 'iallocator': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
217 'iallocator_hostname': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
218 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
219 'kernel_path': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
220 'memory': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
221 'name_check': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
222 'nic_type': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
223 'nics': ('django_fields.fields.PickleField', [], {'null': 'True', 'blank': 'True'}),
224 'no_install': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
225 'os': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
226 'pnode': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
227 'root_path': ('django.db.models.fields.CharField', [], {'default': "'/'", 'max_length': '255', 'null': 'True', 'blank': 'True'}),
228 'serial_console': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
229 'snode': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
230 'start': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
231 'template_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
232 'vcpus': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
236 complete_apps = ['ganeti_web']
237 symmetrical = True