diff options
Diffstat (limited to 'modules/host_definitions/fedora_infra_hosts.py')
-rw-r--r-- | modules/host_definitions/fedora_infra_hosts.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/host_definitions/fedora_infra_hosts.py b/modules/host_definitions/fedora_infra_hosts.py new file mode 100644 index 0000000..6ac1878 --- /dev/null +++ b/modules/host_definitions/fedora_infra_hosts.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +import os + +def get(config,result): + for host in [ name for name in os.listdir(config["path"]) if os.path.isdir(os.path.join(config["path"], name)) ]: + if not result.has_key(host): + result[host] = dict() + path = os.path.join(config["path"], host, "autoinfo") + if os.path.exists(os.path.join(path, "datacenter")): + result[host]["datacenter"] = open(os.path.join(path, "datacenter"),"r").read() + if os.path.exists(os.path.join(path, "distro")): + result[host]["distro"] = open(os.path.join(path, "distro"),"r").read() + + return result |