From 058d38c6a8071031dacf928f0a0e2d4c24b911a4 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Thu, 31 Mar 2016 11:14:58 -0700 Subject: [PATCH] Set default --- client/update_grub.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/update_grub.py b/client/update_grub.py index ed4e88b..3caa437 100755 --- a/client/update_grub.py +++ b/client/update_grub.py @@ -30,9 +30,14 @@ class GrubUpdater(object): self._image_path = '/' + os.path.relpath(self._image_dir, self._boot_dir) def Update(self): + current = os.readlink(os.path.join(self._image_dir, 'current')) + sys.stdout.write(""" set timeout=5 -""") +set default=%(default_image_filename)s +""" % { + 'default_image_filename': os.path.basename(current), + }) files = [] for filename in os.listdir(self._image_dir):