-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from fog/clean_servers_collection
Cleaned up Servers Collection!
- Loading branch information
Showing
8 changed files
with
114 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module Fog | ||
module Compute | ||
class XenServer | ||
class Real | ||
def builtin_templates | ||
data = @connection.request(:parser => Fog::Parsers::XenServer::GetRecords.new, :method => "VM.get_all_records") | ||
data.keep_if { |vm| vm[:is_a_template] && !vm[:other_config]['default_template'].nil? } | ||
servers.load(data) | ||
rescue Fog::XenServer::RequestFailed => e | ||
[] | ||
end | ||
end | ||
|
||
class Mock | ||
def builtin_templates | ||
Fog::Mock.not_implemented | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module Fog | ||
module Compute | ||
class XenServer | ||
class Real | ||
def custom_templates | ||
data = @connection.request(:parser => Fog::Parsers::XenServer::GetRecords.new, :method => "VM.get_all_records") | ||
data.keep_if { |vm| vm[:is_a_template] && vm[:other_config]['default_template'].nil? } | ||
servers.load(data) | ||
rescue Fog::XenServer::RequestFailed => e | ||
[] | ||
end | ||
end | ||
|
||
class Mock | ||
def custom_templates | ||
Fog::Mock.not_implemented | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module Fog | ||
module Compute | ||
class XenServer | ||
class Real | ||
def templates | ||
data = @connection.request(:parser => Fog::Parsers::XenServer::GetRecords.new, :method => "VM.get_all_records") | ||
data.keep_if { |vm| vm[:is_a_template] } | ||
servers.load(data) | ||
rescue Fog::XenServer::RequestFailed => e | ||
[] | ||
end | ||
end | ||
|
||
class Mock | ||
def templates | ||
Fog::Mock.not_implemented | ||
end | ||
end | ||
end | ||
end | ||
end |