Skip to content

Commit

Permalink
Use --get function instead of --has to validate presence of an object…
Browse files Browse the repository at this point in the history
… in the given section

Closes-Bug: 1660278

Change-Id: Id8fc9118b358c2374ceea472892a9a5eaf3e4133
  • Loading branch information
npchandran committed Feb 16, 2017
1 parent 6784da1 commit bb2cec7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions contrail_provisioning/common/base.py
Expand Up @@ -380,10 +380,9 @@ def get_config(self, fl, sec, var):
def has_config(self, fl, sec, var):
has = False
with settings(warn_only=True):
output = local("openstack-config --has %s %s %s" % (
output = local("openstack-config --get %s %s %s" % (
fl, sec, var), capture=True)
has = bool(int(output))
return has
return output.succeeded

def setup(self):
self.disable_selinux()
Expand Down

0 comments on commit bb2cec7

Please sign in to comment.