Skip to content

Commit

Permalink
Merge pull request #462 from CrowdStrike/carlosmmatos/issue461
Browse files Browse the repository at this point in the history
chore: update python linting for modules
  • Loading branch information
redhatrises authored Mar 6, 2024
2 parents 78d1940 + 33028b7 commit 39580f1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[flake8]
ignore = E501,E402
ignore = E501,E402,DAR101,DAR201,DAR401
2 changes: 2 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ disable=raw-checker-failed,
too-few-public-methods,
useless-object-inheritance, # Remove when we no longer run on python2 systems
too-many-instance-attributes,
no-name-in-module,
use-dict-literal

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
5 changes: 3 additions & 2 deletions plugins/inventory/falcon_discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,15 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
NAME = "crowdstrike.falcon.falcon_discover"

def verify_file(self, path):
if super(InventoryModule, self).verify_file(path):
"""Verify the inventory file."""
if super().verify_file(path):
if re.match(r".{0,}falcon_discover\.(yml|yaml)$", path):
return True
return False

def parse(self, inventory, loader, path, cache=True):
"""Parse the inventory file and return JSON data structure."""
super(InventoryModule, self).parse(inventory, loader, path)
super().parse(inventory, loader, path)

self._read_config_data(path)
cache_key = self.get_cache_key(path)
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/sensor_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def main():

if not dest:
dest = mkdtemp()
os.chmod(dest, 0o755)
os.chmod(dest, 0o755) # nosec
tmp_dir = True

# Make sure path exists and is a directory
Expand Down

0 comments on commit 39580f1

Please sign in to comment.