Revamp config parsing and imports
Brings sanity to the passing of the config variable around the various submodules for use in the ZKConnection decorator.
This commit is contained in:
@ -22,24 +22,11 @@
|
||||
import psycopg2
|
||||
import psycopg2.extras
|
||||
|
||||
from distutils.util import strtobool as dustrtobool
|
||||
from pvcapid.Daemon import config
|
||||
|
||||
import daemon_lib.common as pvc_common
|
||||
import daemon_lib.ceph as pvc_ceph
|
||||
|
||||
config = None # Set in this namespace by flaskapi
|
||||
|
||||
|
||||
def strtobool(stringv):
|
||||
if stringv is None:
|
||||
return False
|
||||
if isinstance(stringv, bool):
|
||||
return bool(stringv)
|
||||
try:
|
||||
return bool(dustrtobool(stringv))
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
#
|
||||
# Exceptions (used by Celery tasks)
|
||||
|
Reference in New Issue
Block a user