Skip to content

Commit

Permalink
Merge "Ignore error when determining the package version" into R3.0.3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Feb 5, 2017
2 parents 7e70f89 + 7772971 commit d116298
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fabfile/utils/fabos.py
Expand Up @@ -73,7 +73,10 @@ def get_release(pkg='contrail-install-packages', use_install_repo=False):
cmd = "dpkg --info /opt/contrail/contrail_install_repo/%s*.deb | grep Version: | cut -d' ' -f3 | cut -d'-' -f1" %pkg
else:
cmd = "dpkg -s %s | grep Version: | cut -d' ' -f2 | cut -d'-' -f1" %pkg
pkg_ver = sudo(cmd)
# In case of nodes, where the expected pkg is not installed, Errors
# should be ignored and return None.
with settings(warn_only=True):
pkg_ver = sudo(cmd)
if 'is not installed' in pkg_ver or 'is not available' in pkg_ver or 'No such file or directory' in pkg_ver:
print "Package %s not installed." % pkg
return None
Expand Down

0 comments on commit d116298

Please sign in to comment.