Bug 1282537 - authentication_userid/authentication_password methods missing for Foreman provider [NEEDINFO]
authentication_userid/authentication_password methods missing for Foreman pro...
Status: CLOSED WONTFIX
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate (Show other bugs)
5.4.0
Unspecified Unspecified
unspecified Severity medium
: GA
: cfme-future
Assigned To: Greg McCullough
Jan Krocil
automate:foreman
:
: 1282541 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-16 12:09 EST by ncatling
Modified: 2017-06-07 14:46 EDT (History)
10 users (show)

See Also:
Fixed In Version: 5.5.0.11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-06-07 14:46:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
jkrocil: needinfo? (gmccullo)


Attachments (Terms of Use)

  None (edit)
Description ncatling 2015-11-16 12:09:31 EST
Description of problem:

authentication_userid/authentication_password methods missing for Foreman/Configuration Manager provider. Following error produced:

NoMethodError: undefined method `authentication_userid' for #<MiqAeMethodService::MiqAeServiceProvisioningManagerForeman:0x000000075d0320>


Version-Release number of selected component (if applicable):

5.4.3.1


How reproducible:


Steps to Reproduce:
1. Add Satellite 6 provider
2. Access rails console
3. Execute following: $evm.vmdb('ext_management_system').all.each { |ems| puts ems.authentication_userid }

Actual results:

irb(main):022:0> $evm.vmdb('ext_management_system').all.each { |ems| puts ems.authentication_userid }
  ExtManagementSystem Load (0.3ms)  SELECT "ext_management_systems".* FROM "ext_management_systems" 
  ExtManagementSystem Inst Including Associations (0.9ms - 9rows)
  Authentication Load (0.3ms)  SELECT "authentications".* FROM "authentications" WHERE "authentications"."resource_id" = 1000000000006 AND "authentications"."resource_type" = 'ExtManagementSystem'
  Authentication Inst Including Associations (0.1ms - 1rows)
admin
  Authentication Load (0.2ms)  SELECT "authentications".* FROM "authentications" WHERE "authentications"."resource_id" = 1000000000007 AND "authentications"."resource_type" = 'ExtManagementSystem'
  Authentication Inst Including Associations (0.2ms - 3rows)
admin
  Authentication Load (0.2ms)  SELECT "authentications".* FROM "authentications" WHERE "authentications"."resource_id" = 1000000000009 AND "authentications"."resource_type" = 'ExtManagementSystem'
  Authentication Inst Including Associations (0.1ms - 2rows)
admin@internal
NoMethodError: undefined method `authentication_userid' for #<MiqAeMethodService::MiqAeServiceProvisioningManagerForeman:0x000000075d0320>
	from /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:176:in `method_missing'
	from (irb):22:in `block in irb_binding'
	from (irb):22:in `each'
	from (irb):22
	from /opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/railties/lib/rails/commands/console.rb:47:in `start'
	from /opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/railties/lib/rails/commands/console.rb:8:in `start'
	from /opt/rh/cfme-gemset/bundler/gems/rails-4842a8377644/railties/lib/rails/commands.rb:41:in `<top (required)>'
	from script/rails:6:in `require'
	from script/rails:6:in `<main>'



Expected results:

authentication_userid/authentication_password should be displayed.

Additional info:
Comment 2 ncatling 2015-11-16 12:14:40 EST
*** Bug 1282541 has been marked as a duplicate of this bug. ***
Comment 3 Greg McCullough 2015-11-19 17:20:56 EST
Nick - The steps to reproduce are not valid from the rails console as written because $evm is nil when you start the rails console.

If you have steps for reproducing in console please provide the full steps otherwise it seems like the steps should state that the logic needs to be run from an automate method.
Comment 4 ncatling 2015-11-19 18:01:24 EST
This is the missing bit:
$evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)
Comment 5 ncatling 2015-11-19 18:02:40 EST
This is the missing bit:
$evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)
Comment 6 Greg McCullough 2015-11-20 08:23:30 EST
This was recently fixed in https://github.com/ManageIQ/manageiq/pull/5397 as part of Bug 1280350.

Moving this ticket to POST so QE can validate this scenario as it was not identified as an issue in the original bug.

Updated steps to Reproduce:
1. Add Satellite 6 provider
2. Access rails console
3. Execute following: 
$evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new)
$evm.vmdb('ext_management_system').all.each { |ems| puts ems.authentication_userid }
Comment 10 Greg McCullough 2015-11-30 11:19:44 EST
The Sat6/Foreman provider is setup different from other management_systems.  The main object is defined in the Provider model and has multiple "management systems" called managers which are derived from the ext_management_system model which is why you see 2 records there for a Foreman provider.

The credentials are set on the Provider object and not on the managers which is why you are seeing the nil.  Foreman needs to access the credentials at the Provider model layer, but they are currently not exposed to automate.
Comment 12 Chris Pelland 2017-06-07 14:46:50 EDT
This BZ has been closed since it was opened on a version of CloudForms that has reached the end of its lifecycle.  If you find that this bug is still relevant, please open a new BZ against the relevant supported version of CloudForms.

Note You need to log in before you can comment on or make changes to this bug.