Skip to content

Commit 9abd2ab

Browse files
committed
Merge pull request alphagov#43 from alphagov/reboot-required-test-file-exists
Test package reboot file exists before outputting
2 parents 12c4c3f + 6efb8b7 commit 9abd2ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def unattended_upgrade_dry_run():
3535
@task(default=True)
3636
def packages_with_reboots(*args):
3737
"""Find out the packages that require a reboot"""
38-
sudo('cat /var/run/reboot-required.pkgs')
38+
package_reboot_file = '/var/run/reboot-required.pkgs'
39+
sudo('if [ -f {0} ]; then cat {0}; else echo No packages with reboots; fi'.format(package_reboot_file))
3940

4041
@task
4142
def reset_reboot_needed(*args):

0 commit comments

Comments
 (0)