def multi_stat_check(args, filename):
dict = {}
try:
with open(args.container + "/" + filename, "r") as f:
for line in f:
m = _STAT_RE.match(line)
if m:
dict[m.group(1)] = m.group(2)
except Exception, e:
if not os.path.isdir(args.container):
os.mkdir(args.container)
debug(args.container + ": could not get last stats from " + filename)
debug(str(e))
# first time running for this container create empty file
open(args.container + "/" + filename,"w").close()
return dict
discover.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录