Skip to content

Commit

Permalink
Merge pull request #13355 from bdunne/move_miq_ae_workspace_model
Browse files Browse the repository at this point in the history
Move miq ae workspace model
  • Loading branch information
gmcculloug authored Jan 9, 2017
2 parents 21e0f8f + 6249fe2 commit c9cc8d1
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 35 deletions.
32 changes: 32 additions & 0 deletions app/models/miq_ae_workspace.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
class MiqAeWorkspace < ApplicationRecord
serialize :workspace
serialize :setters
include UuidMixin

def self.evmget(token, uri)
workspace_from_token(token).evmget(uri)
end

def evmget(uri)
workspace.varget(uri)
end

def self.evmset(token, uri, value)
workspace_from_token(token).evmset(uri, value)
end

def evmset(uri, value)
if workspace.varset(uri, value)
self.setters ||= []
self.setters << [uri, value]
self.save!
end
end

def self.workspace_from_token(token)
ws = MiqAeWorkspace.find_by_guid(token)
raise MiqAeException::WorkspaceNotFound, "Workspace Not Found for token=[#{token}]" if ws.nil?
ws
end
private_class_method(:workspace_from_token)
end
1 change: 0 additions & 1 deletion lib/miq_automation_engine/engine/miq_ae_engine.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require 'miq_ae_exception'
require 'engine/drb_remote_invoker'
require 'engine/miq_ae_workspace'
require 'engine/miq_ae_workspace_runtime'
require 'engine/miq_ae_object'
require 'engine/miq_ae_method'
Expand Down
34 changes: 0 additions & 34 deletions lib/miq_automation_engine/engine/miq_ae_workspace.rb

This file was deleted.

0 comments on commit c9cc8d1

Please sign in to comment.