Skip to content

Commit

Permalink
remove fog server identity override; accept vm references in find_vm_…
Browse files Browse the repository at this point in the history
…by_uuid
  • Loading branch information
Niels Baumgartner authored and mmoll committed Jul 2, 2019
1 parent d70d4bf commit 5ed9618
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 0 additions & 4 deletions app/models/concerns/fog_extensions/xenserver/server.rb
Expand Up @@ -13,10 +13,6 @@ def id
uuid
end

def identity
uuid
end

def to_s
name
end
Expand Down
2 changes: 2 additions & 0 deletions app/models/foreman_xen/xenserver.rb
Expand Up @@ -56,6 +56,8 @@ def cleanup_configdrive(uuid)
# Fog::XenServer::Compute (client) isn't an ActiveRecord model which
# supports find_by()
def find_vm_by_uuid(uuid)
return client.servers.find { |s| s.reference == uuid } if uuid.start_with? 'OpaqueRef:'

client.servers.find_by_uuid(uuid)
rescue Fog::XenServer::RequestFailed => e
Foreman::Logging.exception("Failed retrieving xenserver vm by uuid #{uuid}", e)
Expand Down

0 comments on commit 5ed9618

Please sign in to comment.