Chapter 09/circuit-oneops-1-master/components/cookbooks/cassandra/libraries/cassandra_util.rb
# Returns hash of the key, value pairs from the propery file
Returns hash of the key, value pairs from the propery file
Returns hash of the key value pairs from the propery file
def load_properties(properties_filename)
      properties = {}
      File.open(properties_filename, 'r') do |properties_file|
        properties_file.read.each_line do |line|
          line.strip!
          if (line[0] != ?# and line[0] != ?=)
            Chef::Log.info "line : #{line}"
            i = line.index('=')
            if (i)
              properties[line[0..i - 1].strip] = line[i + 1..-1].strip
            end
          end
        end
      end
      return properties
   end
def load_properties ( properties_filename ) properties = { } File . open ( properties_filename , 'r' ) do | properties_file | properties_file . read . each_line do | line | line . strip! if ( line [ 0 ] != ?# and line [ 0 ] != ?= ) Chef :: Log . info "line : #{line}" i = line . index ( '=' ) if ( i ) properties [ line [ 0 .. i - 1 ] . strip ] = line [ i + 1 .. - 1 ] . strip end end end end return properties end
Returns hash of the key, value pairs from the propery file
Returns hash of the key value pairs from the propery file
properties_filename
<not_specific>