diff options
-rw-r--r-- | cloudmasterd/extra/cloudmasterd.spec | 2 | ||||
-rw-r--r-- | cloudmasterd/lib/cloudmasterd.rb | 8 | ||||
-rw-r--r-- | genome-bootstrap/bin/genome-bootstrap | 42 | ||||
-rw-r--r-- | genome-bootstrap/extra/genome-bootstrap.spec | 2 | ||||
-rw-r--r-- | genome-bootstrap/lib/genome-bootstrap/core.rb | 39 | ||||
-rw-r--r-- | genome-styling/genome-styling.spec | 7 | ||||
-rw-r--r-- | genome-styling/repo/genome-mainbg.png | bin | 0 -> 334 bytes | |||
-rw-r--r-- | genome-styling/repo/genome-mainbgcurve.png | bin | 0 -> 214 bytes | |||
-rw-r--r-- | genome-styling/repo/glogo.gif | bin | 0 -> 1585 bytes | |||
-rw-r--r-- | genome-styling/repo/logoMountain.png | bin | 34320 -> 0 bytes | |||
-rw-r--r-- | genome-styling/repo/styles.css | 119 | ||||
-rw-r--r-- | genome-styling/repo/topbg.png | bin | 665 -> 0 bytes | |||
-rw-r--r-- | genomed/extra/genomed.spec | 2 | ||||
-rw-r--r-- | genomed/lib/genomed.rb | 18 |
14 files changed, 135 insertions, 104 deletions
diff --git a/cloudmasterd/extra/cloudmasterd.spec b/cloudmasterd/extra/cloudmasterd.spec index 50a519a..a1e30e7 100644 --- a/cloudmasterd/extra/cloudmasterd.spec +++ b/cloudmasterd/extra/cloudmasterd.spec @@ -6,7 +6,7 @@ Summary: Genome library and web application for managing cloud machines Name: rubygem-%{gemname} Version: 1.0.0 -Release: 4%{?dist} +Release: 5%{?dist} Group: Applications/System License: GPLv2 URL: https://fedorahosted.org/genome diff --git a/cloudmasterd/lib/cloudmasterd.rb b/cloudmasterd/lib/cloudmasterd.rb index 4386084..33c094f 100644 --- a/cloudmasterd/lib/cloudmasterd.rb +++ b/cloudmasterd/lib/cloudmasterd.rb @@ -236,8 +236,12 @@ module Cloudmasterd::Views div.header! do div.headerLogo! {} end - div.content! do - self << yield + div.body! do + div.content! do + div.inner! do + self << yield + end + end end end end diff --git a/genome-bootstrap/bin/genome-bootstrap b/genome-bootstrap/bin/genome-bootstrap index 0a25ba5..9deab7e 100644 --- a/genome-bootstrap/bin/genome-bootstrap +++ b/genome-bootstrap/bin/genome-bootstrap @@ -20,6 +20,22 @@ Main { say("<%= color(\"#{text}\", :red) %>") end + # It's a little silly to have this much indirection. Smells like things need + # to be refactored a bit. + def get_system_ip(repo, system_name) + sleep_time = 5 + tries = 10 + + say("Trying to determine the ip address.") + say("We'll try and maximum of #{tries} times.") + repo.get_system_ip(system_name, tries) do + # It's really silly that we have to poll for the ip like this. + say("Polling for cobbler status...") + say("Retrying in #{sleep_time} seconds") + sleep sleep_time + end + end + def get_input @facts = Hash.new @@ -99,20 +115,10 @@ Main { unless config_only cloud_master = CloudController.new(@cloudmaster, @genome_repo) host = cloud_master.create_machine(@system_name, @email) - if @genome_repo.cobbler_dns? - @genome_repo.register_dns_entry - end - installed_system = @genome_repo.get_installed_system(@system_name) - if not installed_system.empty? - if @genome_repo.cobbler_dns? - # register the new system with cobbler dns using the name, - # the installed_system's IP - end - fqdn = installed_system["hostname"] + if ip = get_system_ip(@genome_repo, @system_name) say("Your new system is being provisioned on #{host}.") - say("The FQDN of new system is #{fqdn}.") - say("The IP address of the new system is #{installed_system["ip"]}.") + say("The IP address of the new system is #{ip}.") else say("Your new system is being provisioned on #{host}.") say("You can visit #{@cloudmaster.cloud} to see the status of the new system.") @@ -193,17 +199,9 @@ Main { cloud_master = CloudController.new(params['cloudmaster'].value, genome_repo) host = cloud_master.create_machine(name, params['email'].value) - installed_system = genome_repo.get_installed_system(name) - if not installed_system.empty? - if genome_repo.cobbler_dns? and params['fqdn'].given? - # register the new system with cobbler dns using the name, - # the installed_system's IP, and the given fqdn - else - fqdn = installed_system["hostname"] - end + if ip = get_system_ip(genome_repo, name) say("Your new system is being provisioned on #{host}.") - say("The FQDN of new system is #{fqdn}.") - say("The IP address of the new system is #{installed_system["ip"]}.") + say("The IP address of the new system is #{ip}.") else say("Your new system is being provisioned on #{host}.") say("You can visit #{cloud_master.cloud} to see the status of the new system.") diff --git a/genome-bootstrap/extra/genome-bootstrap.spec b/genome-bootstrap/extra/genome-bootstrap.spec index 71b4d1c..ca114bd 100644 --- a/genome-bootstrap/extra/genome-bootstrap.spec +++ b/genome-bootstrap/extra/genome-bootstrap.spec @@ -7,7 +7,7 @@ Summary: Tool for provisioning virtual machines Name: rubygem-%{gemname} Version: 1.0.0 -Release: 3%{?dist} +Release: 4%{?dist} Group: Development/Languages License: Ruby License/GPL Source0: %{gemname}-%{version}.gem 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 diff --git a/genome-styling/genome-styling.spec b/genome-styling/genome-styling.spec index 1531847..4bb497d 100644 --- a/genome-styling/genome-styling.spec +++ b/genome-styling/genome-styling.spec @@ -2,7 +2,7 @@ Summary: Genome CSS Styles Name: genome-styling Source: genome-styling-bin.tar.gz Version: 1.0.0 -Release: 2 +Release: 4 BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Group: Applications/System @@ -34,7 +34,8 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) /var/www/html/styles.css -/var/www/html/logoMountain.png -/var/www/html/topbg.png +/var/www/html/genome-mainbgcurve.png +/var/www/html/genome-mainbg.png +/var/www/html/glogo.gif %doc diff --git a/genome-styling/repo/genome-mainbg.png b/genome-styling/repo/genome-mainbg.png Binary files differnew file mode 100644 index 0000000..bc20f72 --- /dev/null +++ b/genome-styling/repo/genome-mainbg.png diff --git a/genome-styling/repo/genome-mainbgcurve.png b/genome-styling/repo/genome-mainbgcurve.png Binary files differnew file mode 100644 index 0000000..fd5d180 --- /dev/null +++ b/genome-styling/repo/genome-mainbgcurve.png diff --git a/genome-styling/repo/glogo.gif b/genome-styling/repo/glogo.gif Binary files differnew file mode 100644 index 0000000..482f026 --- /dev/null +++ b/genome-styling/repo/glogo.gif diff --git a/genome-styling/repo/logoMountain.png b/genome-styling/repo/logoMountain.png Binary files differdeleted file mode 100644 index 4960f14..0000000 --- a/genome-styling/repo/logoMountain.png +++ /dev/null diff --git a/genome-styling/repo/styles.css b/genome-styling/repo/styles.css index 90d6b63..13caf6b 100644 --- a/genome-styling/repo/styles.css +++ b/genome-styling/repo/styles.css @@ -1,23 +1,6 @@ -body, html { - margin: 0; - padding: 0; -} - -body { - min-width: 800px; -} - -img { - border: none; -} - -ul, li, p, h1, h2, h3 { - font-family: Verdana,Arial,Helvetica,sans-serif; - color: #777777; -} - body { - color: #777777; + background: #CCDCF4 url(genome-mainbg.png) repeat-x scroll left top; + color: #444444; font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 14px; left: 0px; @@ -44,32 +27,99 @@ table td { } -a:link { - color: #0066CC; +a:link, a:visited, a:active { + color:#1E3F76; + text-decoration:none; +} + +h1 { + color:#222222; + font-size:190%; + margin-top:0pt; + padding-top:0pt; } -a:visited { - color: #6699CC; +h2 { + color:#333333; + font-size:140%; +} + +h3 { + color:#333333; + font-size:120%; +} + +#body { + border: 0px none; + float: left; + left: 0px; + margin: 0px; + width: 100%; } #header { - background:transparent url(topbg.png) repeat-x scroll left top; - border:0px none; height:89px; - margin:0px 0px 20px; + margin-bottom: 12px; width:100%; } #headerLogo { - background:transparent url(logoMountain.png) no-repeat scroll left top; + background:transparent url(glogo.gif) no-repeat scroll 20px 30px; height:89px; margin:0pt; padding:0pt; width:585px; } -div#content { - padding: 0px 20px; +#nav_menu { + float: left; + margin-bottom: 1em; + width: 205px; +} + +#nav_menu ul { + margin: 30px 0pt 0pt 23px; + padding: 1px 0pt; +} + +#nav_menu ul li { + list-style-type:none; + margin-left:0pt; + padding:2px 0pt; +} + +#nav_menu ul li { + color:#486AA3; + font-size:1.2em; + font-weight:bold; + list-style-image:none; + list-style-position:outside; + list-style-type:none; + padding:3px 0pt; +} + +#nav_menu ul li a.active { + color:#0059B3; +} + +#nav_menu ul li a:link, #nav-menu ul li a:visited, #nav-menu ul li a:active { + text-decoration:none; +} + +#nav_menu ul li a:hover { + color:#0059B3; + text-decoration:underline; +} + +#content { + background: #FFFFFF url(genome-mainbgcurve.png) no-repeat scroll left top; + margin-left: 200px; + padding: 0pt 50px 65px 0pt; +} + +#inner { + padding: 35px 30px; + min-height: 400px; } div.user { @@ -85,17 +135,6 @@ div#machines { border-bottom: 1px solid #0664FE; } -div#content h1 { - font-size: x-large; - font-weight: normal; -} - -div#content h2 { - font-size: large; - font-weight: 900; - text-transform: uppercase; -} - div#machines h2 { font-size: medium; font-weight: 900; diff --git a/genome-styling/repo/topbg.png b/genome-styling/repo/topbg.png Binary files differdeleted file mode 100644 index e3853b8..0000000 --- a/genome-styling/repo/topbg.png +++ /dev/null diff --git a/genomed/extra/genomed.spec b/genomed/extra/genomed.spec index b6b4183..df803a8 100644 --- a/genomed/extra/genomed.spec +++ b/genomed/extra/genomed.spec @@ -7,7 +7,7 @@ Summary: Genome Repository daemon for machine configuration Name: rubygem-%{gemname} Version: 1.0.0 -Release: 6%{?dist} +Release: 7%{?dist} Group: Applications/System License: GPLv2+ URL: http://fedorahosted.org/genome diff --git a/genomed/lib/genomed.rb b/genomed/lib/genomed.rb index 3a1705e..f78180c 100644 --- a/genomed/lib/genomed.rb +++ b/genomed/lib/genomed.rb @@ -186,13 +186,19 @@ module Genomed::Views div.header! do div.headerLogo! {} end - div.content! do - h1 do - [a("Machine Types", :href => CONTEXT + R(Genomed::Controllers::MachineTypes)), - a("Nodes", :href => CONTEXT + R(Genomed::Controllers::Nodes)), - a("Systems", :href => CONTEXT + R(Genomed::Controllers::Systems))].join " | " + div.body! do + div.nav_menu! do + ul do + li { a("Machine Types", :href => CONTEXT + R(Genomed::Controllers::MachineTypes)) } + li { a("Nodes", :href => CONTEXT + R(Genomed::Controllers::Nodes)) } + li { a("Systems", :href => CONTEXT + R(Genomed::Controllers::Systems)) } + end + end + div.content! do + div.inner! do + self << yield + end end - self << yield end end end |