Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Bug 997129 - oo-last-access script chokes on /etc/openshift/node.conf…
Browse files Browse the repository at this point in the history
… with only space in configuration line
  • Loading branch information
brenton committed Aug 14, 2013
1 parent e609bec commit e2bba77
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions node-util/bin/oo-last-access
Expand Up @@ -17,6 +17,7 @@

require 'fileutils'
require 'date'
require 'openshift-origin-common/config'

class LastAccessUpdater
def initialize(app_root_dir, access_log_files)
Expand Down Expand Up @@ -135,17 +136,10 @@ class LastAccessUpdater
end

def source_file(file)
IO.foreach(file) { |line|
next if line =~ /^#/
next if line =~ /^$/
if line.include?"#"
name,value = line.split("#")[0].split("=")
else
name,value = line.strip.split[0].split("=")
end
next if name.nil? or value.nil?
ENV["#{name}"]=value.gsub('"','').strip
}
config = OpenShift::Config.new
config.params.each do |p|
ENV["#{p}"] = config.get(p)
end
end

# Cool trick from ruby-forum
Expand Down

0 comments on commit e2bba77

Please sign in to comment.