From 3a6d1deb8712d43ad4295e766621fdf27fd25c76 Mon Sep 17 00:00:00 2001 From: fomars Date: Thu, 3 May 2018 15:35:50 +0300 Subject: [PATCH 1/2] omit validator field in docs --- yandextank/validator/docs_gen.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/yandextank/validator/docs_gen.py b/yandextank/validator/docs_gen.py index 78a9def52..32b16a3da 100644 --- a/yandextank/validator/docs_gen.py +++ b/yandextank/validator/docs_gen.py @@ -17,6 +17,7 @@ EXAMPLES = 'examples' ANYOF = 'anyof' NO_DSC = '(no description)' +VALIDATOR = 'validator' class TextBlock(object): @@ -306,14 +307,14 @@ def scalar_formatter(self, renderer, header=True): hdr = renderer.subtitle(renderer.mono(self.option_name) + ' ' + '({})'.format(self.option_kwargs.get(TYPE))) \ if header else '' dsc = self.format_dsc(renderer) - body = render_body(renderer, self.option_kwargs, [TYPE, DESCRIPTION, DEFAULT, REQUIRED], {'allowed': allowed}) + body = render_body(renderer, self.option_kwargs, [VALIDATOR, TYPE, DESCRIPTION, DEFAULT, REQUIRED], {'allowed': allowed}) return '\n'.join([_ for _ in [hdr, dsc, body] if _]) def scalar_with_values_description(self, renderer, header=True): hdr = renderer.subtitle(renderer.mono(self.option_name) + ' ' + '({})'.format(self.option_kwargs.get(TYPE))) \ if header else '' dsc = self.format_dsc(renderer) - body = render_body(renderer, self.option_kwargs, [TYPE, DESCRIPTION, DEFAULT, REQUIRED, ALLOWED, VALUES_DSC]) + body = render_body(renderer, self.option_kwargs, [VALIDATOR, TYPE, DESCRIPTION, DEFAULT, REQUIRED, ALLOWED, VALUES_DSC]) values_description_block = render_values_description(renderer, self.option_kwargs) return '\n'.join([_ for _ in [hdr, dsc, body, values_description_block] if _]) @@ -327,7 +328,7 @@ def dict_formatter(self, renderer, header=True): schema_block = renderer.field_list({ '{} ({})'.format(renderer.mono(key), dict_schema[key][TYPE]): get_formatter({key: value})(renderer, header=False) for key, value in dict_schema.items()}) - body = render_body(renderer, self.option_kwargs, [TYPE, DESCRIPTION, DEFAULT, REQUIRED, SCHEMA]) + body = render_body(renderer, self.option_kwargs, [VALIDATOR, TYPE, DESCRIPTION, DEFAULT, REQUIRED, SCHEMA]) return '\n'.join([_ for _ in [hdr, dsc, schema_block, body] if _]) def anyof_formatter(self, renderer, header=True): @@ -337,7 +338,7 @@ def anyof_formatter(self, renderer, header=True): dsc = self.format_dsc(renderer) values_description_block = render_values_description(renderer, self.option_kwargs) \ if VALUES_DSC in self.option_kwargs else '' - body = render_body(renderer, self.option_kwargs, [TYPE, DESCRIPTION, DEFAULT, REQUIRED, ANYOF, VALUES_DSC]) + body = render_body(renderer, self.option_kwargs, [VALIDATOR, TYPE, DESCRIPTION, DEFAULT, REQUIRED, ANYOF, VALUES_DSC]) return '\n'.join([_ for _ in [hdr, dsc, values_description_block, body] if _]) @@ -347,7 +348,7 @@ def list_formatter(self, renderer, header=True): ' ' + '({} of {})'.format(self.option_kwargs.get(TYPE, LIST), schema.get(TYPE, ''))) dsc = self.format_dsc(renderer) - body = render_body(renderer, self.option_kwargs, [TYPE, DEFAULT, REQUIRED, DESCRIPTION, SCHEMA]) + body = render_body(renderer, self.option_kwargs, [VALIDATOR, TYPE, DEFAULT, REQUIRED, DESCRIPTION, SCHEMA]) if set(schema.keys()) - {TYPE}: schema_block = renderer.field_list({ '[list_element] ({})'.format(schema.get(TYPE, '')): From b2229f9424dd0436917ab6053584673b80983bd0 Mon Sep 17 00:00:00 2001 From: fomars Date: Thu, 3 May 2018 15:43:04 +0300 Subject: [PATCH 2/2] fix tutorial --- docs/tutorial.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 33704abc4..56e23d302 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -381,9 +381,9 @@ Now, our basic config looks like that: phantom: address: 203.0.113.1:443 - load_profile: - load_type: rps - schedule: line(1, 10, 10m) + load_profile: + load_type: rps + schedule: line(1, 10, 10m) ssl: true .. note::