From 54d732a0602e12170a59ba464eb37adbc76e90aa Mon Sep 17 00:00:00 2001 From: William Wernert Date: Tue, 10 Nov 2020 10:01:10 -0500 Subject: [PATCH] [refactor] Code cleanup --- salt/_modules/so.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/salt/_modules/so.py b/salt/_modules/so.py index de337c43f..9a3706c78 100644 --- a/salt/_modules/so.py +++ b/salt/_modules/so.py @@ -9,12 +9,13 @@ def status(): def mysql_conn(retry): log = logging.getLogger(__name__) + from time import sleep + try: from MySQLdb import _mysql except ImportError as e: log.error(e) return False - from time import sleep mainint = __salt__['pillar.get']('sensor:mainint', __salt__['pillar.get']('manager:mainint')) mainip = __salt__['grains.get']('ip_interfaces').get(mainint)[0]