Class: Actions::Katello::Repository::Discover
- Inherits:
-
EntryAction
- Object
- EntryAction
- Actions::Katello::Repository::Discover
- Includes:
- Dynflow::Action::Cancellable, EncryptValue
- Defined in:
- app/lib/actions/katello/repository/discover.rb
Instance Method Summary collapse
- #plan(url, content_type, upstream_username, upstream_password, search) ⇒ Object
- #run(event = nil) ⇒ Object
-
#task_output ⇒ Array<String>
Urls found by the action.
Instance Method Details
#plan(url, content_type, upstream_username, upstream_password, search) ⇒ Object
20 21 22 23 |
# File 'app/lib/actions/katello/repository/discover.rb', line 20 def plan(url, content_type, upstream_username, upstream_password, search) password = encrypt_field(upstream_password) plan_self(url: url, content_type: content_type, upstream_username: upstream_username, upstream_password: password, search: search) end |
#run(event = nil) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/lib/actions/katello/repository/discover.rb', line 25 def run(event = nil) output[:repo_urls] = output[:repo_urls] || [] output[:crawled] = output[:crawled] || [] output[:to_follow] = output[:to_follow] || [input[:url]] match(event, (on nil do unless output[:to_follow].empty? password = decrypt_field(input[:upstream_password]) repo_discovery = ::Katello::RepoDiscovery.new(input[:url], input[:content_type], input[:upstream_username], password, input[:search], output[:crawled], output[:repo_urls], output[:to_follow]) repo_discovery.run(output[:to_follow].shift) suspend { |suspended_action| world.clock.ping suspended_action, 0.001 } end end), (on Dynflow::Action::Cancellable::Cancel do output[:repo_urls] = [] end)) end |
#task_output ⇒ Array<String>
Returns urls found by the action.
49 50 51 |
# File 'app/lib/actions/katello/repository/discover.rb', line 49 def task_output output[:repo_urls] || [] end |