Skip to content

Commit 67601b4

Browse files
committed
Fix pycodestyle complaints
Signed-off-by: Denys Fedoryshchenko <[email protected]>
1 parent d3fc581 commit 67601b4

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

kernelci/cli/job.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ def new(name, input_node_id, platform, # pylint: disable=too-many-arguments
5555
if runtime not in configs['runtimes']:
5656
raise click.ClickException(f"Invalid runtime {runtime}")
5757
runtime = kernelci.runtime.get_runtime(
58-
configs['runtimes'][runtime], token=secrets.api.runtime_token, custom_template_dir=config[0] if config else None)
58+
configs['runtimes'][runtime], token=secrets.api.runtime_token,
59+
custom_template_dir=config[0] if config else None)
5960
job_node = helper.create_job_node(job_config, input_node,
6061
platform=platform_config, runtime=runtime)
6162
if job_node:
@@ -116,7 +117,8 @@ def generate(node_id, # pylint: disable=too-many-arguments, too-many-locals
116117
if runtime_config is None:
117118
raise click.ClickException(f"Runtime {runtime} not found in the config")
118119
runtime = kernelci.runtime.get_runtime(
119-
runtime_config, token=secrets.api.runtime_token, custom_template_dir=config[0] if config else None)
120+
runtime_config, token=secrets.api.runtime_token,
121+
custom_template_dir=config[0] if config else None)
120122
params = runtime.get_params(job, api.config)
121123
if not params:
122124
raise click.ClickException("Invalid job parameters, aborting...")
@@ -149,7 +151,8 @@ def submit(runtime, job_path, wait, # pylint: disable=too-many-arguments
149151
configs = kernelci.config.load(config)
150152
runtime_config = configs['runtimes'][runtime]
151153
runtime = kernelci.runtime.get_runtime(
152-
runtime_config, token=secrets.api.runtime_token, custom_template_dir=config[0] if config else None
154+
runtime_config, token=secrets.api.runtime_token,
155+
custom_template_dir=config[0] if config else None
153156
)
154157
job = runtime.submit(job_path)
155158
click.echo(runtime.get_job_id(job))

kernelci/runtime/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ def __init__(self, config, user=None, token=None, custom_template_dir=None):
8888
self._templates.append(custom_template_dir)
8989
# Add relevant subdirectories
9090
for subdir in ["runtime", "runtime/base", "runtime/boot", "runtime/tests"]:
91-
sub_path = os.path.join(custom_template_dir, subdir) if not custom_template_dir.endswith(subdir) else custom_template_dir
91+
sub_path = (
92+
os.path.join(custom_template_dir, subdir)
93+
if not custom_template_dir.endswith(subdir)
94+
else custom_template_dir
95+
)
9296
if os.path.isdir(sub_path):
9397
self._templates.append(sub_path)
9498
self._user = user
@@ -231,7 +235,8 @@ def get_runtime(config, user=None, token=None, custom_template_dir=None):
231235
"""
232236
module_name = '.'.join(['kernelci', 'runtime', config.lab_type])
233237
runtime_module = importlib.import_module(module_name)
234-
return runtime_module.get_runtime(config, user=user, token=token, custom_template_dir=custom_template_dir)
238+
return runtime_module.get_runtime(config, user=user, token=token,
239+
custom_template_dir=custom_template_dir)
235240

236241

237242
def get_all_runtimes(runtime_configs, opts, custom_template_dir=None):
@@ -251,7 +256,8 @@ def get_all_runtimes(runtime_configs, opts, custom_template_dir=None):
251256
opts.get_from_section(section, opt)
252257
for opt in ('user', 'runtime_token')
253258
)
254-
runtime = get_runtime(config, user=user, token=token, custom_template_dir=custom_template_dir)
259+
runtime = get_runtime(config, user=user, token=token,
260+
custom_template_dir=custom_template_dir)
255261
yield config_name, runtime
256262

257263

0 commit comments

Comments
 (0)