diff options
-rw-r--r-- | .github/reviewers.yml | 3 | ||||
-rw-r--r-- | .github/workflows/auto-author-assign.yml | 10 | ||||
-rw-r--r-- | .github/workflows/codeql.yml | 2 | ||||
-rw-r--r-- | interface-definitions/interfaces_openvpn.xml.in | 2 | ||||
-rw-r--r-- | python/vyos/xml_ref/__init__.py | 6 | ||||
-rw-r--r-- | python/vyos/xml_ref/definition.py | 27 |
6 files changed, 35 insertions, 15 deletions
diff --git a/.github/reviewers.yml b/.github/reviewers.yml deleted file mode 100644 index a1647d20d..000000000 --- a/.github/reviewers.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -"**/*": - - team: reviewers diff --git a/.github/workflows/auto-author-assign.yml b/.github/workflows/auto-author-assign.yml index 1a7f8ef0b..0bfe972c0 100644 --- a/.github/workflows/auto-author-assign.yml +++ b/.github/workflows/auto-author-assign.yml @@ -15,13 +15,3 @@ jobs: uses: toshimaru/auto-author-assign@v1.6.2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - - # https://github.com/shufo/auto-assign-reviewer-by-files - assign_reviewer: - runs-on: ubuntu-latest - steps: - - name: Request review based on files changes and/or groups the author belongs to - uses: shufo/auto-assign-reviewer-by-files@v1.1.4 - with: - token: ${{ secrets.PR_ACTION_ASSIGN_REVIEWERS }} - config: .github/reviewers.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8b1c3c141..9e2e4bf0f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -27,7 +27,7 @@ permissions: jobs: codeql-analysis-call: - uses: vyos/vyos-github-actions/.github/workflows/codeql-analysis.yml@main + uses: vyos/vyos-github-actions/.github/workflows/codeql-analysis.yml@current secrets: inherit with: languages: "['python']" diff --git a/interface-definitions/interfaces_openvpn.xml.in b/interface-definitions/interfaces_openvpn.xml.in index 7b46f32b3..23cc83e9a 100644 --- a/interface-definitions/interfaces_openvpn.xml.in +++ b/interface-definitions/interfaces_openvpn.xml.in @@ -663,7 +663,7 @@ <help>Number of digits to use for totp hash</help> <valueHelp> <format>1-65535</format> - <description>Seconds</description> + <description>Digits</description> </valueHelp> <constraint> <validator name="numeric" argument="--range 1-65535"/> diff --git a/python/vyos/xml_ref/__init__.py b/python/vyos/xml_ref/__init__.py index bf434865d..2ba3da4e8 100644 --- a/python/vyos/xml_ref/__init__.py +++ b/python/vyos/xml_ref/__init__.py @@ -53,6 +53,12 @@ def is_valueless(path: list) -> bool: def is_leaf(path: list) -> bool: return load_reference().is_leaf(path) +def owner(path: list) -> str: + return load_reference().owner(path) + +def priority(path: list) -> str: + return load_reference().priority(path) + def cli_defined(path: list, node: str, non_local=False) -> bool: return load_reference().cli_defined(path, node, non_local=non_local) diff --git a/python/vyos/xml_ref/definition.py b/python/vyos/xml_ref/definition.py index c90c5ddbc..c85835ffd 100644 --- a/python/vyos/xml_ref/definition.py +++ b/python/vyos/xml_ref/definition.py @@ -135,6 +135,33 @@ class Xml: d = self._get_ref_path(path) return self._is_leaf_node(d) + def _least_upper_data(self, path: list, name: str) -> str: + ref_path = path.copy() + d = self.ref + data = '' + while ref_path and d: + d = d.get(ref_path[0], {}) + ref_path.pop(0) + if self._is_tag_node(d) and ref_path: + ref_path.pop(0) + if self._is_leaf_node(d) and ref_path: + ref_path.pop(0) + res = self._get_ref_node_data(d, name) + if res is not None: + data = res + + return data + + def owner(self, path: list) -> str: + from pathlib import Path + data = self._least_upper_data(path, 'owner') + if data: + data = Path(data.split()[0]).name + return data + + def priority(self, path: list) -> str: + return self._least_upper_data(path, 'priority') + @staticmethod def _dict_get(d: dict, path: list) -> dict: for i in path: |