diff --git a/src/onedb/1.rb b/src/onedb/1.rb index 73855b9f7c..c5134be9b5 100644 --- a/src/onedb/1.rb +++ b/src/onedb/1.rb @@ -1,17 +1,17 @@ -# -------------------------------------------------------------------------- */ +# -------------------------------------------------------------------------- * # Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # -# 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 */ -# */ -# 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. */ -# -------------------------------------------------------------------------- */ +# 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 * +# * +# 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. * +# -------------------------------------------------------------------------- * require "rexml/document" diff --git a/src/onedb/onedb b/src/onedb/onedb index 78edbdaa5e..5c5c0097d6 100755 --- a/src/onedb/onedb +++ b/src/onedb/onedb @@ -16,16 +16,20 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -ONE_LOCATION=ENV["ONE_LOCATION"] +ONE_LOCATION = ENV["ONE_LOCATION"] if !ONE_LOCATION - RUBY_LIB_LOCATION="/usr/lib/one/ruby" - ETC_LOCATION="/etc/one/" - VAR_LOCATION="/var/lib/one" + LIB_LOCATION = "/usr/lib/one" + RUBY_LIB_LOCATION = LIB_LOCATION + "/ruby" + VAR_LOCATION = "/var/lib/one" + ETC_LOCATION = "/etc/one" + LOCK_FILE = "/var/lock/one/one" else - RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" - ETC_LOCATION=ONE_LOCATION+"/etc/" - VAR_LOCATION="#{ONE_LOCATION}/var" + LIB_LOCATION = ONE_LOCATION + "/lib" + RUBY_LIB_LOCATION = LIB_LOCATION + "/ruby" + VAR_LOCATION = ONE_LOCATION + "/var" + ETC_LOCATION = ONE_LOCATION + "/etc" + LOCK_FILE = VAR_LOCATION + "/.lock" end $: << RUBY_LIB_LOCATION diff --git a/src/onedb/onedb.rb b/src/onedb/onedb.rb index a0240770ee..e071834a6c 100644 --- a/src/onedb/onedb.rb +++ b/src/onedb/onedb.rb @@ -1,18 +1,18 @@ -ONE_LOCATION = ENV["ONE_LOCATION"] - -if !ONE_LOCATION - LIB_LOCATION = "/usr/lib/one" - RUBY_LIB_LOCATION = LIB_LOCATION + "/ruby" - VAR_LOCATION = "/var/lib/one" - ETC_LOCATION = "/etc/one" - LOCK_FILE = "/var/lock/one/one" -else - LIB_LOCATION = ONE_LOCATION + "/lib" - RUBY_LIB_LOCATION = LIB_LOCATION + "/ruby" - VAR_LOCATION = ONE_LOCATION + "/var" - ETC_LOCATION = ONE_LOCATION + "/etc" - LOCK_FILE = VAR_LOCATION + "/.lock" -end +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# 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 # +# # +# 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. # +#--------------------------------------------------------------------------- # require 'cloud/Configuration' require 'onedb_backend' diff --git a/src/onedb/onedb_backend.rb b/src/onedb/onedb_backend.rb index 4b8ee4a030..8a249286dc 100644 --- a/src/onedb/onedb_backend.rb +++ b/src/onedb/onedb_backend.rb @@ -1,3 +1,19 @@ +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# 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 # +# # +# 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. # +#--------------------------------------------------------------------------- # + require 'rubygems' require 'sequel'