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 socket
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from mylib.email import EmailClient
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -213,6 +211,7 @@ def add_email_opts(parser, config=None):
|
||||||
|
|
||||||
def init_email_client(options, **kwargs):
|
def init_email_client(options, **kwargs):
|
||||||
""" Initialize email client from calling script options """
|
""" Initialize email client from calling script options """
|
||||||
|
from mylib.email import EmailClient # pylint: disable=import-outside-toplevel
|
||||||
log.info('Initialize Email client')
|
log.info('Initialize Email client')
|
||||||
return EmailClient(
|
return EmailClient(
|
||||||
smtp_host=options.email_smtp_host,
|
smtp_host=options.email_smtp_host,
|
||||||
|
|
Loading…
Reference in a new issue