diff options
| author | Matthew Hicks <mhicks@mhicks-host.usersys.redhat.com> | 2008-06-25 19:21:31 -0400 |
|---|---|---|
| committer | Matthew Hicks <mhicks@mhicks-host.usersys.redhat.com> | 2008-06-25 19:23:32 -0400 |
| commit | ce1eb3835a4d36d40852d3787c2fb3e8b7c207c1 (patch) | |
| tree | 0b0fc6c7e17eaf7aa7e5a9fe36b72c3218cd03e1 | |
| parent | 73af53e154aa0c5adb13bef9313a982572857b84 (diff) | |
| download | tools-ce1eb3835a4d36d40852d3787c2fb3e8b7c207c1.tar.gz tools-ce1eb3835a4d36d40852d3787c2fb3e8b7c207c1.tar.xz tools-ce1eb3835a4d36d40852d3787c2fb3e8b7c207c1.zip | |
Fix to the distro lookup
| -rw-r--r-- | cloudmasterd/extra/cloudmasterd.spec | 2 | ||||
| -rw-r--r-- | cloudmasterd/lib/cloudmasterd.rb | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/cloudmasterd/extra/cloudmasterd.spec b/cloudmasterd/extra/cloudmasterd.spec index fd4bb40..894bcf4 100644 --- a/cloudmasterd/extra/cloudmasterd.spec +++ b/cloudmasterd/extra/cloudmasterd.spec @@ -6,7 +6,7 @@ Summary: Everest library and web application for managing cloud machines Name: rubygem-%{gemname} Version: 1.0.0 -Release: 1%{?dist} +Release: 2%{?dist} Group: Applications/System License: GPLv2 URL: https://fedorahosted.org/everest diff --git a/cloudmasterd/lib/cloudmasterd.rb b/cloudmasterd/lib/cloudmasterd.rb index ca92e57..64bd514 100644 --- a/cloudmasterd/lib/cloudmasterd.rb +++ b/cloudmasterd/lib/cloudmasterd.rb @@ -111,6 +111,12 @@ module Cloudmasterd::Controllers return cobblerd.profile(cobbler_system["profile"]) end + # Retrieve the cobbler distro for the given profile name + def _get_cobbler_distro(profile_name, repo) + cobblerd = Cloudmasterd::Helpers::Cobblerd.new(repo) + return cobblerd.distro(profile_name) + end + # Find the best host on which to create a VM def _get_best_host(ram, arch) return `func-find-resources -m #{ram} -a #{arch}`.chomp() @@ -121,7 +127,7 @@ module Cloudmasterd::Controllers def _koan(host, fqdn, repo) # Run the koan process output = `func "#{host}" call virt install #{repo} #{fqdn} True #{fqdn} /images` - + # Throw an exception if the process failed raise output unless $?.success? @@ -136,7 +142,7 @@ module Cloudmasterd::Controllers email = input.email cobbler_profile = _get_cobbler_profile(machine_fqdn, repo) - cobbler_distro = cobblerd.distro(cobbler_profile["distro"]) + cobbler_distro = _get_cobbler_distro(cobbler_profile["distro"], repo) # Synchronize access before making the func calls Syncer::lock do |
