TechDebt - remove print statements (#5571)

This commit is contained in:
Bert Blommers 2022-10-16 20:31:19 +00:00 committed by GitHub
parent 047c1a6b7e
commit 43a3fecbd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 12 deletions

View File

@ -57,8 +57,6 @@ class AppSyncResponse(BaseResponse):
def tags(self, request: Any, full_url: str, headers: Any) -> TYPE_RESPONSE: # type: ignore[return] def tags(self, request: Any, full_url: str, headers: Any) -> TYPE_RESPONSE: # type: ignore[return]
self.setup_class(request, full_url, headers) self.setup_class(request, full_url, headers)
print("tags")
print(request.method)
if request.method == "POST": if request.method == "POST":
return self.tag_resource() return self.tag_resource()
if request.method == "DELETE": if request.method == "DELETE":

View File

@ -25,10 +25,7 @@ class BatchResponse(BaseResponse):
if self.body is None or self.body == "": if self.body is None or self.body == "":
self._json = {} self._json = {}
elif not hasattr(self, "_json"): elif not hasattr(self, "_json"):
try:
self._json = json.loads(self.body) self._json = json.loads(self.body)
except ValueError:
print()
return self._json return self._json
def _get_param(self, param_name, if_none=None): def _get_param(self, param_name, if_none=None):

View File

@ -25,7 +25,7 @@ class ThreadedMotoServer:
def start(self): def start(self):
if self._verbose: if self._verbose:
print( print( # noqa
f"Starting a new Thread with MotoServer running on {self._ip_address}:{self._port}..." f"Starting a new Thread with MotoServer running on {self._ip_address}:{self._port}..."
) )
self._thread = Thread(target=self._server_entry, daemon=True) self._thread = Thread(target=self._server_entry, daemon=True)

View File

@ -78,7 +78,7 @@ class DomainDispatcherApplication(object):
return backend return backend
if "amazonaws.com" in host: if "amazonaws.com" in host:
print( print( # noqa
"Unable to find appropriate backend for {}." "Unable to find appropriate backend for {}."
"Remember to add the URL to urls.py, and run scripts/update_backend_index.py to index it.".format( "Remember to add the URL to urls.py, and run scripts/update_backend_index.py to index it.".format(
host host

View File

@ -118,15 +118,15 @@ def get_docker_host():
else: else:
_ip = network_settings["IPAddress"] _ip = network_settings["IPAddress"]
if network_name: if network_name:
print( print( # noqa
f"WARNING - Moto couldn't find network '{network_name}' - defaulting to {_ip}" f"WARNING - Moto couldn't find network '{network_name}' - defaulting to {_ip}"
) )
return f"http://{_ip}" return f"http://{_ip}"
except Exception as e: # noqa except Exception as e: # noqa
print( print( # noqa
"WARNING - Unable to parse Docker API response. Defaulting to 'host.docker.internal'" "WARNING - Unable to parse Docker API response. Defaulting to 'host.docker.internal'"
) )
print(f"{type(e)}::{e}") print(f"{type(e)}::{e}") # noqa
return "http://host.docker.internal" return "http://host.docker.internal"

View File

@ -56,7 +56,7 @@ class MockXrayClient:
return wrapped_f return wrapped_f
def start(self): def start(self):
print("Starting X-Ray Patch") print("Starting X-Ray Patch") # noqa
self.old_xray_context_var = os.environ.get("AWS_XRAY_CONTEXT_MISSING") self.old_xray_context_var = os.environ.get("AWS_XRAY_CONTEXT_MISSING")
os.environ["AWS_XRAY_CONTEXT_MISSING"] = "LOG_ERROR" os.environ["AWS_XRAY_CONTEXT_MISSING"] = "LOG_ERROR"
self.old_xray_context = aws_xray_sdk.core.xray_recorder._context self.old_xray_context = aws_xray_sdk.core.xray_recorder._context

View File

@ -3,6 +3,7 @@
black==22.3.0 black==22.3.0
flake8==4.0.1 flake8==4.0.1
flake8-print
click click
inflection inflection
lxml lxml