Don't delete the image that we're currently running, for safety.

This commit is contained in:
Ian Gulliver
2016-05-11 05:12:43 +00:00
parent 8b08a5cec6
commit c302ffd87a
4 changed files with 14 additions and 5 deletions

View File

@@ -23,13 +23,13 @@ class GrubUpdater(object):
with tempfile.NamedTemporaryFile('w', dir=grub_dir, delete=False) as fh:
try:
current = os.readlink(os.path.join(self._image_dir, 'current'))
current = lib.GetCurrentImage(self._image_dir)
fh.write("""
set timeout=5
set default=%(default_image_filename)s
""" % {
'default_image_filename': os.path.basename(current),
'default_image_filename': current,
})
files = []