diff options
author | Brenton Leanhardt <bleanhar@redhat.com> | 2008-07-10 12:41:14 -0400 |
---|---|---|
committer | Brenton Leanhardt <bleanhar@redhat.com> | 2008-07-10 14:02:53 -0400 |
commit | 0ba3c7f27eef796e38bb4fc8f3a46e03960c3fec (patch) | |
tree | 7af2211b0dfa52ad11c255f0a181bc8464fbe612 /genome-bootstrap/lib/genome-bootstrap | |
parent | 5932cefd0361d05b11c0141cc122d7498e0f1d75 (diff) | |
download | tools-0ba3c7f27eef796e38bb4fc8f3a46e03960c3fec.tar.gz tools-0ba3c7f27eef796e38bb4fc8f3a46e03960c3fec.tar.xz tools-0ba3c7f27eef796e38bb4fc8f3a46e03960c3fec.zip |
genome-bootstrap now calls cobbler directly to 'get_status'
Diffstat (limited to 'genome-bootstrap/lib/genome-bootstrap')
-rw-r--r-- | genome-bootstrap/lib/genome-bootstrap/core.rb | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/genome-bootstrap/lib/genome-bootstrap/core.rb b/genome-bootstrap/lib/genome-bootstrap/core.rb index 6a5c6c6..d228f5a 100644 --- a/genome-bootstrap/lib/genome-bootstrap/core.rb +++ b/genome-bootstrap/lib/genome-bootstrap/core.rb @@ -114,38 +114,21 @@ module GenomeBootstrap add_system_to_cobbler(machine_fqdn, config["parameters"], email) end - # Retrive information form the /var/log/cobbler/install.log - def get_installed_systems - systems = restr_get("#{@genomed}/systems.xml")[0] - return systems["system"].map do |system| - def system.name - self["name"].to_s + def get_system_ip(system_name, max_tries=1) + status = 1.upto(max_tries) do + # Technically the yield should be after the remote call, but it would + # trip up the 'find' + yield if block_given? + + data = @cobblerd.call2("get_status")[1].find do |ip, s| + s[2] == "system:%s" % system_name && s[5] =~ /^installing/ end - def system.ip - self["ip"].to_s - end - - def system.hostname - self["hostname"].to_s - end - system + # This returns from the block + break data unless data.nil? end - end - - def get_installed_system(system_name) - systems = get_installed_systems.delete_if{|system| - system.name != system_name.to_s - } - return systems.empty? ? {} : systems[0] - end - - def cobbler_dns? - return false - end - - def register_dns_entry(ip, name) + return status.nil? ? nil : status[0] end # This is a workaround for a Restr "feature". If only one element it is |