Skip to content

Commit

Permalink
Add support for rpmlint folder in the root of inventory_dir
Browse files Browse the repository at this point in the history
This PRs adds support for one folder called rpmlint inside of the
inventory_dir.

With Pulp packaging going to Python 3.11, rpmlint is about to break when
the Jenkins nodes start to use one ansible version that requires python
3.11 and install python3.11-libs, it will start to complain about the
  dist-utls deprecation in python 3.12+.
  • Loading branch information
Odilhao committed Dec 11, 2023
1 parent 13323f7 commit 883020f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
18 changes: 18 additions & 0 deletions obal/data/playbooks/lint/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@
roles:
- package_variables
tasks:

- name: 'Scans for rpmlint file'
ansible.builtin.find:
path: "{{ inventory_dir }}/rpmlint"
file_type: file
recurse: true
hidden: true
register: lintfile

- name: 'Print rpmlint output'
debug:
msg: "{{ lintfile.files | map(attribute='path') }} }}"

- name: 'Set rpmlint file when present'
set_fact:
rpmlint_rc_file: "{{ lintfile.files | map(attribute='path') | first }}"
when: lintfile.files | map(attribute='size') | length > 0

- name: 'Set default rpmlint RC file'
set_fact:
rpmlint_rc_file: "{{ inventory_dir }}/{{ package_base_dir }}{{ inventory_hostname }}/.rpmlintrc"
Expand Down
5 changes: 5 additions & 0 deletions tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,11 @@ def test_obal_lint_hello_with_epoch():

assert_mockbin_log(["rpmlint --file {pwd}/packages/hello/.rpmlintrc {pwd}/packages/hello"])

@obal_cli_test(repotype='upstream')
def test_obal_lint_rpmlint_folder():
assert_obal_success(['lint', 'hello'])

assert_mockbin_log(["rpmlint --file {pwd}/rpmlint/.rpmlintrc {pwd}/packages/hello"])

@obal_cli_test(repotype='upstream_bad_changelog')
def test_obal_lint_bad_changelog():
Expand Down

0 comments on commit 883020f

Please sign in to comment.