~allenap/maas/migrations-without-application-code

« back to all changes in this revision

Viewing changes to src/maasserver/rpc/regionservice.py

  • Committer: MAAS Lander
  • Author(s): Blake Rouse
  • Date: 2016-02-17 03:04:05 UTC
  • mfrom: (4600.19.12 ha-dhcp-config)
  • Revision ID: maas_lander-20160217030405-98d70077frb80ez1
[r=ltrager][bug=][author=blake-rouse] Write out the DHCP configuration for IPv4 and IPv6 for the rack controller. This connects the primary and secondary rack controller using the ISC-DHCP HA failover.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
from maasserver.utils import synchronised
58
58
from maasserver.utils.orm import (
59
59
    get_one,
 
60
    post_commit,
60
61
    transactional,
61
62
    with_connection,
62
63
)
206
207
        Implementation of
207
208
        :py:class:`~provisioningserver.rpc.region.GetBootSources`.
208
209
        """
209
 
        return {"sources": [get_simplestream_endpoint()]}
 
210
        d = deferToDatabase(get_simplestream_endpoint)
 
211
        d.addCallback(lambda source: {"sources": [source]})
 
212
        return d
210
213
 
211
214
    @region.GetBootSourcesV2.responder
212
215
    def get_boot_sources_v2(self, uuid):
215
218
        Implementation of
216
219
        :py:class:`~provisioningserver.rpc.region.GetBootSources`.
217
220
        """
218
 
        return {"sources": [get_simplestream_endpoint()]}
 
221
        d = deferToDatabase(get_simplestream_endpoint)
 
222
        d.addCallback(lambda source: {"sources": [source]})
 
223
        return d
219
224
 
220
225
    @region.GetArchiveMirrors.responder
221
226
    def get_archive_mirrors(self):
985
990
        # `update` loop also removes the old processes from the database.
986
991
        process, _ = RegionControllerProcess.objects.get_or_create(
987
992
            region=region_obj, pid=os.getpid())
988
 
        self.processId.set(process.id)
 
993
        post_commit().addCallback(callOut, self.processId.set, process.id)
989
994
 
990
995
    @synchronous
991
996
    @synchronised(lock)