fix warnings generated by pylint
This commit is contained in:
parent
082bb267df
commit
f04cb3836f
6 changed files with 34 additions and 32 deletions
|
|
@ -1,7 +1,6 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
|
@ -10,7 +9,8 @@ def main(tree, options):
|
|||
playbook = options["playbook"]
|
||||
|
||||
with open("/tmp/inventory", "w") as f:
|
||||
f.write(f"osbuild-tree ansible_connection=chroot ansible_host={tree} ansible_python_interpreter=/usr/bin/python3")
|
||||
f.write(f"osbuild-tree ansible_connection=chroot ansible_host={tree} "
|
||||
f"ansible_python_interpreter=/usr/bin/python3")
|
||||
|
||||
with open("/tmp/playbook.yml", "w") as f:
|
||||
if isinstance(playbook, str):
|
||||
|
|
@ -29,5 +29,5 @@ def main(tree, options):
|
|||
|
||||
if __name__ == '__main__':
|
||||
args = json.load(sys.stdin)
|
||||
r = main(args["tree"], args["options"])
|
||||
sys.exit(r)
|
||||
ret = main(args["tree"], args["options"])
|
||||
sys.exit(ret)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
|
@ -17,13 +16,13 @@ def main(tree, options):
|
|||
for repoid, repo in repos.items():
|
||||
conf.write(f"[{repoid}]\n")
|
||||
for key, value in repo.items():
|
||||
if type(value) == str:
|
||||
if isinstance(value, str):
|
||||
s = value
|
||||
elif type(value) == list:
|
||||
elif isinstance(value, list):
|
||||
s = " ".join(value)
|
||||
elif type(value) == bool:
|
||||
elif isinstance(value, bool):
|
||||
s = "1" if value else "0"
|
||||
elif type(value) == int:
|
||||
elif isinstance(value, int):
|
||||
s = str(value)
|
||||
else:
|
||||
print(f"unkown type for `{key}`: {value} ({type(value)})")
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
import json
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
def main(tree, options):
|
||||
root_fs_uuid = options["root_fs_uuid"]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
import json
|
||||
import sys
|
||||
|
||||
def main(tree, options):
|
||||
def main(_tree, options):
|
||||
print("Not doing anything with these options:", json.dumps(options))
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue