public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Scott Mayhew <smayhew@redhat.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: kdevops@lists.linux.dev
Subject: Re: [PATCH 2/2] nfstest: fix another RHEL 8-ism
Date: Wed, 24 Apr 2024 18:00:29 -0400	[thread overview]
Message-ID: <ZimA_eW9HpESu_JV@aion> (raw)
In-Reply-To: <Zil34/zYD3Ck7gDN@tissot.1015granger.net>

On Wed, 24 Apr 2024, Chuck Lever wrote:

> On Wed, Apr 24, 2024 at 05:15:11PM -0400, Scott Mayhew wrote:
> > RHEL 8 doesn't have the python-unversioned-command package.  So we'll
> > install python-unversioned-command on RHEL/CentOS 9 and higher, and on
> > RHEL/CentOS 8 and lower we'll set up the /usr/bin/python symlink via
> > the 'alternatives' command.
> > 
> > I'm not doing any special checking on Fedora, which has had the
> > python-unversioned-command package since F29.  I'm assuming anyone using
> > kdevops to run nfstest on Fedora is going to be using a much more recent
> > version.
> 
> It seems like other workflows have python dependencies like this.
> Would it be better to put this logic in a common role?

Actually it depends on whether any of those workflows are using commands
like 'python somescript.py'.  On a quick scan, I don't see anything.
But if there were, they could probably just be changed to use 'python3
somescript.py' (is anyone using python2 any more?).

The original nfstest patches that you posted had a step that was doing
'python setup.py build', and that's what I was tripping on, which
prompted me to suggest installing the python-unversioned-command
package.

But in the patches that you committed, you're just running nfstest
directly from the git dir (which BTW is the way I've always run nfstest
manually in the past).  So I don't think we even need the
python-unversioned-command package any more, and maybe we can just
yank it.  I'll do some testing.

-Scott

> 
> 
> > Signed-off-by: Scott Mayhew <smayhew@redhat.com>
> > ---
> >  playbooks/roles/nfstest/tasks/main.yml  | 19 +++++++++++++++++++
> >  playbooks/roles/nfstest/vars/RedHat.yml |  1 -
> >  2 files changed, 19 insertions(+), 1 deletion(-)
> > 
> > diff --git a/playbooks/roles/nfstest/tasks/main.yml b/playbooks/roles/nfstest/tasks/main.yml
> > index 1ccd247..d0f7d18 100644
> > --- a/playbooks/roles/nfstest/tasks/main.yml
> > +++ b/playbooks/roles/nfstest/tasks/main.yml
> > @@ -23,6 +23,14 @@
> >          - 'vars'
> >    tags: vars
> >  
> > +- name: Add python-unversioned-command to list of nfstest packages
> > +  ansible.builtin.set_fact:
> > +    nfstest_packages: "{{ nfstest_packages + ['python-unversioned-command'] }}"
> > +  when:
> > +    - ansible_facts['os_family']|lower == 'redhat'
> > +    - ansible_facts['distribution_major_version'] | int >= 9
> > +  tags: vars
> > +
> >  - name: Install dependencies for nfstest
> >    become: true
> >    become_flags: 'su - -c'
> > @@ -32,6 +40,17 @@
> >      state: present
> >    tags: nfstest
> >  
> > +- name: Set /usr/bin/python symlink
> > +  become: true
> > +  become_flags: 'su - -c'
> > +  become_method: ansible.builtin.sudo
> > +  ansible.builtin.shell:
> > +    cmd: alternatives --set python /usr/bin/python3
> > +  when:
> > +    - ansible_facts['os_family']|lower == 'redhat'
> > +    - ansible_facts['distribution_major_version'] | int <= 8
> > +  tags: nfstest
> > +
> >  - name: Create the /data mount point on the target nodes
> >    ansible.builtin.include_role:
> >      name: create_data_partition
> > diff --git a/playbooks/roles/nfstest/vars/RedHat.yml b/playbooks/roles/nfstest/vars/RedHat.yml
> > index a14c20e..76adc4d 100644
> > --- a/playbooks/roles/nfstest/vars/RedHat.yml
> > +++ b/playbooks/roles/nfstest/vars/RedHat.yml
> > @@ -1,6 +1,5 @@
> >  ---
> >  nfstest_packages:
> >    - nfs-utils
> > -  - python-unversioned-command
> >    - tcpdump
> >    - git-core
> > -- 
> > 2.44.0
> > 
> > 
> 
> -- 
> Chuck Lever
> 


  reply	other threads:[~2024-04-24 22:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 21:15 [PATCH 1/2] nfstest: add git-core to the list of install dependencies Scott Mayhew
2024-04-24 21:15 ` [PATCH 2/2] nfstest: fix another RHEL 8-ism Scott Mayhew
2024-04-24 21:21   ` Chuck Lever
2024-04-24 22:00     ` Scott Mayhew [this message]
2024-04-24 22:52       ` Chuck Lever III
2024-04-24 21:19 ` [PATCH 1/2] nfstest: add git-core to the list of install dependencies Chuck Lever
2024-04-24 21:50   ` Scott Mayhew

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZimA_eW9HpESu_JV@aion \
    --to=smayhew@redhat.com \
    --cc=chuck.lever@oracle.com \
    --cc=kdevops@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox