Commit 55997380 authored by Valentin Reis's avatar Valentin Reis

[fix] Formatting the daemon file according to standard flake8 rules.

parent 5a3b9fc8
......@@ -7,6 +7,7 @@ import nrm
import nrm.daemon
import os
def main(argv=None):
if argv is None:
argv = sys.argv
......@@ -19,13 +20,13 @@ def main(argv=None):
conf_parser.add_argument(
"-c",
"--configuration",
help="Specify a config json-formatted config file to override \
any of the available CLI options. If an option is \
actually provided on the command-line, it overrides \
its corresponding value from the configuration file.",
help="Specify a config json-formatted config file to override "
"any of the available CLI options. If an option is "
"actually provided on the command-line, it overrides "
"its corresponding value from the configuration file.",
metavar="FILE")
conf_parser.add_argument("-d","--print_defaults", action='store_true'
, help="Print the default configuration file.")
conf_parser.add_argument("-d", "--print_defaults", action='store_true',
help="Print the default configuration file.")
args, remaining_argv = conf_parser.parse_known_args()
defaults = {"nrm_log": "/tmp/nrm.log",
......@@ -41,44 +42,50 @@ def main(argv=None):
if args.configuration:
defaults.update(json.load(open(args.configuration)))
parser = argparse.ArgumentParser( parents=[conf_parser])
parser = argparse.ArgumentParser(parents=[conf_parser])
parser.set_defaults(**defaults)
parser.add_argument("--nrm_log",
help="Main log file. Override default with the NRM_LOG.\
environment variable",
parser.add_argument(
"--nrm_log",
help="Main log file. Override default with the NRM_LOG."
"environment variable",
default=os.environ.get('NRM_LOG',
'/tmp/nrm.log'))
parser.add_argument('--hwloc',
help="Path to the hwloc to use. This path can be \
relative and makes uses of the $PATH if necessary.\
Override default with the HWLOC environment\
variable.",
parser.add_argument(
'--hwloc',
help="Path to the hwloc to use. This path can be "
"relative and makes uses of the $PATH if necessary."
"Override default with the HWLOC environment"
"variable.",
default=os.environ.get('HWLOC',
'hwloc'))
parser.add_argument('--argo_nodeos_config',
help="Path to the argo_nodeos_config to use. This path \
can be relative and makes uses of the $PATH if \
necessary. Override default with the \
ARGO_NODEOS_CONFIG environment variable.",
parser.add_argument(
'--argo_nodeos_config',
help="Path to the argo_nodeos_config to use. This path "
"can be relative and makes uses of the $PATH if "
"necessary. Override default with the "
"ARGO_NODEOS_CONFIG environment variable.",
default=os.environ.get('ARGO_NODEOS_CONFIG',
'argo_nodeos_config'))
parser.add_argument('--perf',
help="Path to the linux perf tool to use. This path can be\
relative and makes uses of the $PATH if necessary.\
Override default with the PERF environment \
variable.",
parser.add_argument(
'--perf',
help="Path to the linux perf tool to use. This path can be"
"relative and makes uses of the $PATH if necessary."
"Override default with the PERF environment"
"variable.",
default=os.environ.get('PERF',
'perf'))
parser.add_argument('--argo_perf_wrapper',
help="Path to the linux perf tool to use. This path can\
be relative and makes uses of the $PATH if \
necessary. Override default with the PERFWRAPPER \
environment variable.",
parser.add_argument(
'--argo_perf_wrapper',
help="Path to the linux perf tool to use. This path can"
"be relative and makes uses of the $PATH if "
"necessary. Override default with the PERFWRAPPER "
"environment variable.",
default=os.environ.get('ARGO_PERF_WRAPPER',
'argo-perf-wrapper'))
args = parser.parse_args(remaining_argv)
nrm.daemon.runner(config=args)
return(0)
if __name__ == "__main__":
sys.exit(main())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment