Red Hat Bugzilla – Bug 1328905
[RFE] Expose an 'Account' Active Record as a Service Model, with an association from MiqAeServiceVm
Last modified: 2016-06-29 11:51:47 EDT
Description of problem: We would like to be able to access the list of users and groups returned from SmartState Analysis, from an Automate Method. This seems to be in the 'accounts' table, but there is no corresponding service model. It would be extremely useful to be able to access this list of users and groups via an association from the VM service model object.
Lucy - Please create the Account service model for automate and expose the accounts, users and groups relationships for the vm_or_template model. They are exposed on the active_record model here: https://github.com/ManageIQ/manageiq/blob/96d0d63389b57a530a31da7a69e0bc8877ac3b4d/app/models/vm_or_template.rb#L77
https://github.com/ManageIQ/manageiq/pull/8266
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/2a7d26df597d79bf25cc192af7949ac672c77df5 commit 2a7d26df597d79bf25cc192af7949ac672c77df5 Author: Lucy Fu <lufu@redhat.com> AuthorDate: Tue Apr 26 15:57:50 2016 -0400 Commit: Lucy Fu <lufu@redhat.com> CommitDate: Tue Apr 26 15:59:22 2016 -0400 Expose Account to automate. https://bugzilla.redhat.com/show_bug.cgi?id=1328905 lib/miq_automation_engine/service_models/miq_ae_service_account.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 lib/miq_automation_engine/service_models/miq_ae_service_account.rb
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/3e8dfa998d5d886d32fda6b53d0722edafcd1677 commit 3e8dfa998d5d886d32fda6b53d0722edafcd1677 Author: Lucy Fu <lufu@redhat.com> AuthorDate: Tue Apr 26 15:58:36 2016 -0400 Commit: Lucy Fu <lufu@redhat.com> CommitDate: Tue Apr 26 15:59:22 2016 -0400 Expose the accounts, users and groups relationships for the vm_or_template model to automate. https://bugzilla.redhat.com/show_bug.cgi?id=1328905 .../service_models/miq_ae_service_vm_or_template.rb | 4 ++++ 1 file changed, 4 insertions(+)
Verified in: 5.6.0.5-beta2.4.20160503153816_1fb554f I was able to list vm.accounts, vm.users and vm.groups from rails console.
https://github.com/ManageIQ/manageiq/pull/8473
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:1348