pep8 and pylint fixes
This commit is contained in:
@@ -484,12 +484,13 @@ def get_partition_mbr_layout(size, layout):
|
|||||||
def purge_disk_ptable(device):
|
def purge_disk_ptable(device):
|
||||||
# wipe the first and last megabyte of a disk (or file)
|
# wipe the first and last megabyte of a disk (or file)
|
||||||
# gpt stores partition table both at front and at end.
|
# gpt stores partition table both at front and at end.
|
||||||
|
null = '\0' # pylint: disable=W1401
|
||||||
start_len = 1024 * 1024
|
start_len = 1024 * 1024
|
||||||
end_len = 1024 * 1024
|
end_len = 1024 * 1024
|
||||||
with open(device, "rb+") as fp:
|
with open(device, "rb+") as fp:
|
||||||
fp.write('\0' * (start_len))
|
fp.write(null * (start_len))
|
||||||
fp.seek(-end_len, os.SEEK_END)
|
fp.seek(-end_len, os.SEEK_END)
|
||||||
fp.write('\0' * end_len)
|
fp.write(null * end_len)
|
||||||
fp.flush()
|
fp.flush()
|
||||||
|
|
||||||
read_parttbl(device)
|
read_parttbl(device)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
from string import whitespace # pylint: disable=W0402
|
from string import whitespace # pylint: disable=W0402
|
||||||
|
|
||||||
|
import logging
|
||||||
import os.path
|
import os.path
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@@ -32,6 +33,8 @@ SHORTNAME = re.compile(SHORTNAME_FILTER)
|
|||||||
WS = re.compile("[%s]+" % (whitespace))
|
WS = re.compile("[%s]+" % (whitespace))
|
||||||
FSTAB_PATH = "/etc/fstab"
|
FSTAB_PATH = "/etc/fstab"
|
||||||
|
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def is_mdname(name):
|
def is_mdname(name):
|
||||||
# return true if this is a metadata service name
|
# return true if this is a metadata service name
|
||||||
@@ -146,7 +149,7 @@ def handle(_name, cfg, cloud, log, _args):
|
|||||||
|
|
||||||
if cfgmnt_has:
|
if cfgmnt_has:
|
||||||
log.debug(("Not including %s, already"
|
log.debug(("Not including %s, already"
|
||||||
" previously included"), startname)
|
" previously included"), start)
|
||||||
continue
|
continue
|
||||||
cfgmnt.append(defmnt)
|
cfgmnt.append(defmnt)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user