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

@@ -1,3 +1,4 @@
import os
import re
import subprocess
@@ -13,3 +14,8 @@ def GetVolumeID(path):
])
match = _VOLUME_ID_REGEX.search(isoinfo)
return match.group('volume_id').decode('ascii')
def GetCurrentImage(image_dir='/isodevice/iconograph'):
current_path = os.path.join(image_dir, 'current')
return os.path.basename(os.readlink(current_path))