~maas-committers/maas/2.1

« back to all changes in this revision

Viewing changes to src/maasserver/preseed.py

  • Committer: MAAS Lander
  • Author(s): Blake Rouse
  • Date: 2016-12-08 17:00:53 UTC
  • mfrom: (5564.1.1 2.1)
  • Revision ID: maas_lander-20161208170053-u0x2l774kk36dbgz
[r=blake-rouse][bug=1604962][author=blake-rouse] Backport r5597: Use cloud-init to reboot deployment instead of curtin starting the power off.

Show diffs side-by-side

added added

removed removed

Lines of Context:
417
417
        get_node_preseed_context(
418
418
            node, osystem, series, rack_controller=rack_controller))
419
419
    context.update(get_curtin_context(node, rack_controller=rack_controller))
420
 
    return template.substitute(**context)
 
420
    config = yaml.load(template.substitute(**context))
 
421
    if 'power_state' in config:
 
422
        del config['power_state']
 
423
    # Precise does not support cloud-init performing the reboot, so curtin
 
424
    # must have this statement.
 
425
    if node.distro_series == "precise":
 
426
        config['power_state'] = {'mode': 'reboot'}
 
427
    return yaml.dump(config)
421
428
 
422
429
 
423
430
def get_curtin_context(node, rack_controller=None):