diff options
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | image-bundle/.gitignore | 4 | ||||
-rw-r--r-- | image-bundle/gcimagebundlelib/block_disk.py | 4 |
3 files changed, 8 insertions, 4 deletions
@@ -1,3 +1,7 @@ *.pyc *.pyo .DS_Store +.idea + +# emacs backup files +*.*~ diff --git a/image-bundle/.gitignore b/image-bundle/.gitignore deleted file mode 100644 index 5ebaff2..0000000 --- a/image-bundle/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# compiled code -*.pyc -# emacs backup files -*.*~ diff --git a/image-bundle/gcimagebundlelib/block_disk.py b/image-bundle/gcimagebundlelib/block_disk.py index 1453afc..f4d7b2a 100644 --- a/image-bundle/gcimagebundlelib/block_disk.py +++ b/image-bundle/gcimagebundlelib/block_disk.py @@ -146,6 +146,7 @@ class FsRawDisk(fs_copy.FsCopy): # self._fs_size - partition_start utils.MakePartition(disk_file_path, 'primary', 'ext2', partition_start, self._fs_size - partition_start) + uuid = None with utils.LoadDiskImage(disk_file_path) as devices: # For now we only support disks with a single partition. if len(devices) != 1: @@ -158,6 +159,7 @@ class FsRawDisk(fs_copy.FsCopy): utils.RunCommand(['ls', '/dev/mapper']) print 'Making filesystem' uuid = utils.MakeFileSystem(devices[0], 'ext4', uuid) + with utils.LoadDiskImage(disk_file_path) as devices: if uuid is None: raise Exception('Could not get uuid from makefilesystem') mount_point = tempfile.mkdtemp(dir=self._scratch_dir) @@ -168,6 +170,8 @@ class FsRawDisk(fs_copy.FsCopy): self._ProcessOverwriteList(mount_point) self._CleanupNetwork(mount_point) self._UpdateFstab(mount_point, uuid) + # Sleep for two seconds. Give time for the unmount to finish. + time.sleep(2) tar_entries = [] |