summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2013-10-04 18:29:12 -0400
committerScott Moser <smoser@ubuntu.com>2013-10-04 18:29:12 -0400
commitfb7b982da08619fad2c582f921c05cf982621c0b (patch)
tree4f8f3ae270482e49248cbd1a80e84e859f31dd0c /cloudinit
parentff820acaf999479f75a12414ac5fcb12d51f258b (diff)
downloadvyos-cloud-init-fb7b982da08619fad2c582f921c05cf982621c0b.tar.gz
vyos-cloud-init-fb7b982da08619fad2c582f921c05cf982621c0b.zip
pep8 and pylint fixes
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/config/cc_disk_setup.py5
-rw-r--r--cloudinit/config/cc_mounts.py7
2 files changed, 8 insertions, 4 deletions
diff --git a/cloudinit/config/cc_disk_setup.py b/cloudinit/config/cc_disk_setup.py
index e903dd4d..0b970e4e 100644
--- a/cloudinit/config/cc_disk_setup.py
+++ b/cloudinit/config/cc_disk_setup.py
@@ -484,12 +484,13 @@ def get_partition_mbr_layout(size, layout):
def purge_disk_ptable(device):
# wipe the first and last megabyte of a disk (or file)
# gpt stores partition table both at front and at end.
+ null = '\0' # pylint: disable=W1401
start_len = 1024 * 1024
end_len = 1024 * 1024
with open(device, "rb+") as fp:
- fp.write('\0' * (start_len))
+ fp.write(null * (start_len))
fp.seek(-end_len, os.SEEK_END)
- fp.write('\0' * end_len)
+ fp.write(null * end_len)
fp.flush()
read_parttbl(device)
diff --git a/cloudinit/config/cc_mounts.py b/cloudinit/config/cc_mounts.py
index ff7bf506..84ec928f 100644
--- a/cloudinit/config/cc_mounts.py
+++ b/cloudinit/config/cc_mounts.py
@@ -20,6 +20,7 @@
from string import whitespace # pylint: disable=W0402
+import logging
import os.path
import re
@@ -32,6 +33,8 @@ SHORTNAME = re.compile(SHORTNAME_FILTER)
WS = re.compile("[%s]+" % (whitespace))
FSTAB_PATH = "/etc/fstab"
+LOG = logging.getLogger(__name__)
+
def is_mdname(name):
# return true if this is a metadata service name
@@ -146,7 +149,7 @@ def handle(_name, cfg, cloud, log, _args):
if cfgmnt_has:
log.debug(("Not including %s, already"
- " previously included"), startname)
+ " previously included"), start)
continue
cfgmnt.append(defmnt)
@@ -230,7 +233,7 @@ def devnode_for_dev_part(device, partition):
return None
sys_long_path = sys_path + "/" + short_name
-
+
if partition is not None:
partition = str(partition)