diff options
Diffstat (limited to 'lib/chef/platform.rb')
-rw-r--r-- | lib/chef/platform.rb | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/lib/chef/platform.rb b/lib/chef/platform.rb index 4114d5960b..d3e7db60e6 100644 --- a/lib/chef/platform.rb +++ b/lib/chef/platform.rb @@ -1,22 +1,20 @@ # # Author:: Adam Jacob (<adam@hjksolutions.com>) # Copyright:: Copyright (c) 2008 HJK Solutions, LLC -# License:: GNU General Public License version 2 or later -# -# This program and entire repository is free software; you can -# redistribute it and/or modify it under the terms of the GNU -# General Public License as published by the Free Software -# Foundation; either version 2 of the License, or any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# http://www.apache.org/licenses/LICENSE-2.0 # +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Dir[File.join(File.dirname(__FILE__), 'provider/**/*.rb')].sort.each { |lib| require lib } require File.join(File.dirname(__FILE__), 'mixin', 'params_validate') @@ -87,7 +85,7 @@ class Chef end end - def find_provider_for_node(node, resource_type) + def find_platform_and_version(node) platform = nil version = nil if node.attribute?("lsbdistid") @@ -108,6 +106,11 @@ class Chef end raise ArgumentError, "Cannot find a version for #{node}" unless version + return platform, version + end + + def find_provider_for_node(node, resource_type) + platform, version = find_platform_and_version(node) provider = find_provider(platform, version, resource_type) end |