Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
switch to fog-xenserver 1.x
Browse files Browse the repository at this point in the history
closes GH-60
  • Loading branch information
zozoh94 authored and mmoll committed Nov 11, 2018
1 parent dc20c3c commit 002fcf9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions app/models/foreman_xen/xenserver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,7 @@ def hypervisor
protected

def client
@client ||= ::Fog::Compute.new(
:provider => 'XenServer',
@client ||= Fog::XenServer::Compute.new(
:xenserver_url => url,
:xenserver_username => user,
:xenserver_password => password,
Expand Down
2 changes: 1 addition & 1 deletion foreman_xen.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.description = 'Provision and manage XEN Server from Foreman.'
s.licenses = ['GPL-3.0']

s.add_dependency 'fog-xenserver', '~> 0.2'
s.add_dependency 'fog-xenserver', '~> 1.0'
s.add_development_dependency('rake')

s.files = Dir['{app,config,db,lib,locale}/**/*', 'LICENSE', 'Rakefile', 'README.md']
Expand Down
4 changes: 2 additions & 2 deletions lib/foreman_xen/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ class Engine < ::Rails::Engine
config.to_prepare do
begin
# extend fog xen server and image models.
require 'fog/compute/xen_server/models/server'
require 'fog/xenserver/compute/models/server'
require File.expand_path('../../app/models/concerns/fog_extensions/xenserver/server', __dir__)
require File.expand_path('../../app/models/concerns/foreman_xen/host_helper_extensions', __dir__)

Fog::Compute::XenServer::Server.send(:include, ::FogExtensions::Xenserver::Server)
Fog::XenServer::Compute::Server.send(:include, ::FogExtensions::Xenserver::Server)
::HostsHelper.send(:include, ForemanXen::HostHelperExtensions)
rescue => e
Rails.logger.warn "Foreman-Xen: skipping engine hook (#{e})"
Expand Down

0 comments on commit 002fcf9

Please sign in to comment.