set pandora target from load.ini

This commit is contained in:
Alexey Lavrenuke 2015-10-27 15:33:43 +03:00
parent 3f106404b2
commit 4d227109c3
2 changed files with 7 additions and 0 deletions

View File

@ -70,6 +70,9 @@ class PoolConfig(object):
def set_user_schedule(self, user_schedule): def set_user_schedule(self, user_schedule):
self.config["UserLimiter"] = user_schedule self.config["UserLimiter"] = user_schedule
def set_target(self, target):
self.config["Gun"]["Parameters"]["Target"] = target
def data(self): def data(self):
return self.config return self.config
@ -78,6 +81,7 @@ def main():
pool_config = PoolConfig() pool_config = PoolConfig()
pool_config.set_loop(1) pool_config.set_loop(1)
pool_config.set_startup_schedule(parse_schedule("periodic(100, 100, 100)")) pool_config.set_startup_schedule(parse_schedule("periodic(100, 100, 100)"))
pool_config.set_target("example.org:443")
pandora_config = PandoraConfig() pandora_config = PandoraConfig()
pandora_config.add_pool(pool_config) pandora_config.add_pool(pool_config)
print(pandora_config.json()) print(pandora_config.json())

View File

@ -73,6 +73,9 @@ class PandoraPlugin(AbstractPlugin, AggregateResultListener):
raise RuntimeError( raise RuntimeError(
"user_schedule not specified") "user_schedule not specified")
target = self.get_option("target", "localhost:3000")
pool_config.set_target(target)
self.pandora_config = PandoraConfig() self.pandora_config = PandoraConfig()
self.pandora_config.add_pool(pool_config) self.pandora_config.add_pool(pool_config)