use equal match for inventory file classification

This commit is contained in:
Robert Kaussow 2019-04-09 09:17:29 +02:00
parent 4c6c5c9120
commit 60e4694e7f
2 changed files with 3 additions and 3 deletions

View File

@ -310,7 +310,7 @@ def classify(filename, settings={}, standards=[]):
if parentdir in ["library", "lookup_plugins", "callback_plugins", if parentdir in ["library", "lookup_plugins", "callback_plugins",
"filter_plugins"] or filename.endswith(".py"): "filter_plugins"] or filename.endswith(".py"):
return Code(filename, settings, standards) return Code(filename, settings, standards)
if "inventory" in basename or "hosts" in basename or parentdir in ["inventory"]: if "inventory" == basename or "hosts" == basename or parentdir in ["inventories"]:
return Inventory(filename, settings, standards) return Inventory(filename, settings, standards)
if "rolesfile" in basename or "requirements" in basename: if "rolesfile" in basename or "requirements" in basename:
return Rolesfile(filename, settings, standards) return Rolesfile(filename, settings, standards)

View File

@ -18,9 +18,9 @@ def get_property(prop, project):
return result.group(1) return result.group(1)
def get_readme(filename='README.md'): def get_readme(filename="README.md"):
this = os.path.abspath(os.path.dirname(__file__)) this = os.path.abspath(os.path.dirname(__file__))
with io.open(os.path.join(this, filename), encoding='utf-8') as f: with io.open(os.path.join(this, filename), encoding="utf-8") as f:
long_description = f.read() long_description = f.read()
return long_description return long_description