~martin-nowack/ubuntu/utopic/maas/bug-1425837

« back to all changes in this revision

Viewing changes to src/maasserver/start_up.py

  • Committer: Package Import Robot
  • Author(s): Julian Edwards, Julian Edwards, Andres Rodriguez
  • Date: 2014-08-21 18:38:27 UTC
  • mfrom: (1.2.34)
  • Revision ID: package-import@ubuntu.com-20140821183827-9xyb5u2o4l8g3zxj
Tags: 1.6.1+bzr2550-0ubuntu1
* New upstream bugfix release:
  - Auto-link node MACs to Networks (LP: #1341619)

[ Julian Edwards ]
* debian/maas-region-controller.postinst: Don't restart RabbitMQ on
  upgrades, just ensure it's running.  Should prevent a race with the
  cluster celery restarting.
* debian/rules: Pull upstream branch from the right place.

[ Andres Rodriguez ]
* debian/maas-region-controller.postinst: Ensure cluster celery is
  started if it also runs on the region.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2012 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2012-2014 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
"""Start up utilities for the MAAS server."""
18
18
 
19
19
from textwrap import dedent
20
20
 
21
 
from django.db import connection
 
21
from django.db import (
 
22
    connection,
 
23
    transaction,
 
24
    )
22
25
from maasserver import (
23
26
    eventloop,
24
27
    locks,
51
54
    but this method uses file-based locking to ensure that the methods it calls
52
55
    internally are not ran concurrently.
53
56
    """
54
 
    with locks.startup:
55
 
        inner_start_up()
 
57
    with transaction.atomic():
 
58
        with locks.startup:
 
59
            inner_start_up()
56
60
 
57
61
    eventloop.start().wait(10)
58
62
 
83
87
    # This must be serialized or we may initialize the master more than once.
84
88
    NodeGroup.objects.ensure_master()
85
89
 
 
90
    # If any clusters have no boot-source definitions yet, provide them
 
91
    # with the default definition.
 
92
    for cluster in NodeGroup.objects.all():
 
93
        cluster.ensure_boot_source_definition()
 
94
 
86
95
    # Regenerate MAAS's DNS configuration.  This should be reentrant, really.
87
96
    write_full_dns_config(reload_retry=True)
88
97