summaryrefslogtreecommitdiff
path: root/extensions/writeexts.py
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2016-02-25 11:23:36 +0000
committerBaserock Gerrit <gerrit@baserock.org>2016-02-25 17:41:34 +0000
commit962992ddba2f3540f1507ee1c902b02f87c08c6a (patch)
treee9bb6fd7b5b153946b2c25ee5f8f0c631a066365 /extensions/writeexts.py
parenta41cbe28a3c8f5aa263206776d0891debb9d6fa2 (diff)
downloaddefinitions-962992ddba2f3540f1507ee1c902b02f87c08c6a.tar.gz
writeexts: Fix some errors the `pep8` tool found
This includes a crash if DISK_SIZE isn't specified (due to missing 'writeexts' import). There are still various indent/formatting issues that `pep8` complains about. Change-Id: Ida805ad829eeee62768ac54313417d4c9a4a94d9
Diffstat (limited to 'extensions/writeexts.py')
-rw-r--r--extensions/writeexts.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/extensions/writeexts.py b/extensions/writeexts.py
index d424be3b..528e4e71 100644
--- a/extensions/writeexts.py
+++ b/extensions/writeexts.py
@@ -15,13 +15,9 @@
import contextlib
import errno
-import fcntl
import logging
import os
-import partitioning
-import pyfdisk
import re
-import select
import shutil
import stat
import subprocess
@@ -29,6 +25,10 @@ import sys
import time
import tempfile
+import partitioning
+import pyfdisk
+import writeexts
+
if sys.version_info >= (3, 3, 0):
import shlex
@@ -316,7 +316,7 @@ class WriteExtension(Extension):
self.create_bootloader_config(
temp_root, mp, version_label='factory',
rootfs_uuid=self.get_uuid(raw_disk))
- except BaseException as e:
+ except BaseException:
sys.stderr.write('Error creating Btrfs system layout')
raise
@@ -430,7 +430,7 @@ class WriteExtension(Extension):
else:
subprocess.check_call(['mount', '-o', 'loop',
location, mount_point])
- except BaseException as e:
+ except BaseException:
sys.stderr.write('Error mounting filesystem')
os.rmdir(mount_point)
raise
@@ -503,7 +503,6 @@ class WriteExtension(Extension):
'''
initramfs = self.find_initramfs(temp_root)
version_root = os.path.join(mountpoint, 'systems', version_label)
- system_dir = os.path.join(version_root, 'orig')
self.install_kernel(version_root, temp_root)
if self.get_dtb_path() != '':