def zone_list(module, base_url, zone=None):
''' Return list of existing zones '''
list = []
url = "{0}".format(base_url)
response, info = fetch_url(module, url, headers=headers)
if info['status'] != 200:
module.fail_json(msg="failed to enumerate zones at %s: %s" % (url, info['msg']))
content = response.read()
data = json.loads(content)
for z in data:
if zone is None or fnmatch.fnmatch(z['name'], zone):
list.append({
'name' : z['name'],
'kind' : z['kind'].lower(),
'serial' : z['serial'],
})
return list
pdns_zone.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录