mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
lvmdbusd: WS/pep8 corrections
This commit is contained in:
parent
1870b3293a
commit
5392a612dc
@ -149,8 +149,8 @@ def background_execute(command, background_job):
|
||||
try:
|
||||
if line_str.count(':') == 2:
|
||||
(device, ignore, percentage) = line_str.split(':')
|
||||
background_job.Percent = \
|
||||
round(float(percentage.strip()[:-1]), 1)
|
||||
background_job.Percent = round(
|
||||
float(percentage.strip()[:-1]), 1)
|
||||
except ValueError:
|
||||
log_error("Trying to parse percentage which failed for %s" %
|
||||
line_str)
|
||||
|
@ -120,6 +120,7 @@ def call_lvm(command, debug=False):
|
||||
# from forking a new process to using lvm shell
|
||||
_t_call = call_lvm
|
||||
|
||||
|
||||
def _shell_cfg():
|
||||
global _t_call
|
||||
try:
|
||||
|
@ -115,7 +115,6 @@ class LVMShellProxy(object):
|
||||
local_env["LVM_REPORT_FD"] = "32"
|
||||
local_env["LVM_COMMAND_PROFILE"] = "lvmdbusd"
|
||||
|
||||
|
||||
flags = fcntl(self.report_r, F_GETFL)
|
||||
fcntl(self.report_r, F_SETFL, flags | os.O_NONBLOCK)
|
||||
|
||||
|
@ -96,17 +96,21 @@ def main():
|
||||
start = time.time()
|
||||
# Add simple command line handling
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--udev", action='store_true',
|
||||
help="Use udev for updating state", default=False,
|
||||
parser.add_argument(
|
||||
"--udev", action='store_true',
|
||||
help="Use udev for updating state",
|
||||
default=False,
|
||||
dest='use_udev')
|
||||
parser.add_argument("--debug", action='store_true',
|
||||
parser.add_argument(
|
||||
"--debug", action='store_true',
|
||||
help="Dump debug messages", default=False,
|
||||
dest='debug')
|
||||
parser.add_argument("--nojson", action='store_false',
|
||||
help="Do not use LVM JSON output (Note: This "
|
||||
"does not work with --lvmshell", default=True,
|
||||
parser.add_argument(
|
||||
"--nojson", action='store_false',
|
||||
help="Do not use LVM JSON output (disables lvmshell)", default=True,
|
||||
dest='use_json')
|
||||
parser.add_argument("--lvmshell", action='store_true',
|
||||
parser.add_argument(
|
||||
"--lvmshell", action='store_true',
|
||||
help="Use the lvm shell, not fork & exec lvm",
|
||||
default=False,
|
||||
dest='use_lvm_shell')
|
||||
|
@ -19,6 +19,7 @@ from .request import RequestEntry
|
||||
from .refresh import event_add
|
||||
from . import udevwatch
|
||||
|
||||
|
||||
# noinspection PyPep8Naming
|
||||
class Manager(AutomatedProperties):
|
||||
_Version_meta = ("s", MANAGER_INTERFACE)
|
||||
|
Loading…
Reference in New Issue
Block a user