Skip to content

Commit

Permalink
Merge branch 'master' into theyareback
Browse files Browse the repository at this point in the history
  • Loading branch information
iranzo committed Aug 22, 2024
2 parents 059c21c + c9d8008 commit d8da222
Show file tree
Hide file tree
Showing 20 changed files with 103 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
auto-merge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ahmadnassri/[email protected]
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand All @@ -44,14 +44,14 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -65,4 +65,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
2 changes: 1 addition & 1 deletion .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1.1.1
- uses: actions/first-interaction@v1.3.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Thank you for raising this issue'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-go@v4
- uses: actions/setup-python@v5
- uses: actions/setup-go@v5
with:
go-version: '>=1.18'
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.cache/pre-commit
key: ${{ runner.os }}-precommit-${{ hashFiles('**/.pre-commit-config.yaml/*') }}
restore-keys: |
${{ runner.os }}-precommit-
- uses: pre-commit/[email protected].0
- uses: pre-commit/[email protected].1
with:
token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:
python-version: [3.x] # No longer compatible , 2.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt') }}
Expand All @@ -55,7 +55,7 @@ jobs:
pytest --cov-report=xml --cov=risuclient --cov=maguiclient
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.4
uses: codecov/codecov-action@v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
Expand All @@ -43,7 +43,7 @@ jobs:
RELEASE_VERSION: ${{ steps.branch_name.outputs.SOURCE_TAG }}

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.10
uses: pypa/gh-action-pypi-publish@v1.9.0
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
6 changes: 3 additions & 3 deletions .github/workflows/refresh-authors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
runs-on: ubuntu-latest # windows-latest | macos-latest
name: Test changed-files
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.

- name: Get changed files in the checks folder
id: changed-files-specific
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v44
with:
files: |
**/*.py
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Commit back the updated files to the repository
if: steps.changed-files-specific.outputs.any_changed == 'true'
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
# Optional. Commit message for the created commit.
# Defaults to "Apply automatic changes"
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-python@v4
- uses: actions/cache@v3
uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/cache@v4
with:
path: |
~/.cache/pre-commit
key: ${{ runner.os }}-precommit-${{ hashFiles('**/.pre-commit-config.yaml/*') }}
restore-keys: |
${{ runner.os }}-precommit-
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ">=1.18"

Expand All @@ -49,11 +48,15 @@ jobs:
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
- uses: actions/setup-node@v4
with:
node-version: '14'

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
uses: cycjimmy/semantic-release-action@v4
id: semantic
with:
semantic_version: 19.0.5
semantic_version: 18.0.0
extra_plugins: |
@semantic-release/git
@semantic-release/changelog
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/shiftleft-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# Scan runs on ubuntu, mac and windows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Instructions
# 1. Setup JDK, Node.js, Python etc depending on your project type
# 2. Compile or build the project before invoking scan
Expand All @@ -37,6 +37,6 @@ jobs:
# type: python

- name: Upload report
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: reports
2 changes: 1 addition & 1 deletion .github/workflows/size.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
update_labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions-ecosystem/action-size@v2
id: size
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_semver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
update-semver:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: haya14busa/[email protected]
with:
major_version_tag_only: false # (optional, default is "false")
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=88
known_third_party = pytest,setuptools
known_third_party = imp,pytest,setuptools
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ repos:
stages:
- commit-msg
repo: https://github.com/commitizen-tools/commitizen
rev: 3.6.0
rev: v3.29.0
- hooks:
- id: check-useless-excludes
repo: meta
- hooks:
- files: \.(css|js|md|markdown|json)
id: prettier
repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.2
rev: v4.0.0-alpha.8
- hooks:
- id: seed-isort-config
repo: https://github.com/asottile/seed-isort-config
Expand All @@ -26,7 +26,7 @@ repos:
- hooks:
- id: black
repo: https://github.com/python/black
rev: 23.7.0
rev: 24.8.0
- hooks:
- id: check-added-large-files
- id: check-ast
Expand Down Expand Up @@ -55,13 +55,13 @@ repos:
- id: check-byte-order-marker
- id: check-docstring-first
repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
- hooks:
- id: flake8
repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.1.1
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.7.0-1
rev: v3.8.0-1
hooks:
# Choose one of:
- id: shfmt # native (requires/installs Go to build)
Expand All @@ -76,7 +76,7 @@ repos:
- hooks:
- id: blacken-docs
repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
rev: 1.18.0

# - repo: https://github.com/asottile/pyupgrade
# rev: v2.38.0
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [1.14.3](https://github.com/risuorg/risu/compare/1.14.2...1.14.3) (2023-09-04)

### Bug Fixes

- move egrep -> grep -E ([fcdab4d](https://github.com/risuorg/risu/commit/fcdab4de5afb2c11e8f37a174ff2e04ac078860f))

## [1.14.2](https://github.com/risuorg/risu/compare/1.14.1...1.14.2) (2023-02-15)

### Bug Fixes
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
requests
urllib3>=2.2.2 # not directly required, pinned by Snyk to avoid a vulnerability
zombie-imp
40 changes: 40 additions & 0 deletions risuclient/plugins/core/informative/linux16.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# Copyright (C) 2024 Pablo Iranzo Gómez <[email protected]>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# long_name: Detects if system is using linux16 and/or initd16 instead of regular descriptions
# description: Reports if system is using linux16 or initrd16
# priority: 100
# kb:

# Load common functions
[[ -f "${RISU_BASE}/common-functions.sh" ]] && . "${RISU_BASE}/common-functions.sh"

MYFILE="${RISU_ROOT}/etc/grub2.cfg"

is_required_file ${MYFILE}

RC=${RC_OKAY}

if is_lineinfile ^linux16.* ${MYFILE}; then
RC=${RC_INFO}
echo "linux16 entry detected in ${MYFILE}" >&2
fi
if is_lineinfile ^initrd16.* ${MYFILE}; then
RC=${RC_INFO}
echo "initrd16 entry detected in ${MYFILE}" >&2
fi
exit ${RC}
2 changes: 1 addition & 1 deletion risuclient/plugins/core/network/interface-errors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ IFACES_IN_SYSTEM=$(grep -i "state UP" ${IP_ADDRESS_FILE} | cut -f2 -d ":" | tr -

# Check all interfaces
for iface in ${IFACES_IN_SYSTEM}; do
IFACEPATH=$(find ${RISU_ROOT}/sys | grep net | grep ${iface} | grep errors)
IFACEPATH=$(find ${RISU_ROOT}/sys | grep net | grep ${iface} | grep -E 'errors|dropped|carrier_changes')

for file in ${IFACEPATH}; do
CONTENT=$(cat ${file})
Expand Down
8 changes: 6 additions & 2 deletions risuclient/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
# Description: Runs set of scripts against system or snapshot to
# detect common pitfalls in configuration/status
#
# Copyright (C) 2024
# Copyright (C) 2017, 2018 Robin Černín <[email protected]>
# Copyright (C) 2017 Lars Kellogg-Stedman <[email protected]>
# Copyright (C) 2017-2023 Pablo Iranzo Gómez <[email protected]>
# Copyright (C) 2024
# Copyright (C) 2017-2024 Pablo Iranzo Gómez <[email protected]>
# Copyright (C) 2024
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -28,13 +31,14 @@
import datetime
import gettext
import hashlib
import imp
import json
import logging
import os
import re
import tempfile

import imp

# Do not require everyone to use requests
try:
import requests
Expand Down
Loading

0 comments on commit d8da222

Please sign in to comment.