Path: | lib/ohai/plugins/rackspace.rb |
Last Update: | Tue May 11 18:27:37 +0000 2010 |
Author: | Cary Penniman (<cary@rightscale.com>) |
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
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.
Names rackspace ip address
name<Symbol>: | Use :public_ip or :private_ip |
eth<Symbol>: | Interface name of public or private ip |
# File lib/ohai/plugins/rackspace.rb, line 59 59: def get_ip_address(name, eth) 60: network[:interfaces][eth][:addresses].each do |key, info| 61: rackspace[name] = key if info['family'] == 'inet' 62: end 63: end
Checks for matching rackspace kernel name
true: | If kernel name matches |
false: | Otherwise |
# File lib/ohai/plugins/rackspace.rb, line 27 27: def has_rackspace_kernel? 28: kernel[:release].split('-').last.eql?("rscloud") 29: end
Checks for matching rackspace arp mac
true: | If mac address matches |
false: | Otherwise |
# File lib/ohai/plugins/rackspace.rb, line 36 36: def has_rackspace_mac? 37: network[:interfaces].values.each do |iface| 38: unless iface[:arp].nil? 39: return true if iface[:arp].value?("00:00:0c:07:ac:01") 40: end 41: end 42: false 43: end