Path: | lib/ohai/plugins/eucalyptus.rb |
Last Update: | Thu Jan 17 19:03:16 +0000 2013 |
Author: | Tim Dysinger (<tim@dysinger.net>) |
Author: | Benjamin Black (<bb@opscode.com>) |
Author: | Christopher Brown (<cb@opscode.com>) |
Copyright: | Copyright (c) 2009 Opscode, Inc. |
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.
# File lib/ohai/plugins/eucalyptus.rb, line 30 30: def get_mac_address(addresses) 31: detected_addresses = addresses.detect { |address, keypair| keypair == {"family"=>"lladdr"} } 32: if detected_addresses 33: return detected_addresses.first 34: else 35: return "" 36: end 37: end
# File lib/ohai/plugins/eucalyptus.rb, line 39 39: def has_euca_mac? 40: network[:interfaces].values.each do |iface| 41: has_mac = (get_mac_address(iface[:addresses]) =~ /^[dD]0:0[dD]:/) 42: Ohai::Log.debug("has_euca_mac? == #{!!has_mac}") 43: return true if has_mac 44: end 45: 46: Ohai::Log.debug("has_euca_mac? == false") 47: false 48: end