Skip to content

Commit

Permalink
Merge pull request #659 from yandex/master
Browse files Browse the repository at this point in the history
update to Master
  • Loading branch information
fomars committed Oct 23, 2018
2 parents fe124b0 + b5ee8c7 commit e337f44
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# The short X.Y version.
version = '1.10'
# The full version, including alpha/beta/rc tags.
release = '1.10.2'
release = '1.10.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
35 changes: 18 additions & 17 deletions yandextank/plugins/DataUploader/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import sys
import time
import datetime
import yaml
from future.moves.urllib.parse import urljoin

from queue import Empty, Queue
Expand Down Expand Up @@ -93,7 +94,6 @@ def __init__(self, core, cfg):
self.monitoring = threading.Thread(target=self.__monitoring_uploader)
self.monitoring.daemon = True

self._generator_info = None
self._is_telegraf = None
self.backend_type = BackendTypes.identify_backend(self.cfg['api_address'])
self._task = None
Expand All @@ -115,7 +115,8 @@ def get_key():
@property
def lock_duration(self):
if self._lock_duration is None:
self._lock_duration = self.generator_info.duration if self.generator_info.duration else \
info = self.get_generator_info()
self._lock_duration = info.duration if info.duration else \
expand_to_seconds(self.get_option("target_lock_duration"))
return self._lock_duration

Expand Down Expand Up @@ -214,14 +215,18 @@ def search_task_from_cwd(cwd):
os.getcwd())

def prepare_test(self):
info = self.generator_info
info = self.get_generator_info()
port = info.port
instances = info.instances
if info.ammo_file.startswith(
"http://") or info.ammo_file.startswith("https://"):
ammo_path = info.ammo_file
if info.ammo_file is not None:
if info.ammo_file.startswith(
"http://") or info.ammo_file.startswith("https://"):
ammo_path = info.ammo_file
else:
ammo_path = os.path.realpath(info.ammo_file)
else:
ammo_path = os.path.realpath(info.ammo_file)
logger.warning('Failed to get info about ammo path')
ammo_path = 'Undefined'
loop_count = int(info.loop_count)

try:
Expand Down Expand Up @@ -560,10 +565,9 @@ def __get_lp_job(self):
"""
api_client = self.__get_api_client()

info = self.generator_info
info = self.get_generator_info()
port = info.port
loadscheme = [] if isinstance(info.rps_schedule,
str) else info.rps_schedule
loadscheme = [] if isinstance(info.rps_schedule, (str, dict)) else info.rps_schedule

lp_job = LPJob(client=api_client,
target_host=self.target,
Expand All @@ -582,7 +586,7 @@ def __get_lp_job(self):
log_monitoring_requests=self.get_option('log_monitoring_requests'),
log_status_requests=self.get_option('log_status_requests'),
log_other_requests=self.get_option('log_other_requests'))
lp_job.send_config(LPRequisites.CONFIGINITIAL, self.core.config.get_configinitial())
lp_job.send_config(LPRequisites.CONFIGINITIAL, yaml.dump(self.core.config.get_configinitial()))
return lp_job

@property
Expand Down Expand Up @@ -630,16 +634,13 @@ def read_token(filename):
)
raise RuntimeError("API token error")

@property
def generator_info(self):
if self._generator_info is None:
self._generator_info = self.core.job.generator_plugin.get_info()
return self._generator_info
def get_generator_info(self):
return self.core.job.generator_plugin.get_info()

@property
def target(self):
if self._target is None:
self._target = self.generator_info.address
self._target = self.get_generator_info().address
logger.info("Detected target: %s", self.target)
return self._target

Expand Down

0 comments on commit e337f44

Please sign in to comment.