diff options
author | Victor Morales <victor.morales@intel.com> | 2018-03-02 14:08:39 -0800 |
---|---|---|
committer | Victor Morales <victor.morales@intel.com> | 2018-03-02 14:14:02 -0800 |
commit | 96fe388aea872a5e4b7255422c44be24f77f646f (patch) | |
tree | 44d11190073bbac6c4c1d96005b4531c21c5e4c3 /bootstrap/vagrant-onap/lib/commons | |
parent | 964af191e5d959ad855636cbab2dfa1350cbfa9e (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-x | bootstrap/vagrant-onap/lib/commons | 5 |
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 |