From 529591f772047c686464eec866bb6869f217a850 Mon Sep 17 00:00:00 2001 From: geemus Date: Mon, 29 Aug 2011 10:24:39 -0500 Subject: [PATCH] [compute|libvirt] move libvirt compute to its own shared area (namespacing should probably be corrected) --- lib/fog/compute.rb | 6 +++--- lib/fog/{providers => }/libvirt.rb | 2 +- lib/fog/{compute/libvirt.rb => libvirt/compute.rb} | 4 ++-- .../models/libvirt => libvirt/models/compute}/README.md | 0 .../models/libvirt => libvirt/models/compute}/interface.rb | 0 .../models/libvirt => libvirt/models/compute}/interfaces.rb | 2 +- .../models/libvirt => libvirt/models/compute}/network.rb | 2 +- .../models/libvirt => libvirt/models/compute}/networks.rb | 2 +- .../models/libvirt => libvirt/models/compute}/node.rb | 0 .../models/libvirt => libvirt/models/compute}/nodes.rb | 2 +- .../models/libvirt => libvirt/models/compute}/pool.rb | 0 .../models/libvirt => libvirt/models/compute}/pools.rb | 2 +- .../models/libvirt => libvirt/models/compute}/server.rb | 2 +- .../models/libvirt => libvirt/models/compute}/servers.rb | 2 +- .../models/compute}/templates/network.xml.erb | 0 .../models/compute}/templates/pool.xml.erb | 0 .../models/compute}/templates/server.xml.erb | 0 .../models/compute}/templates/volume.xml.erb | 0 .../models/libvirt => libvirt/models/compute}/uri.rb | 0 .../models/libvirt => libvirt/models/compute}/util.rb | 0 .../models/libvirt => libvirt/models/compute}/volume.rb | 2 +- .../models/libvirt => libvirt/models/compute}/volumes.rb | 2 +- lib/fog/providers.rb | 3 +-- 23 files changed, 16 insertions(+), 17 deletions(-) rename lib/fog/{providers => }/libvirt.rb (67%) rename lib/fog/{compute/libvirt.rb => libvirt/compute.rb} (96%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/README.md (100%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/interface.rb (100%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/interfaces.rb (97%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/network.rb (96%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/networks.rb (97%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/node.rb (100%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/nodes.rb (96%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/pool.rb (100%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/pools.rb (97%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/server.rb (99%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/servers.rb (98%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/templates/network.xml.erb (100%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/templates/pool.xml.erb (100%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/templates/server.xml.erb (100%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/templates/volume.xml.erb (100%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/uri.rb (100%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/util.rb (100%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/volume.rb (99%) rename lib/fog/{compute/models/libvirt => libvirt/models/compute}/volumes.rb (98%) diff --git a/lib/fog/compute.rb b/lib/fog/compute.rb index ea765f881..77b7fcc06 100644 --- a/lib/fog/compute.rb +++ b/lib/fog/compute.rb @@ -23,6 +23,9 @@ module Fog when :gogrid require 'fog/go_grid/compute' Fog::Compute::GoGrid.new(attributes) + when :libvirt + require 'fog/libvirt/compute' + Fog::Compute::Libvirt.new(attributes) when :linode require 'fog/linode/compute' Fog::Compute::Linode.new(attributes) @@ -47,9 +50,6 @@ module Fog when :virtualbox require 'fog/virtual_box/compute' Fog::Compute::VirtualBox.new(attributes) - when :libvirt - require 'fog/compute/libvirt' - Fog::Compute::Libvirt.new(attributes) when :voxel require 'fog/voxel/compute' Fog::Compute::Voxel.new(attributes) diff --git a/lib/fog/providers/libvirt.rb b/lib/fog/libvirt.rb similarity index 67% rename from lib/fog/providers/libvirt.rb rename to lib/fog/libvirt.rb index eb567a1b6..8332d9421 100644 --- a/lib/fog/providers/libvirt.rb +++ b/lib/fog/libvirt.rb @@ -5,7 +5,7 @@ module Fog extend Fog::Provider - service(:compute, 'compute/libvirt') + service(:compute, 'libvirt/compute') end end diff --git a/lib/fog/compute/libvirt.rb b/lib/fog/libvirt/compute.rb similarity index 96% rename from lib/fog/compute/libvirt.rb rename to lib/fog/libvirt/compute.rb index 698ebc92a..b96bfcf52 100644 --- a/lib/fog/compute/libvirt.rb +++ b/lib/fog/libvirt/compute.rb @@ -1,4 +1,4 @@ -require 'fog/compute/models/libvirt/uri' +require 'fog/libvirt/models/compute/uri' module Fog module Compute @@ -6,7 +6,7 @@ module Fog requires :libvirt_uri - model_path 'fog/compute/models/libvirt' + model_path 'fog/libvirt/models/compute' model :server collection :servers model :network diff --git a/lib/fog/compute/models/libvirt/README.md b/lib/fog/libvirt/models/compute/README.md similarity index 100% rename from lib/fog/compute/models/libvirt/README.md rename to lib/fog/libvirt/models/compute/README.md diff --git a/lib/fog/compute/models/libvirt/interface.rb b/lib/fog/libvirt/models/compute/interface.rb similarity index 100% rename from lib/fog/compute/models/libvirt/interface.rb rename to lib/fog/libvirt/models/compute/interface.rb diff --git a/lib/fog/compute/models/libvirt/interfaces.rb b/lib/fog/libvirt/models/compute/interfaces.rb similarity index 97% rename from lib/fog/compute/models/libvirt/interfaces.rb rename to lib/fog/libvirt/models/compute/interfaces.rb index fbc4b6f03..6d765400c 100644 --- a/lib/fog/compute/models/libvirt/interfaces.rb +++ b/lib/fog/libvirt/models/compute/interfaces.rb @@ -1,5 +1,5 @@ require 'fog/core/collection' -require 'fog/compute/models/libvirt/interface' +require 'fog/libvirt/models/compute/interface' module Fog module Compute diff --git a/lib/fog/compute/models/libvirt/network.rb b/lib/fog/libvirt/models/compute/network.rb similarity index 96% rename from lib/fog/compute/models/libvirt/network.rb rename to lib/fog/libvirt/models/compute/network.rb index 97eccdd03..8d993af7e 100644 --- a/lib/fog/compute/models/libvirt/network.rb +++ b/lib/fog/libvirt/models/compute/network.rb @@ -1,5 +1,5 @@ require 'fog/core/model' -require 'fog/compute/models/libvirt/util' +require 'fog/libvirt/models/compute/util' module Fog module Compute diff --git a/lib/fog/compute/models/libvirt/networks.rb b/lib/fog/libvirt/models/compute/networks.rb similarity index 97% rename from lib/fog/compute/models/libvirt/networks.rb rename to lib/fog/libvirt/models/compute/networks.rb index 2b8bb09bd..d346c03a1 100644 --- a/lib/fog/compute/models/libvirt/networks.rb +++ b/lib/fog/libvirt/models/compute/networks.rb @@ -1,5 +1,5 @@ require 'fog/core/collection' -require 'fog/compute/models/libvirt/network' +require 'fog/libvirt/models/compute/network' module Fog module Compute diff --git a/lib/fog/compute/models/libvirt/node.rb b/lib/fog/libvirt/models/compute/node.rb similarity index 100% rename from lib/fog/compute/models/libvirt/node.rb rename to lib/fog/libvirt/models/compute/node.rb diff --git a/lib/fog/compute/models/libvirt/nodes.rb b/lib/fog/libvirt/models/compute/nodes.rb similarity index 96% rename from lib/fog/compute/models/libvirt/nodes.rb rename to lib/fog/libvirt/models/compute/nodes.rb index 38d571b14..51b96e542 100644 --- a/lib/fog/compute/models/libvirt/nodes.rb +++ b/lib/fog/libvirt/models/compute/nodes.rb @@ -1,5 +1,5 @@ require 'fog/core/collection' -require 'fog/compute/models/libvirt/node' +require 'fog/libvirt/models/compute/node' module Fog module Compute diff --git a/lib/fog/compute/models/libvirt/pool.rb b/lib/fog/libvirt/models/compute/pool.rb similarity index 100% rename from lib/fog/compute/models/libvirt/pool.rb rename to lib/fog/libvirt/models/compute/pool.rb diff --git a/lib/fog/compute/models/libvirt/pools.rb b/lib/fog/libvirt/models/compute/pools.rb similarity index 97% rename from lib/fog/compute/models/libvirt/pools.rb rename to lib/fog/libvirt/models/compute/pools.rb index e8fc70737..d33d31443 100644 --- a/lib/fog/compute/models/libvirt/pools.rb +++ b/lib/fog/libvirt/models/compute/pools.rb @@ -1,5 +1,5 @@ require 'fog/core/collection' -require 'fog/compute/models/libvirt/pool' +require 'fog/libvirt/models/compute/pool' module Fog module Compute diff --git a/lib/fog/compute/models/libvirt/server.rb b/lib/fog/libvirt/models/compute/server.rb similarity index 99% rename from lib/fog/compute/models/libvirt/server.rb rename to lib/fog/libvirt/models/compute/server.rb index 15f48224f..b01364223 100644 --- a/lib/fog/compute/models/libvirt/server.rb +++ b/lib/fog/libvirt/models/compute/server.rb @@ -1,5 +1,5 @@ require 'fog/core/model' -require 'fog/compute/models/libvirt/util' +require 'fog/libvirt/models/compute/util' require 'net/ssh/proxy/command' require 'rexml/document' require 'erb' diff --git a/lib/fog/compute/models/libvirt/servers.rb b/lib/fog/libvirt/models/compute/servers.rb similarity index 98% rename from lib/fog/compute/models/libvirt/servers.rb rename to lib/fog/libvirt/models/compute/servers.rb index 029650603..9a424f2f1 100644 --- a/lib/fog/compute/models/libvirt/servers.rb +++ b/lib/fog/libvirt/models/compute/servers.rb @@ -1,5 +1,5 @@ require 'fog/core/collection' -require 'fog/compute/models/libvirt/server' +require 'fog/libvirt/models/compute/server' module Fog module Compute diff --git a/lib/fog/compute/models/libvirt/templates/network.xml.erb b/lib/fog/libvirt/models/compute/templates/network.xml.erb similarity index 100% rename from lib/fog/compute/models/libvirt/templates/network.xml.erb rename to lib/fog/libvirt/models/compute/templates/network.xml.erb diff --git a/lib/fog/compute/models/libvirt/templates/pool.xml.erb b/lib/fog/libvirt/models/compute/templates/pool.xml.erb similarity index 100% rename from lib/fog/compute/models/libvirt/templates/pool.xml.erb rename to lib/fog/libvirt/models/compute/templates/pool.xml.erb diff --git a/lib/fog/compute/models/libvirt/templates/server.xml.erb b/lib/fog/libvirt/models/compute/templates/server.xml.erb similarity index 100% rename from lib/fog/compute/models/libvirt/templates/server.xml.erb rename to lib/fog/libvirt/models/compute/templates/server.xml.erb diff --git a/lib/fog/compute/models/libvirt/templates/volume.xml.erb b/lib/fog/libvirt/models/compute/templates/volume.xml.erb similarity index 100% rename from lib/fog/compute/models/libvirt/templates/volume.xml.erb rename to lib/fog/libvirt/models/compute/templates/volume.xml.erb diff --git a/lib/fog/compute/models/libvirt/uri.rb b/lib/fog/libvirt/models/compute/uri.rb similarity index 100% rename from lib/fog/compute/models/libvirt/uri.rb rename to lib/fog/libvirt/models/compute/uri.rb diff --git a/lib/fog/compute/models/libvirt/util.rb b/lib/fog/libvirt/models/compute/util.rb similarity index 100% rename from lib/fog/compute/models/libvirt/util.rb rename to lib/fog/libvirt/models/compute/util.rb diff --git a/lib/fog/compute/models/libvirt/volume.rb b/lib/fog/libvirt/models/compute/volume.rb similarity index 99% rename from lib/fog/compute/models/libvirt/volume.rb rename to lib/fog/libvirt/models/compute/volume.rb index 7ded6511e..76c45ecd9 100644 --- a/lib/fog/compute/models/libvirt/volume.rb +++ b/lib/fog/libvirt/models/compute/volume.rb @@ -1,5 +1,5 @@ require 'fog/core/model' -require 'fog/compute/models/libvirt/util' +require 'fog/libvirt/models/compute/util' require 'rexml/document' require 'erb' require 'securerandom' diff --git a/lib/fog/compute/models/libvirt/volumes.rb b/lib/fog/libvirt/models/compute/volumes.rb similarity index 98% rename from lib/fog/compute/models/libvirt/volumes.rb rename to lib/fog/libvirt/models/compute/volumes.rb index 553911d5d..334150ad3 100644 --- a/lib/fog/compute/models/libvirt/volumes.rb +++ b/lib/fog/libvirt/models/compute/volumes.rb @@ -1,5 +1,5 @@ require 'fog/core/collection' -require 'fog/compute/models/libvirt/volume' +require 'fog/libvirt/models/compute/volume' module Fog module Compute diff --git a/lib/fog/providers.rb b/lib/fog/providers.rb index 100ededc4..067aa4341 100644 --- a/lib/fog/providers.rb +++ b/lib/fog/providers.rb @@ -15,6 +15,7 @@ require 'fog/dynect' require 'fog/ecloud' require 'fog/go_grid' require 'fog/google' +require 'fog/libvirt' require 'fog/linode' require 'fog/local' require 'fog/new_servers' @@ -26,5 +27,3 @@ require 'fog/vcloud' require 'fog/virtual_box' require 'fog/voxel' require 'fog/zerigo' - -require 'fog/providers/libvirt'