launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #08602
[Merge] lp:~jtv/maas/prep-node into lp:maas
Jeroen T. Vermeulen has proposed merging lp:~jtv/maas/prep-node into lp:maas.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~jtv/maas/prep-node/+merge/109198
Well, actually I have something rather special in store for the Node migration (see the migration plan). Everything _except_ Node and friends will move out of __init__.py into other files, and then the existing __init__.py will be renamed to node.py to minimize conflicts in bzr. Then some of the definitions from the old __init__.py will move back into a new __init__.py. There will probably be some conflicts in the imports, but probably nothing too serious.
I also forgot to mark SYSTEM_USERS as something that will migrate together with the User-related helpers, so I marked that as scheduled for migration as well.
Jeroen
--
https://code.launchpad.net/~jtv/maas/prep-node/+merge/109198
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jtv/maas/prep-node into lp:maas.
=== modified file 'src/maasserver/models/__init__.py'
--- src/maasserver/models/__init__.py 2012-06-07 09:30:56 +0000
+++ src/maasserver/models/__init__.py 2012-06-07 17:52:58 +0000
@@ -14,6 +14,7 @@
)
__metaclass__ = type
+# Scheduled for model migration on 2012-06-15
__all__ = [
"create_auth_token",
"generate_node_system_id",
@@ -88,6 +89,7 @@
)
from provisioningserver.tasks import power_on
+# Scheduled for model migration on 2012-06-13
# Special users internal to MAAS.
SYSTEM_USERS = [
# For nodes' access to the metadata API:
@@ -95,9 +97,11 @@
]
+# Scheduled for model migration on 2012-06-15
logger = getLogger('maasserver')
+# Scheduled for model migration on 2012-06-15
def now():
cursor = connection.cursor()
cursor.execute("select now()")
@@ -359,6 +363,7 @@
return processed_nodes
+# Scheduled for model migration on 2012-06-15
def get_db_state(instance, field_name):
"""Get the persisted state of the given field for the given instance.
@@ -682,14 +687,17 @@
# Create initial authorisation token.
profile.create_authorisation_token()
+# Scheduled for model migration on 2012-06-15
# Connect the 'create_user' method to the post save signal of User.
post_save.connect(create_user, sender=User)
+# Scheduled for model migration on 2012-06-15
# Monkey patch django.contrib.auth.models.User to force email to be unique.
User._meta.get_field('email')._unique = True
+# Scheduled for model migration on 2012-06-15
# Register the models in the admin site.
admin.site.register(Consumer)
admin.site.register(Config)
@@ -699,6 +707,7 @@
admin.site.register(SSHKey)
+# Scheduled for model migration on 2012-06-15
class MAASAuthorizationBackend(ModelBackend):
supports_object_permissions = True
@@ -731,11 +740,13 @@
perm)
+# Scheduled for model migration on 2012-06-15
# 'provisioning' is imported so that it can register its signal handlers early
# on, before it misses anything.
from maasserver import provisioning
# We mention 'provisioning' here to silence lint warnings.
provisioning
+# Scheduled for model migration on 2012-06-15
from maasserver import messages
messages