Skip to content

Commit

Permalink
All action inherit from common Katello-specific action
Browse files Browse the repository at this point in the history
By default, the data that get into rest api equal to the input/output.

It's possible to customize that on per-action basis with overriding
task_input/task_output methods
  • Loading branch information
iNecas committed Jan 15, 2014
1 parent 7e66f5e commit ab13717
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
17 changes: 17 additions & 0 deletions app/lib/orchestrate/action.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module Orchestrate
class Action < Dynflow::Action

# This method says what data form input gets into the task details in Rest API
# By default, it sends the whole input there.
def task_input
self.input
end

# This method says what data form output gets into the task details in Rest API
# By default, it sends the whole input there.
def task_output
self.output
end

end
end
2 changes: 1 addition & 1 deletion app/lib/orchestrate/katello/pulp/repository_sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
module Orchestrate
module Katello
module Pulp
class RepositorySync < Dynflow::Action
class RepositorySync < Orchestrate::Action

include Helpers::RemoteAction
include Helpers::PulpTask
Expand Down
13 changes: 1 addition & 12 deletions app/lib/orchestrate/katello/repository_discover.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

module Orchestrate
module Katello
class RepositoryDiscover < Dynflow::Action
class RepositoryDiscover < Orchestrate::Action

input_format do
param :url, String
Expand All @@ -34,17 +34,6 @@ def run
continue = lambda { true }
repo_discovery.run(found, continue)
end

# Get the input url info into task
def task_input
{ url: input[:url] }
end

# Get the disovered repositories into task
def task_output
{ repo_urls: output[:repo_urls] }
end

end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/lib/orchestrate/katello/repository_sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

module Orchestrate
module Katello
class RepositorySync < Dynflow::Action
class RepositorySync < Orchestrate::Action

include Helpers::RemoteAction
include Helpers::Lock
Expand Down

0 comments on commit ab13717

Please sign in to comment.