def GetConfigFileContents( url ):
fc=None
scheme, netloc, path, params, query, fragment = urlparse.urlparse(url)
if scheme == "file":
try:
f = open(path,'r')
fc=""
for line in f:
fc += line
f.close()
except:
fc=None
elif scheme == "sca":
fc=GetSCAFileContents(url)
elif scheme == "http":
fc=GetHTTPFileContents(url)
elif scheme == "str":
## RESOLVE
if path.startswith("/"):
fc=path[1:]
else:
fc=path
pass
else:
# Invalid scheme
logging.warning("Invalid logging config URI scheme")
return fc
评论列表
文章目录