summaryrefslogtreecommitdiffstats
path: root/genome-bootstrap/lib
diff options
context:
space:
mode:
authorGreg Blomquist <gblomqui@gblomqui.usersys.redhat.com>2008-07-10 16:34:52 -0400
committerGreg Blomquist <gblomqui@gblomqui.usersys.redhat.com>2008-07-10 16:34:52 -0400
commit80dcc5209d17647f984d86a084a94cba0da57627 (patch)
treea3e2defe45611ba7ce67ba131642bf3d97c76b86 /genome-bootstrap/lib
parentc5a78be1a208fa0feda16608b0e7d477002f8820 (diff)
parenteb38db3f91d5a7fb1daf6da82fa8da3c0801c9f6 (diff)
downloadtools-80dcc5209d17647f984d86a084a94cba0da57627.tar.gz
tools-80dcc5209d17647f984d86a084a94cba0da57627.tar.xz
tools-80dcc5209d17647f984d86a084a94cba0da57627.zip
Merge branch 'master' of git://oss1-repo.usersys.redhat.com/pub/git/tools
Diffstat (limited to 'genome-bootstrap/lib')
-rw-r--r--genome-bootstrap/lib/genome-bootstrap/core.rb39
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 44616b8..28b7e61 100644
--- a/genome-bootstrap/lib/genome-bootstrap/core.rb
+++ b/genome-bootstrap/lib/genome-bootstrap/core.rb
@@ -119,38 +119,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