Init
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import yaml
|
||||
import logging
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
def load_yaml(file):
|
||||
try:
|
||||
stram = open(file, "r")
|
||||
yaml_data = yaml.load(stram)
|
||||
return yaml_data
|
||||
except Exception as e:
|
||||
raise
|
||||
_LOGGER.error("Can't load yaml with sids %r (%r)" % (file, e))
|
||||
|
||||
def get_gateway_password(config, ip=""):
|
||||
if (config == None):
|
||||
raise "Config is null"
|
||||
configGateway = config.get("gateway", None)
|
||||
if (configGateway == None):
|
||||
raise "Config gateway is null"
|
||||
password = configGateway.get("password", None)
|
||||
if (password == None):
|
||||
raise "Config gateway passowrd is null"
|
||||
return password
|
||||
Reference in New Issue
Block a user