qubes.storage.file fix pylint warnings
This commit is contained in:
parent
38dc74587d
commit
9f3385296b
@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/python2 -O
|
#!/usr/bin/python2 -O
|
||||||
# vim: fileencoding=utf-8
|
# vim: fileencoding=utf-8
|
||||||
|
|
||||||
#
|
#
|
||||||
# The Qubes OS Project, https://www.qubes-os.org/
|
# The Qubes OS Project, https://www.qubes-os.org/
|
||||||
#
|
#
|
||||||
@ -131,6 +130,7 @@ class FilePool(Pool):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _resize_loop_device(path):
|
def _resize_loop_device(path):
|
||||||
|
''' Sets the loop device capacity '''
|
||||||
# find loop device if any
|
# find loop device if any
|
||||||
p = subprocess.Popen(
|
p = subprocess.Popen(
|
||||||
['sudo', 'losetup', '--associated', path],
|
['sudo', 'losetup', '--associated', path],
|
||||||
@ -494,9 +494,7 @@ def create_dir_if_not_exists(path):
|
|||||||
|
|
||||||
|
|
||||||
def copy_file(source, destination):
|
def copy_file(source, destination):
|
||||||
'''Effective file copy, preserving sparse files etc.
|
'''Effective file copy, preserving sparse files etc.'''
|
||||||
'''
|
|
||||||
# TODO: Windows support
|
|
||||||
# We prefer to use Linux's cp, because it nicely handles sparse files
|
# We prefer to use Linux's cp, because it nicely handles sparse files
|
||||||
assert os.path.exists(source), \
|
assert os.path.exists(source), \
|
||||||
"Missing the source %s to copy from" % source
|
"Missing the source %s to copy from" % source
|
||||||
@ -515,6 +513,7 @@ def copy_file(source, destination):
|
|||||||
|
|
||||||
|
|
||||||
def _remove_if_exists(path):
|
def _remove_if_exists(path):
|
||||||
|
''' Removes a path if it exist, silently succeeds if file does not exist '''
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user