From 5acb6ba0ad455cfab2a7d124f1bbce0072b73d6f Mon Sep 17 00:00:00 2001 From: Oleg Bondarev Date: Tue, 19 Mar 2013 15:07:04 +0400 Subject: [PATCH] Fix haproxy cfg unit test Check if an option was already registered by one of the previous tests Fixes bug 1157094 Change-Id: Ieaa6e4b3647fb64ce1928b8564e4a41e68c97e74 --- .../services/agent_loadbalancer/driver/haproxy/test_cfg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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', -- 2.45.2