summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--image-bundle/.gitignore4
-rw-r--r--image-bundle/gcimagebundlelib/block_disk.py4
3 files changed, 8 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 66b6e4c..44bff53 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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 = []