mylib.script.helpers: move email stuff import to helper function to avoid global requirement

This commit is contained in:
Benjamin Renard 2021-06-23 12:59:48 +02:00
parent b27cae5b1e
commit 51dd4f5724

View file

@ -8,8 +8,6 @@ import logging
import socket
import sys
from mylib.email import EmailClient
log = logging.getLogger(__name__)
@ -213,6 +211,7 @@ def add_email_opts(parser, config=None):
def init_email_client(options, **kwargs):
""" Initialize email client from calling script options """
from mylib.email import EmailClient # pylint: disable=import-outside-toplevel
log.info('Initialize Email client')
return EmailClient(
smtp_host=options.email_smtp_host,