~jamesodhunt/ubuntu/vivid/ubuntu-core-snappy/tolerate-other-mounted-ro

« back to all changes in this revision

Viewing changes to snappy/main.py

  • Committer: James Hunt
  • Date: 2015-01-19 17:06:56 UTC
  • Revision ID: james.hunt@ubuntu.com-20150119170656-616lailc1i29nibn
* Check bootloader variables (u-boot only atm) to check if the reboot
  message should be displayed.
* Don't call ReloadConfiguration() if the other partition is empty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
355
355
 
356
356
        if len(latest_system_versions) == 1:
357
357
            # Both A and B partitions have the same system-image
358
 
            # version installed, so don't want that a reboot is required
 
358
            # version installed (or there is only 1 image available),
 
359
            # so don't show that a reboot is required
359
360
            no_reboot = True
360
361
 
361
362
        if other_version == -1:
376
377
 
377
378
        print(t.get_string(padding_width=1))
378
379
 
379
 
        if (other_version > current_version) and reboot_part:
380
 
 
381
 
            # FIXME: we can't currently determine whether a 'snappy update'
382
 
            # has already been run.
383
 
            #
384
 
            # Once we introduce the /boot/grub partition we can have
385
 
            # 'snappy update' set a value using grub-editenv to store
386
 
            # the full path to the rootfs that will be booted *next*.
387
 
            # We can then read back that value here to determine the
388
 
            # correct message.
 
380
        # Check both the versions and also query the bootloader
 
381
        # variables to determine if we need to display this message.
 
382
        if ((other_version > current_version) and reboot_part) or \
 
383
                SystemImageDataSource().next_boot_is_other():
389
384
            sys.stdout.write("Reboot to use the new ubuntu-core.\n")
390
385
            sys.stdout.flush()
391
386
        return 0