From 6f1fa4592b7bacc28ccee5a1ec3315b4005ff87b Mon Sep 17 00:00:00 2001 From: Dmitry Vasilev Date: Mon, 25 Apr 2022 12:00:27 +0300 Subject: [PATCH] [BUG][python] Fix PEP8 E111 issue in rest.mustache (#12229) * Fix PEP8 E111 issue * Update samples --- .../src/main/resources/python/rest.mustache | 10 +++++----- samples/client/petstore/python/petstore_api/rest.py | 10 +++++----- .../petstore_api/rest.py | 10 +++++----- .../x-auth-id-alias/python/x_auth_id_alias/rest.py | 10 +++++----- .../dynamic-servers/python/dynamic_servers/rest.py | 10 +++++----- .../client/petstore/python/petstore_api/rest.py | 10 +++++----- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/rest.mustache b/modules/openapi-generator/src/main/resources/python/rest.mustache index d4293e70da2..4740f10fd00 100644 --- a/modules/openapi-generator/src/main/resources/python/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python/rest.mustache @@ -290,10 +290,10 @@ def is_ipv4(target): """ Test if IPv4 address or not """ try: - chk = ipaddress.IPv4Address(target) - return True + chk = ipaddress.IPv4Address(target) + return True except ipaddress.AddressValueError: - return False + return False def in_ipv4net(target, net): """ Test if target belongs to given IPv4 network @@ -333,6 +333,6 @@ def should_bypass_proxies(url, no_proxy=None): if is_ipv4(parsed.hostname): for item in entries: - if in_ipv4net(parsed.hostname, item): - return True + if in_ipv4net(parsed.hostname, item): + return True return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} ) diff --git a/samples/client/petstore/python/petstore_api/rest.py b/samples/client/petstore/python/petstore_api/rest.py index 476138a6bc8..e264c456aab 100644 --- a/samples/client/petstore/python/petstore_api/rest.py +++ b/samples/client/petstore/python/petstore_api/rest.py @@ -298,10 +298,10 @@ def is_ipv4(target): """ Test if IPv4 address or not """ try: - chk = ipaddress.IPv4Address(target) - return True + chk = ipaddress.IPv4Address(target) + return True except ipaddress.AddressValueError: - return False + return False def in_ipv4net(target, net): """ Test if target belongs to given IPv4 network @@ -341,6 +341,6 @@ def should_bypass_proxies(url, no_proxy=None): if is_ipv4(parsed.hostname): for item in entries: - if in_ipv4net(parsed.hostname, item): - return True + if in_ipv4net(parsed.hostname, item): + return True return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} ) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/rest.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/rest.py index 476138a6bc8..e264c456aab 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/rest.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/rest.py @@ -298,10 +298,10 @@ def is_ipv4(target): """ Test if IPv4 address or not """ try: - chk = ipaddress.IPv4Address(target) - return True + chk = ipaddress.IPv4Address(target) + return True except ipaddress.AddressValueError: - return False + return False def in_ipv4net(target, net): """ Test if target belongs to given IPv4 network @@ -341,6 +341,6 @@ def should_bypass_proxies(url, no_proxy=None): if is_ipv4(parsed.hostname): for item in entries: - if in_ipv4net(parsed.hostname, item): - return True + if in_ipv4net(parsed.hostname, item): + return True return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} ) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/rest.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/rest.py index c3566a6d0b2..636f31b19a3 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/rest.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/rest.py @@ -298,10 +298,10 @@ def is_ipv4(target): """ Test if IPv4 address or not """ try: - chk = ipaddress.IPv4Address(target) - return True + chk = ipaddress.IPv4Address(target) + return True except ipaddress.AddressValueError: - return False + return False def in_ipv4net(target, net): """ Test if target belongs to given IPv4 network @@ -341,6 +341,6 @@ def should_bypass_proxies(url, no_proxy=None): if is_ipv4(parsed.hostname): for item in entries: - if in_ipv4net(parsed.hostname, item): - return True + if in_ipv4net(parsed.hostname, item): + return True return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} ) diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/rest.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/rest.py index b73beb6fd00..2ad59429196 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/rest.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/rest.py @@ -298,10 +298,10 @@ def is_ipv4(target): """ Test if IPv4 address or not """ try: - chk = ipaddress.IPv4Address(target) - return True + chk = ipaddress.IPv4Address(target) + return True except ipaddress.AddressValueError: - return False + return False def in_ipv4net(target, net): """ Test if target belongs to given IPv4 network @@ -341,6 +341,6 @@ def should_bypass_proxies(url, no_proxy=None): if is_ipv4(parsed.hostname): for item in entries: - if in_ipv4net(parsed.hostname, item): - return True + if in_ipv4net(parsed.hostname, item): + return True return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/rest.py b/samples/openapi3/client/petstore/python/petstore_api/rest.py index 476138a6bc8..e264c456aab 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python/petstore_api/rest.py @@ -298,10 +298,10 @@ def is_ipv4(target): """ Test if IPv4 address or not """ try: - chk = ipaddress.IPv4Address(target) - return True + chk = ipaddress.IPv4Address(target) + return True except ipaddress.AddressValueError: - return False + return False def in_ipv4net(target, net): """ Test if target belongs to given IPv4 network @@ -341,6 +341,6 @@ def should_bypass_proxies(url, no_proxy=None): if is_ipv4(parsed.hostname): for item in entries: - if in_ipv4net(parsed.hostname, item): - return True + if in_ipv4net(parsed.hostname, item): + return True return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} )