From c9123269f6a79cd46825285a8e2f491fb81e44d1 Mon Sep 17 00:00:00 2001 From: Erik van Pienbroek Date: Wed, 2 Nov 2016 13:25:30 +0100 Subject: [PATCH] Use /sbin/ip when there is no 'ip' command in any of the default PATHs While configuring NFS an attempt is done to find out all guest IP addresses using the 'ip' tool. On various distros like Fedora 25, RHEL6 and RHEL 7 this tool is located in /sbin folder which is not in the default PATH. This can result in errors like: INFO warden: Calling OUT action: # DEBUG host: Searching for cap: nfs_installed DEBUG host: Checking in: redhat DEBUG host: Checking in: linux DEBUG host: Found cap: nfs_installed in linux INFO host: Execute capability: nfs_installed [#] (redhat) INFO nfs: Using NFS, preparing NFS settings by reading host IP and machine IP DEBUG ssh: Checking key permissions: /var/lib/jenkins/.vagrant.d/insecure_private_key DEBUG ssh: Re-using SSH connection. INFO ssh: Execute: ip addr show | grep -i 'inet ' | grep -v '127.0.0.1' | tr -s ' ' | cut -d' ' -f3 | cut -d'/' -f 1 (sudo=false) DEBUG ssh: stderr: bash: line 2: ip: command not found DEBUG ssh: Exit status: 0 INFO nfs: guest IPs: INFO nfs: host IP: 127.0.0.1 machine IP: [] INFO warden: Calling OUT action: # INFO warden: Calling OUT action: # INFO warden: Calling OUT action: # INFO warden: Calling OUT action: # and later on a fatal error occurs due to the wrong IP address being used: INFO guest: Execute capability: mount_nfs_folder [#, "127.0.0.1", {"/vagrant"=>{:type=>:"", :guestpath=>"/vagrant", :hostpath=>"/var/lib/jenkins/workspace/pipeline-test_rhsm_wip-TG6O6HU2IAULWKZINVXPWYUIU4APVEDUCV4TIOMW3LHGUVGFESPQ", :disabled=>false, :__vagrantfile=>true, :map_uid=>981, :map_gid=>980, :nfs_udp=>true, :nfs_version=>3, :uuid=>"519459908", :linux__nfs_options=>["rw", "no_subtree_check", "all_squash", "anonuid=981", "anongid=980", "fsid=519459908"]}, "/software"=>{:guestpath=>"/software", :hostpath=>"/home/shared/software", :disabled=>false, :__vagrantfile=>true, :map_uid=>1000, :map_gid=>1000, :nfs_udp=>true, :nfs_version=>3, :uuid=>"258980992", :linux__nfs_options=>["rw", "no_subtree_check", "all_squash", "anonuid=1000", "anongid=1000", "fsid=258980992"]}, "/yum_repos"=>{:guestpath=>"/yum_repos", :hostpath=>"/home/shared/yum_repos", :disabled=>false, :__vagrantfile=>true, :map_uid=>1000, :map_gid=>1000, :nfs_udp=>true, :nfs_version=>3, :uuid=>"1600717094", :linux__nfs_options=>["rw", "no_subtree_check", "all_squash", "anonuid=1000", "anongid=1000", "fsid=1600717094"]}}] (redhat) DEBUG ssh: Re-using SSH connection. INFO ssh: Execute: set -e mkdir -p /vagrant mount -o vers=3,udp 127.0.0.1:/var/lib/jenkins/workspace/pipeline-test_wip-TG6O6HU2IAULWKZINVXPWYUIU4APVEDUCV4TIOMW3LHGUVGFESPQ /vagrant if command -v /sbin/init && /sbin/init --version | grep upstart; then /sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=/vagrant fi (sudo=true) DEBUG ssh: Re-using SSH connection. INFO ssh: Execute: echo; printf $SSH_AUTH_SOCK (sudo=false) DEBUG ssh: Exit status: 0 DEBUG ssh: stdout: /tmp/ssh-IQUlPd2203/agent.2203 INFO ssh: Setting SSH_AUTH_SOCK remotely: /tmp/ssh-IQUlPd2203/agent.2203 DEBUG ssh: stderr: mount.nfs: requested NFS version or transport protocol is not supported DEBUG ssh: Exit status: 32 INFO retryable: Retryable exception raised: #