mirror of
https://github.com/valitydev/yandex-tank.git
synced 2024-11-06 02:15:22 +00:00
copy pandora config with its own extension
This commit is contained in:
parent
47e6a36e3d
commit
920e9fa1d8
@ -53,12 +53,11 @@ class Plugin(AbstractPlugin, GeneratorPlugin):
|
||||
pass
|
||||
self.core.add_artifact_file(self.sample_log)
|
||||
|
||||
self.pandora_config_file = self.core.mkstemp(
|
||||
".json", "pandora_config_")
|
||||
self.core.add_artifact_file(self.pandora_config_file)
|
||||
|
||||
config_content = self.get_option("config_content", "")
|
||||
if config_content:
|
||||
self.pandora_config_file = self.core.mkstemp(
|
||||
".json", "pandora_config_")
|
||||
self.core.add_artifact_file(self.pandora_config_file)
|
||||
with open(self.pandora_config_file, 'w') as config_file:
|
||||
config_file.write(config_content)
|
||||
else:
|
||||
@ -68,6 +67,10 @@ class Plugin(AbstractPlugin, GeneratorPlugin):
|
||||
"neither pandora config content"
|
||||
"nor pandora config file is specified")
|
||||
else:
|
||||
extension = config_file.rsplit(".", 1)[1]
|
||||
self.pandora_config_file = self.core.mkstemp(
|
||||
"." + extension, "pandora_config_")
|
||||
self.core.add_artifact_file(self.pandora_config_file)
|
||||
with open(config_file, 'rb') as config:
|
||||
config_content = config.read()
|
||||
with open(self.pandora_config_file, 'wb') as config_file:
|
||||
|
Loading…
Reference in New Issue
Block a user