mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-26 21:33:05 +00:00
pylint: Fix redefined-builtin
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
def get_roles(dir):
|
def get_roles(directory):
|
||||||
roles = []
|
roles = []
|
||||||
|
|
||||||
_rolesdir = "%s/roles/" % dir
|
_rolesdir = "%s/roles/" % directory
|
||||||
for _role in os.listdir(_rolesdir):
|
for _role in os.listdir(_rolesdir):
|
||||||
_roledir = "%s/%s" % (_rolesdir, _role)
|
_roledir = "%s/%s" % (_rolesdir, _role)
|
||||||
if not os.path.isdir(_roledir) or \
|
if not os.path.isdir(_roledir) or \
|
||||||
@@ -16,19 +16,19 @@ def get_roles(dir):
|
|||||||
return sorted(roles)
|
return sorted(roles)
|
||||||
|
|
||||||
|
|
||||||
def get_modules(dir):
|
def get_modules(directory):
|
||||||
management_modules = []
|
management_modules = []
|
||||||
roles_modules = []
|
roles_modules = []
|
||||||
|
|
||||||
for root, _dirs, files in os.walk(dir):
|
for root, _dirs, files in os.walk(directory):
|
||||||
if not root.startswith("%s/plugins/" % dir) and \
|
if not root.startswith("%s/plugins/" % directory) and \
|
||||||
not root.startswith("%s/roles/" % dir):
|
not root.startswith("%s/roles/" % directory):
|
||||||
continue
|
continue
|
||||||
for _file in files:
|
for _file in files:
|
||||||
if _file.endswith(".py"):
|
if _file.endswith(".py"):
|
||||||
if root == "%s/plugins/modules" % dir:
|
if root == "%s/plugins/modules" % directory:
|
||||||
management_modules.append(_file[:-3])
|
management_modules.append(_file[:-3])
|
||||||
elif root.startswith("%s/roles/" % dir):
|
elif root.startswith("%s/roles/" % directory):
|
||||||
if root.endswith("/library"):
|
if root.endswith("/library"):
|
||||||
roles_modules.append(_file[:-3])
|
roles_modules.append(_file[:-3])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user