Sha256: ac5fac567be5a3187b4193d240c5d7517d4be632f4e605474c4c3cf17f309a04
Contents?: true
Size: 1.65 KB
Versions: 9
Compression:
Stored size: 1.65 KB
Contents
# This file is part of the OpenStack-ActiveResource # # Copyright (C) 2012 Unidata S.p.A. (Davide Guerri - d.guerri@unidata.it) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. module OpenStack module Nova module Compute class Base < OpenStack::Common # The following 2 methods overloading are required for Rails applications # Get the Nova Compute endpoint assigned to OpenStack::Nova::Compute classes def self.site if self == OpenStack::Nova::Compute::Base Thread.current[:open_stack_nova_compute_site] else super end end # Set the Nova Compute endpoint for OpenStack::Nova::Compute classes def self.site=(site) super(site) Thread.current[:open_stack_nova_compute_site] = @site # Regenerate the prefix method default = @site.path default << '/' unless default[-1..-1] == '/' # generate the actual method based on the current site path self.prefix = default @site end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems