~ubuntu-branches/ubuntu/raring/maas/raring-updates

« back to all changes in this revision

Viewing changes to src/metadataserver/migrations/0008_rename_lshw_commissioning_output.py

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez, Raphaël Badin, Julian Edwards, Jeroen Vermeulen, Gavin Panella, Andres Rodriguez
  • Date: 2013-03-04 11:49:44 UTC
  • mfrom: (1.2.5)
  • Revision ID: package-import@ubuntu.com-20130304114944-81my0hho8arxa3ix
Tags: 1.3+bzr1452+dfsg-0ubuntu1
* New upstream release.
  - MAAS file storage mechanism is shifting from a single shared
    namespace to a per-user namespace. Operators of the majority
    of MAAS systems will not notice any change. However, operators
    of the most complex installations may find that a new
    "shared-environment" user is created, and that some resources
    are reassigned to it, such as API credentials and SSH public
    keys. This provides a transitional environment that mimics the
    behaviour of a shared namespace.

[ Raphaël Badin ]
* debian/control: maas-region-controller depends on bind9utils.
  (LP: #1103195)
* debian/maas-dns.postinst: Call write_dns_config.
  (LP: #1085865).
* debian/maas-cluster-controller.postinst: Fix the name of the config
  file (/etc/maas/pserv.yaml and not /etc/maas/pserv.conf)
  (LP: #1083542).
* debian/extras/99-maas-sudoers: Add 'SETENV:' to sudo rule
  to allow preserving the environment when running
  /usr/sbin/maas-import-pxe-files via sudo.
* debian/maas-dns.postinst: fix permissions and group ownership of
  file /etc/bind/maas/named.conf.rndc.maas. (LP: #1066935)
* debian/control: Remove the dependency of maas-cluster-controller
  on rabbitmq-server. (LP: #1072744)
* debian/extras/99-maas-sudoers: Add sudo rule for script
  /usr/sbin/maas-import-pxe-files.
* debian/maas-cluster-controller.install: Removed commissioning-user-data
  script.

[ Julian Edwards ]
* debian/maas-region-controller.install: Remove installation of maas-gc; it
  is no longer required as upstream no longer stores files in the filesystem.
  (LP: #1069734)
* debian/maas-cluster-controller.postinst: Ensure that /etc/maas/pserv.yaml
  is updated when reconfiguring. (LP: #1081212)

[ Jeroen Vermeulen ]
* debian/maas-cluster-controller.install: Install import scripts.
* debian/maas-cluster-controller.postinst: Configure tgt (the iSCSI server)
  so the import script can install files to it.
* debian/maas-cluster-controller.postrm: Clean up tgt config.
* debian/maas-region-controller.install: Move import scripts out to the
  cluster controller, and drop the maas-import-isos compatibility script.
* debian/maas-region-controller.postinst: Remove tgt config.
* debian/maas-region-controller.postrm: Remove tgt config cleanup.
* Bump code revision to include latest user_data.template fixes.

[ Gavin Panella ]
* debian/extras/99-maas: squashfs image download is no longer needed.
* debian/maas-cluster-controller.install: maas-import-squashfs and its
  configuration file are no longer part of upstream.
* debian/maas-cluster-controller.install: The maas-import-pxe-files cron
  task is no longer used.
* debian/maas-cluster-controller.postinst: Remove leading comment
  markers from the 'generator' line in pserv.yaml.

[ Andres Rodriguez ]
* debian/control:
  - maas-cluster-controller Conflicts with tftpd-hpa (LP: #1076028)
  - maas-dns: Conflicts with dnsmasq
  - maas-cluster-controller Conflicts/Replaces maas-region-controller as
    import scripts are no longer shipped in the region.
  - debian/control: Depends on distro-info for maas-cluster-controller
    instead of maas-region-controller (LP: #1103194)
* debian/maas-cluster-controller.config: If URL has been detected,
  add /MAAS if it doesn't contain it. This helps upgrades from versions
  where DEFAULT_MAAS_URL didn't use /MAAS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
import datetime
 
3
 
 
4
from django.db import models
 
5
from south.db import db
 
6
from south.v2 import DataMigration
 
7
 
 
8
 
 
9
def rename_commissioning_results(orm, old_name, new_name):
 
10
    """Rename any `NodeCommissionResult` called `old_name` to `new_name`."""
 
11
    ncrs = orm['metadataserver.NodeCommissionResult'].objects
 
12
    ncrs.filter(name=old_name).update(name=new_name)
 
13
 
 
14
 
 
15
class Migration(DataMigration):
 
16
    """Rename lshw output in accordance with new naming convention.
 
17
 
 
18
    The commissioning results for "lshw" were written as 01-lshw.out: the
 
19
    output of 01-lshw.  But our naming convention reserves such names for
 
20
    user-provided commissioning scripts.  MAAS-internal commissioning
 
21
    scripts have names starting with 00-maas-*.
 
22
    """
 
23
 
 
24
    def forwards(self, orm):
 
25
        rename_commissioning_results(orm, '01-lshw.out', '00-maas-01-lshw.out')
 
26
 
 
27
    def backwards(self, orm):
 
28
        rename_commissioning_results(orm, '00-maas-01-lshw.out', '01-lshw.out')
 
29
 
 
30
    models = {
 
31
        'auth.group': {
 
32
            'Meta': {'object_name': 'Group'},
 
33
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
34
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
 
35
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
 
36
        },
 
37
        'auth.permission': {
 
38
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
 
39
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
 
40
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
 
41
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
42
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
 
43
        },
 
44
        'auth.user': {
 
45
            'Meta': {'object_name': 'User'},
 
46
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
 
47
            'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75', 'blank': 'True'}),
 
48
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
 
49
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
 
50
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
51
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
 
52
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
 
53
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
 
54
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
 
55
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
 
56
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
 
57
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
 
58
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
 
59
        },
 
60
        'contenttypes.contenttype': {
 
61
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
 
62
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
 
63
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
64
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
 
65
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
 
66
        },
 
67
        u'maasserver.node': {
 
68
            'Meta': {'object_name': 'Node'},
 
69
            'after_commissioning_action': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
 
70
            'architecture': ('django.db.models.fields.CharField', [], {'default': "u'i386/generic'", 'max_length': '31'}),
 
71
            'cpu_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
 
72
            'created': ('django.db.models.fields.DateTimeField', [], {}),
 
73
            'distro_series': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '10', 'null': 'True', 'blank': 'True'}),
 
74
            'error': ('django.db.models.fields.CharField', [], {'default': "u''", 'max_length': '255', 'blank': 'True'}),
 
75
            'hardware_details': ('maasserver.fields.XMLField', [], {'default': 'None', 'null': 'True', 'blank': 'True'}),
 
76
            'hostname': ('django.db.models.fields.CharField', [], {'default': "u''", 'unique': 'True', 'max_length': '255', 'blank': 'True'}),
 
77
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
78
            'memory': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
 
79
            'netboot': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
 
80
            'nodegroup': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['maasserver.NodeGroup']", 'null': 'True'}),
 
81
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
 
82
            'power_parameters': ('maasserver.fields.JSONObjectField', [], {'default': "u''", 'blank': 'True'}),
 
83
            'power_type': ('django.db.models.fields.CharField', [], {'default': "u''", 'max_length': '10', 'blank': 'True'}),
 
84
            'status': ('django.db.models.fields.IntegerField', [], {'default': '0', 'max_length': '10'}),
 
85
            'system_id': ('django.db.models.fields.CharField', [], {'default': "u'node-5b8f2212-444f-11e2-a886-3c970e0e56dc'", 'unique': 'True', 'max_length': '41'}),
 
86
            'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['maasserver.Tag']", 'symmetrical': 'False'}),
 
87
            'token': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['piston.Token']", 'null': 'True'}),
 
88
            'updated': ('django.db.models.fields.DateTimeField', [], {})
 
89
        },
 
90
        u'maasserver.nodegroup': {
 
91
            'Meta': {'object_name': 'NodeGroup'},
 
92
            'api_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '18'}),
 
93
            'api_token': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['piston.Token']", 'unique': 'True'}),
 
94
            'cluster_name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100', 'blank': 'True'}),
 
95
            'created': ('django.db.models.fields.DateTimeField', [], {}),
 
96
            'dhcp_key': ('django.db.models.fields.CharField', [], {'default': "u''", 'max_length': '255', 'blank': 'True'}),
 
97
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
98
            'maas_url': ('django.db.models.fields.CharField', [], {'default': "u''", 'max_length': '255', 'blank': 'True'}),
 
99
            'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'blank': 'True'}),
 
100
            'status': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
 
101
            'updated': ('django.db.models.fields.DateTimeField', [], {}),
 
102
            'uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '36'})
 
103
        },
 
104
        u'maasserver.tag': {
 
105
            'Meta': {'object_name': 'Tag'},
 
106
            'comment': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
 
107
            'created': ('django.db.models.fields.DateTimeField', [], {}),
 
108
            'definition': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
 
109
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
110
            'kernel_opts': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
 
111
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '256'}),
 
112
            'updated': ('django.db.models.fields.DateTimeField', [], {})
 
113
        },
 
114
        u'metadataserver.commissioningscript': {
 
115
            'Meta': {'object_name': 'CommissioningScript'},
 
116
            'content': ('metadataserver.fields.BinaryField', [], {}),
 
117
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
118
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
 
119
        },
 
120
        u'metadataserver.nodecommissionresult': {
 
121
            'Meta': {'unique_together': "((u'node', u'name'),)", 'object_name': 'NodeCommissionResult'},
 
122
            'created': ('django.db.models.fields.DateTimeField', [], {}),
 
123
            'data': ('django.db.models.fields.CharField', [], {'max_length': '1048576'}),
 
124
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
125
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
 
126
            'node': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['maasserver.Node']"}),
 
127
            'status': ('django.db.models.fields.CharField', [], {'default': "u'OK'", 'max_length': '100'}),
 
128
            'updated': ('django.db.models.fields.DateTimeField', [], {})
 
129
        },
 
130
        u'metadataserver.nodekey': {
 
131
            'Meta': {'object_name': 'NodeKey'},
 
132
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
133
            'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '18'}),
 
134
            'node': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['maasserver.Node']", 'unique': 'True'}),
 
135
            'token': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['piston.Token']", 'unique': 'True'})
 
136
        },
 
137
        u'metadataserver.nodeuserdata': {
 
138
            'Meta': {'object_name': 'NodeUserData'},
 
139
            'data': ('metadataserver.fields.BinaryField', [], {}),
 
140
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
141
            'node': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['maasserver.Node']", 'unique': 'True'})
 
142
        },
 
143
        'piston.consumer': {
 
144
            'Meta': {'object_name': 'Consumer'},
 
145
            'description': ('django.db.models.fields.TextField', [], {}),
 
146
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
147
            'key': ('django.db.models.fields.CharField', [], {'max_length': '18'}),
 
148
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
 
149
            'secret': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
 
150
            'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '16'}),
 
151
            'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'consumers'", 'null': 'True', 'to': "orm['auth.User']"})
 
152
        },
 
153
        'piston.token': {
 
154
            'Meta': {'object_name': 'Token'},
 
155
            'callback': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
 
156
            'callback_confirmed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
 
157
            'consumer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['piston.Consumer']"}),
 
158
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
159
            'is_approved': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
 
160
            'key': ('django.db.models.fields.CharField', [], {'max_length': '18'}),
 
161
            'secret': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
 
162
            'timestamp': ('django.db.models.fields.IntegerField', [], {'default': '1355311840L'}),
 
163
            'token_type': ('django.db.models.fields.IntegerField', [], {}),
 
164
            'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'tokens'", 'null': 'True', 'to': "orm['auth.User']"}),
 
165
            'verifier': ('django.db.models.fields.CharField', [], {'max_length': '10'})
 
166
        }
 
167
    }
 
168
 
 
169
    complete_apps = ['metadataserver']
 
170
    symmetrical = True