Python virtualenv being picked up by containers

Bug #1904909 reported by Luke Short
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Triaged
Low
Luke Short

Bug Description

Description
===========
When using a Python virtual environment (for development purposes), the Python path seems to be picked up by some containers. Those containers will fail because the path does not exist in the container itself. I am unsure if this is something we can or want to fix.

Steps to reproduce
==================
* Install Victoria RDO packages ("current" build).
* Setup a Python virtual environment and install the Undercloud:
```
$ virtualenv -p python3 ~/venv_tripleo
$ . ~/venv_tripleo/bin/activate
(venv_tripleo)$ git clone https://github.com/openstack/python-tripleoclient.git
(venv_tripleo)$ cd python-tripleoclient
(venv_tripleo)$ pip install -e .
(venv_tripleo)$ openstack undercloud install
...
2020-11-19 17:35:11.070400 | 52540001-e2d1-b52e-ee82-000000003787 | FATAL | Manage container systemd services and cleanup old systemd healthchecks for /var/lib/tripleo-config/container-startup-config/step_4 | undercloud | error={"cha
nged": false, "msg": "Service neutron_ovs_agent has not started yet"}
(venv_tripleo)$ sudo podman logs neutron_ovs_agent
...
++ cat /run_command
Running command: '/neutron_ovs_agent_launcher.sh'
+ CMD=/neutron_ovs_agent_launcher.sh
+ ARGS=
+ [[ ! -n '' ]]
+ . kolla_extend_start
+ echo 'Running command: '\''/neutron_ovs_agent_launcher.sh'\'''
+ exec /neutron_ovs_agent_launcher.sh
+ /home/stack/venv_tripleo/bin/python3 -m neutron.cmd.destroy_patch_ports --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/openvswitch_agent.ini --config-dir /etc/neutron/conf.d/common --config-dir /etc/neutron/conf.d/neutron-openvswitch-agent --log-file=/var/log/neutron/openvswitch-agent.log
/neutron_ovs_agent_launcher.sh: line 3: /home/stack/venv_tripleo/bin/python3: No such file or directory
```

Expected result
===============
The environment variables from the shell should not be passed through to containers.

Actual result
=============
The $PATH appears to get passed to the containers causing a failure with Python applications using `/usr/bin/env python3`. The Undercloud deployment then fails.

Environment
===========
- CentOS 8.2
- Victoria RDO current packages (2020-11-18)

Tags: virtualenv
Luke Short (ekultails)
Changed in tripleo:
assignee: nobody → Luke Short (ekultails)
Changed in tripleo:
milestone: wallaby-1 → wallaby-2
Changed in tripleo:
milestone: wallaby-2 → wallaby-3
Changed in tripleo:
milestone: wallaby-3 → wallaby-rc1
Changed in tripleo:
milestone: wallaby-rc1 → xena-1
Changed in tripleo:
milestone: xena-1 → xena-2
Changed in tripleo:
milestone: xena-2 → xena-3
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.