]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix haproxy cfg unit test
authorOleg Bondarev <obondarev@mirantis.com>
Tue, 19 Mar 2013 11:07:04 +0000 (15:07 +0400)
committerOleg Bondarev <obondarev@mirantis.com>
Tue, 19 Mar 2013 11:07:04 +0000 (15:07 +0400)
Check if an option was already registered by one of the previous tests

Fixes bug 1157094

Change-Id: Ieaa6e4b3647fb64ce1928b8564e4a41e68c97e74

quantum/tests/unit/services/agent_loadbalancer/driver/haproxy/test_cfg.py

index f07d383cde8d947e2550a4f12d35bc7222914720..0e6637369c65ea00e002a3fbc069900bdd721159 100644 (file)
@@ -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',