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

@@ -86,7 +86,7 @@ class Client(threadedclient.WebSocketClient):
return int(float(fh.readline().split(' ', 1)[0]))
def _NextTimestamp(self):
next_image = os.path.basename(os.readlink('/isodevice/iconograph/current'))
next_image = lib.GetCurrentImage()
return int(next_image.split('.', 1)[0])
def _OnImageTypes(self, data):
@@ -106,7 +106,7 @@ class Client(threadedclient.WebSocketClient):
FLAGS.https_client_cert,
FLAGS.https_client_key)
fetch.Fetch()
fetch.DeleteOldImages()
fetch.DeleteOldImages(skip={'%d.iso' % self._config['timestamp']})
update = update_grub.GrubUpdater(
FLAGS.image_dir,