diff --git a/virtualbmc/cmd/vbmc.py b/virtualbmc/cmd/vbmc.py index c1ab65b..85f8cd3 100644 --- a/virtualbmc/cmd/vbmc.py +++ b/virtualbmc/cmd/vbmc.py @@ -50,7 +50,7 @@ class ZmqClient(object): and `rows` attributes pointing to lists of cell values. """ - SERVER_TIMEOUT = 5000 # milliseconds + SERVER_TIMEOUT = CONF['default']['server_response_timeout'] @staticmethod def to_dict(obj): @@ -114,7 +114,7 @@ class ZmqClient(object): vbmcd.main([]) # TODO(etingof): perform some more retries - time.sleep(3) + time.sleep(CONF['default']['server_spawn_wait'] / 1000.) # MQ will deliver the original message to the daemon # we've started diff --git a/virtualbmc/config.py b/virtualbmc/config.py index 4b73a48..5d7a418 100644 --- a/virtualbmc/config.py +++ b/virtualbmc/config.py @@ -42,6 +42,8 @@ class VirtualBMCConfig(object): os.path.expanduser('~'), '.vbmc', 'master.pid' ), 'server_port': 50891, + 'server_response_timeout': 5000, # milliseconds + 'server_spawn_wait': 3000, # milliseconds }, 'log': { 'logfile': None, diff --git a/virtualbmc/tests/unit/test_config.py b/virtualbmc/tests/unit/test_config.py index 43ad746..ee5474c 100644 --- a/virtualbmc/tests/unit/test_config.py +++ b/virtualbmc/tests/unit/test_config.py @@ -33,7 +33,9 @@ class VirtualBMCConfigTestCase(base.TestCase): self.config_dict = {'default': {'show_passwords': 'true', 'config_dir': '/foo/bar/1', 'pid_file': '/foo/bar/2', - 'server_port': '12345'}, + 'server_port': '12345', + 'server_spawn_wait': 3000, + 'server_response_timeout': 5000}, 'log': {'debug': 'true', 'logfile': '/foo/bar/4'}, 'ipmi': {'session_timeout': '30'}}