From: Oleg Bondarev Date: Tue, 19 Mar 2013 11:07:04 +0000 (+0400) Subject: Fix haproxy cfg unit test X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=5acb6ba0ad455cfab2a7d124f1bbce0072b73d6f;p=openstack-build%2Fneutron-build.git Fix haproxy cfg unit test Check if an option was already registered by one of the previous tests Fixes bug 1157094 Change-Id: Ieaa6e4b3647fb64ce1928b8564e4a41e68c97e74 --- diff --git a/quantum/tests/unit/services/agent_loadbalancer/driver/haproxy/test_cfg.py b/quantum/tests/unit/services/agent_loadbalancer/driver/haproxy/test_cfg.py index f07d383cd..0e6637369 100644 --- a/quantum/tests/unit/services/agent_loadbalancer/driver/haproxy/test_cfg.py +++ b/quantum/tests/unit/services/agent_loadbalancer/driver/haproxy/test_cfg.py @@ -50,7 +50,8 @@ class TestHaproxyCfg(base.BaseTestCase): '\n'.join(test_config)) def test_build_global(self): - config.CONF.register_opt(config.StrOpt('user_group')) + if not hasattr(config.CONF, 'user_group'): + config.CONF.register_opt(config.StrOpt('user_group')) config.CONF.set_override('user_group', 'test_group') expected_opts = ['global', '\tdaemon',