Skip to content

Commit

Permalink
Merge pull request #614 from fomars/develop
Browse files Browse the repository at this point in the history
cryptography, cfg patches, pandas import
  • Loading branch information
fomars committed Jul 2, 2018
2 parents 4bfe375 + 181fe8a commit 1a61255
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
9 changes: 0 additions & 9 deletions Dockerfile-TankBAT

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM load/yandex-tank-pip:testing
WORKDIR /yandextank
RUN apt-get update && \
apt-get install -y python-pip
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
namespace_packages=["yandextank", "yandextank.plugins"],
packages=find_packages(exclude=["tests", "tmp", "docs", "data"]),
install_requires=[
'cryptography>=2.2.1', 'pyopenssl==18.0.0',
'psutil>=1.2.1', 'requests>=2.5.1', 'paramiko>=1.16.0',
'pandas>=0.18.0', 'numpy>=1.12.1', 'future>=0.16.0',
'pip>=8.1.2',
'pyyaml>=3.12', 'cerberus==1.2', 'influxdb>=5.0.0',
'netort>=0.0.11', 'pyopenssl>=17.5.0'
'netort>=0.0.11',
],
setup_requires=[
'pytest-runner', 'flake8',
Expand Down
19 changes: 15 additions & 4 deletions yandextank/core/consoleworker.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

import yaml
from pkg_resources import resource_filename

from yandextank.validator.validator import ValidationError
from ..config_converter.converter import convert_ini, convert_single_option
from .tankcore import TankCore, LockError

Expand Down Expand Up @@ -245,23 +247,32 @@ def patch_ini_config_with_monitoring(ini_config, mon_section_name):
raise ex


def parse_and_check_patches(patches):
parsed = [yaml.load(p) for p in patches]
for patch in parsed:
if not isinstance(patch, dict):
raise ValidationError('Config patch "{}" should be a dict'.format(patch))
return parsed


def load_tank_core(config_files, cmd_options, no_rc, depr_options, other_opts, patches=None):
if patches is None:
patches = []

other_opts = [other_opts] if other_opts else []
config_files = config_files if len(config_files) > 0 else [DEFAULT_CONFIG]
if no_rc:
configs = [load_cfg(cfg) for cfg in config_files] +\
other_opts +\
parse_options(cmd_options) +\
[yaml.load(p) for p in patches]
parse_options(cmd_options) + \
parse_and_check_patches(patches)
else:
configs = [load_core_base_cfg()] +\
load_local_base_cfgs() +\
[load_cfg(cfg) for cfg in config_files] +\
other_opts +\
parse_options(cmd_options) +\
[yaml.load(p) for p in patches]
parse_options(cmd_options) + \
parse_and_check_patches(patches)
return TankCore(configs)


Expand Down
1 change: 1 addition & 0 deletions yandextank/plugins/Phantom/config/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'description': 'Address of target. Format: [host]:port, [ipv4]:port, [ipv6]:port. Port is optional. '
'Tank checks each test if port is available',
"type": "string",
"empty": False,
"required": True,
'examples': {'127.0.0.1:8080': '', 'www.w3c.org': ''}
},
Expand Down
2 changes: 1 addition & 1 deletion yandextank/plugins/Phantom/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import datetime
import itertools as itt

from pandas.parser import CParserError
from pandas.io.common import CParserError

from yandextank.common.interfaces import StatsReader

Expand Down

0 comments on commit 1a61255

Please sign in to comment.