Compare commits

..

No commits in common. "f573e542cd76038c80afd7db122926de59b0469c" and "75a75dac55757de178501bb3600e59bc1f430e1f" have entirely different histories.

2 changed files with 5 additions and 6 deletions

6
app.py
View File

@ -36,9 +36,9 @@ def create_app() -> FastAPI:
loading_router_middleware(app)
if settings.PROJECT.DEBUG:
logger.info("Application started successfully:{}".format(CORSMiddleware.__name__))
logger.info(f"Server address http://127.0.0.1:{settings.PROJECT.PORT}")
logger.info(f"Api doc address http://127.0.0.1:{settings.PROJECT.PORT}{settings.SWAGGER.DOCS_URL}")
logger.info(f"Api redoc address http://127.0.0.1:{settings.PROJECT.PORT}{settings.SWAGGER.REDOC_URL}")
logger.info(f"Server address http://{host}:{settings.PROJECT.PORT}")
logger.info(f"Api doc address http://{host}:{settings.PROJECT.PORT}{settings.SWAGGER.DOCS_URL}")
logger.info(f"Api redoc address http://{host}:{settings.PROJECT.PORT}{settings.SWAGGER.REDOC_URL}")
return app

View File

@ -4,7 +4,6 @@
# @Author :qiangyanwen
# @File :ssh_client.py
import paramiko
from config.log import logger
class SSHConnection(object):
@ -18,7 +17,7 @@ class SSHConnection(object):
self._client = None
def __enter__(self):
logger.info("ssh开始创建链接")
print("客户端开始创建连接.....")
transport = paramiko.Transport((self._host, self._port))
transport.connect(username=self._username, password=self._password)
self._transport = transport
@ -53,7 +52,7 @@ class SSHConnection(object):
self._transport.close()
if self._client:
self._client.close()
logger.info("ssh 关闭连接")
print("客户端关闭已成功.....")
with SSHConnection("47.96.135.132", 22, "root", "Qyw1994@520") as ssh: