aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/lib/commons
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2018-03-02 14:08:39 -0800
committerVictor Morales <victor.morales@intel.com>2018-03-02 14:14:02 -0800
commit96fe388aea872a5e4b7255422c44be24f77f646f (patch)
tree44d11190073bbac6c4c1d96005b4531c21c5e4c3 /bootstrap/vagrant-onap/lib/commons
parent964af191e5d959ad855636cbab2dfa1350cbfa9e (diff)
Refactor install_docker_compose function
Usually this function is followed by a run command, this change ensure that docker-compose program is installed before its execution Change-Id: Ic68616a1db1e3c5bee516985c74f369a956d6775 Signed-off-by: Victor Morales <victor.morales@intel.com> Issue-ID: INT-436
Diffstat (limited to 'bootstrap/vagrant-onap/lib/commons')
-rwxr-xr-xbootstrap/vagrant-onap/lib/commons5
1 files changed, 4 insertions, 1 deletions
diff --git a/bootstrap/vagrant-onap/lib/commons b/bootstrap/vagrant-onap/lib/commons
index 5d0c69108..90f73d230 100755
--- a/bootstrap/vagrant-onap/lib/commons
+++ b/bootstrap/vagrant-onap/lib/commons
@@ -32,13 +32,16 @@ function is_package_installed {
source /etc/os-release || source /usr/lib/os-release
case ${ID,,} in
*suse)
+ CHECK_CMD="zypper search --match-exact --installed"
;;
ubuntu|debian)
- dpkg -s "$@" > /dev/null
+ CHECK_CMD="dpkg -l"
;;
rhel|centos|fedora)
+ CHECK_CMD="rpm -q"
;;
esac
+ ${CHECK_CMD} "$@" &> /dev/null
}
# install_packages() - Install a list of packages