mylib.script.helpers: move email stuff import to helper function to avoid global requirement
This commit is contained in:
parent
b27cae5b1e
commit
51dd4f5724
1 changed files with 1 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue