From 09f41161e4131211caa337be7a3700dd6c160102 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Fri, 8 Sep 2023 11:39:18 -0300 Subject: [PATCH] pylint: Fix redefined-builtin --- utils/facts.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/utils/facts.py b/utils/facts.py index 3687123486..ff7efd34c5 100644 --- a/utils/facts.py +++ b/utils/facts.py @@ -1,10 +1,10 @@ import os -def get_roles(dir): +def get_roles(directory): roles = [] - _rolesdir = "%s/roles/" % dir + _rolesdir = "%s/roles/" % directory for _role in os.listdir(_rolesdir): _roledir = "%s/%s" % (_rolesdir, _role) if not os.path.isdir(_roledir) or \ @@ -16,19 +16,19 @@ def get_roles(dir): return sorted(roles) -def get_modules(dir): +def get_modules(directory): management_modules = [] roles_modules = [] - for root, _dirs, files in os.walk(dir): - if not root.startswith("%s/plugins/" % dir) and \ - not root.startswith("%s/roles/" % dir): + for root, _dirs, files in os.walk(directory): + if not root.startswith("%s/plugins/" % directory) and \ + not root.startswith("%s/roles/" % directory): continue for _file in files: if _file.endswith(".py"): - if root == "%s/plugins/modules" % dir: + if root == "%s/plugins/modules" % directory: management_modules.append(_file[:-3]) - elif root.startswith("%s/roles/" % dir): + elif root.startswith("%s/roles/" % directory): if root.endswith("/library"): roles_modules.append(_file[:-3])