1
0
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:
Tony Asleson 2016-08-29 15:07:55 -05:00
parent 1870b3293a
commit 5392a612dc
7 changed files with 33 additions and 28 deletions

View File

@ -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)

View File

@ -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:

View File

@ -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)
@ -223,7 +222,7 @@ if __name__ == "__main__":
end = time.time()
print(("RC: %d" % ret))
#print(("OUT:\n%s" % out))
# print(("OUT:\n%s" % out))
print(("ERR:\n%s" % err))
print("Command = %f seconds" % (end - start))

View File

@ -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')

View File

@ -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)