From 9a1398bbf69b34197fcffe9ea99d311f92a73cbc Mon Sep 17 00:00:00 2001 From: Patrik Polakovič Date: Oct 05 2022 10:49:24 +0000 Subject: Add basic Zuul configuration --- diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..0019b7c --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +ignore = E128, W503 +max-line-length = 100 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..ff18f57 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,21 @@ +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: check-added-large-files + - id: check-toml + - id: debug-statements + + - repo: https://gitlab.com/PyCQA/flake8 + rev: 5.0.4 + hooks: + - id: flake8 + + - repo: https://github.com/psf/black + rev: 22.8.0 + hooks: + - id: black + args: + - --diff + - --check diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000..3a9d515 --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,5 @@ +--- +- project: + check: + jobs: + - fi-pre-commit diff --git a/CommunishiftAuthorization/.flake8 b/CommunishiftAuthorization/.flake8 deleted file mode 100644 index 7da1f96..0000000 --- a/CommunishiftAuthorization/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length = 100 diff --git a/CommunishiftAuthorization/pyproject.toml b/CommunishiftAuthorization/pyproject.toml deleted file mode 100644 index 2096b4c..0000000 --- a/CommunishiftAuthorization/pyproject.toml +++ /dev/null @@ -1,2 +0,0 @@ -[tool.black] - line_length = 100 diff --git a/CommunishiftAuthorization/roles/communishiftauthorization/library/communishift_retrieve_fasjson_data.py b/CommunishiftAuthorization/roles/communishiftauthorization/library/communishift_retrieve_fasjson_data.py index b170f73..36e590d 100644 --- a/CommunishiftAuthorization/roles/communishiftauthorization/library/communishift_retrieve_fasjson_data.py +++ b/CommunishiftAuthorization/roles/communishiftauthorization/library/communishift_retrieve_fasjson_data.py @@ -5,13 +5,12 @@ # https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function -import os - -import re import json +import re import requests -from requests_kerberos import HTTPKerberosAuth, REQUIRED + from ansible.module_utils.basic import AnsibleModule +from requests_kerberos import HTTPKerberosAuth __metaclass__ = type @@ -177,7 +176,7 @@ def run_module(): result["matched_groups"] = json.dumps(communishift_groups) result["changed"] = True result["msg"] = "Successfully retrieved groups and their users from fasjson." - except Exception as e: + except Exception: raise # in the event of a successful module execution, you will want to diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2096b4c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[tool.black] + line_length = 100