I’m trying to implement the below method from Mastering CloudForms Automation to list all services as items in a drop down list:
https://github.com/pemcg/oreilly-mastering-cloudforms-automation/blob/master/chapter37/scripts/list_services.rb
Any time I go to the dialog the list drop down says <Script error>
.
Looking at the error in automation.log I see:
[----] I, [2017-08-15T15:07:07.522814 #3030:ec76b0] INFO -- : <AEMethod [/Operations/Methods/list_services]> Starting
[----] I, [2017-08-15T15:07:08.283834 #3030:69a960] INFO -- : <AEMethod list_services> rbac filters: []
[----] E, [2017-08-15T15:07:08.290705 #3030:10f4398] ERROR -- : <AEMethod list_services> [Service Model not found (MiqAeException::ServiceNotFound)]
(druby://127.0.0.1:41659) /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:21:in `rescue in method_missing'
(druby://127.0.0.1:41659) /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:18:in `method_missing'
(druby://127.0.0.1:41659) /opt/rubies/ruby-2.3.1/lib/ruby/2.3.0/drb/drb.rb:1624:in `perform_without_block'
(druby://127.0.0.1:41659) /opt/rubies/ruby-2.3.1/lib/ruby/2.3.0/drb/drb.rb:1584:in `perform'
(druby://127.0.0.1:41659) /opt/rubies/ruby-2.3.1/lib/ruby/2.3.0/drb/drb.rb:1657:in `block (2 levels) in main_loop'
(druby://127.0.0.1:41659) /opt/rubies/ruby-2.3.1/lib/ruby/2.3.0/drb/drb.rb:1653:in `loop'
(druby://127.0.0.1:41659) /opt/rubies/ruby-2.3.1/lib/ruby/2.3.0/drb/drb.rb:1653:in `block in main_loop'
/Operations/Methods/list_services:37:in `<main>'
[----] I, [2017-08-15T15:07:08.309980 #3030:ec76b0] INFO -- : <AEMethod [/Operations/Methods/list_services]> Ending
It seems pretty clear that there’s some trouble executing line 37: $evm.vmdb(:service).find(:all).each do |service|
Does anyone have any advise on where to start troubleshooting?
Version fine-2.20170724083520_6137fff