Set PATH in Ubuntu 18.04 VM's 37/13037/1 v0.25.3
authorJeremy Phelps <jphelps@linuxfoundation.org>
Tue, 16 Oct 2018 21:26:46 +0000 (16:26 -0500)
committerJeremy Phelps <jphelps@linuxfoundation.org>
Wed, 17 Oct 2018 19:06:16 +0000 (14:06 -0500)
This is a workaround for a bash 3.4 bug that does not
set ~/.local/bin in PATH.

Change-Id: I69a94442bf7b760712bf72cdbc207451b73cd408
Issue-ID: RELENG-1320
Signed-off-by: Jeremy Phelps <jphelps@linuxfoundation.org>
jenkins-init-scripts/create-jenkins-user.sh
releasenotes/notes/fix_path-59e63b4be43c0bb1.yaml [new file with mode: 0644]

index 40ac25f..0005244 100755 (executable)
 ##############################################################################
 
 OS=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
+OS_RELEASE=$(facter lsbdistrelease | tr '[:upper:]' '[:lower:]')
+
+if [[ "$OS_RELEASE" == "18.04" ]] && [[ "$OS" == 'ubuntu' ]]
+then
+  echo 'PATH=$HOME/.local/bin:$PATH
+export PATH' >> /etc/profile
+fi
 
 useradd -m -s /bin/bash jenkins
 
diff --git a/releasenotes/notes/fix_path-59e63b4be43c0bb1.yaml b/releasenotes/notes/fix_path-59e63b4be43c0bb1.yaml
new file mode 100644 (file)
index 0000000..f4967d7
--- /dev/null
@@ -0,0 +1,6 @@
+---
+fixes:
+  - |
+    On Ubuntu 18.04 set PATH to include $HOME/.local/bin.
+    This is needed for pip install --user to work, and is missing
+    in Ubuntu versions past 16.04.