MotoServer - deprecate server-argument (#5891)

This commit is contained in:
Bert Blommers 2023-02-02 11:45:49 -01:00 committed by GitHub
parent 985bf4f5a9
commit 4ed8b93e18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,8 @@ import argparse
import os
import signal
import sys
import warnings
from werkzeug.serving import run_simple
from moto.moto_server.werkzeug_app import (
@ -70,6 +72,11 @@ def main(argv=None):
except Exception:
pass # ignore "ValueError: signal only works in main thread"
if args.service:
warnings.warn(
f"The service-argument ({args.service}) is considered deprecated, and will be deprecated in a future release. Please let us know if you have any questions: https://github.com/getmoto/moto/issues"
)
# Wrap the main application
main_app = DomainDispatcherApplication(create_backend_app, service=args.service)
main_app.debug = True