New commit detected on ManageIQ/manageiq/hammer: https://github.com/ManageIQ/manageiq/commit/14e100cf68085524e229ccdf34fe8acdfa82d85d commit 14e100cf68085524e229ccdf34fe8acdfa82d85d Author: Adam Grare <agrare> AuthorDate: Tue Mar 19 06:42:19 2019 -0400 Commit: Adam Grare <agrare> CommitDate: Tue Mar 19 06:42:19 2019 -0400 Merge pull request #18538 from jrafanie/deprecate_invalid_column_names_in_custom_attributes Deprecate invalid custom attribute names (cherry picked from commit a26aa9ddbbb52e9b2027c199cd7782fc8a68c8cb) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1693722 app/models/mixins/custom_attribute_mixin.rb | 9 + spec/models/mixins/custom_attribute_mixin_spec.rb | 34 + 2 files changed, 43 insertions(+)
Hey Joe, From what I make of the comments on PR(https://github.com/ManageIQ/manageiq/pull/18538), the problem has not been completely fixed, but a warning is logged somewhere when a custom attribute is created with an invalid name. I was able to reproduce this BZ, I tested it by creating CA via both REST API and rails console, but I could not see warning anywhere in any of the logs. Can you tell me which log am I supposed to check? Thanks, Parthvi
Parthvi, how are you creating the custom attributes? The methods that are currently raising a deprecation are the common ones used to do this via the custom attribute mixin. If you bypass the mixin and create the custom attribute directly, it will not log a deprecation warning.
I created them via REST API and rails console. 1) via REST API POST /api/vms/:id/custom_attributes Query: { "action" : "add", "resources" : [ { "name" : "CA with space API", "value" : "value not displayed API" }, { "name" : "CAwithoutspaceAPI", "value" : "value displayed API" } ] } 2) via Rails Console: $evm = MiqAeMethodService::MiqAeService.new(MiqAeEngine::MiqAeWorkspaceRuntime.new) vm = $evm.vmdb('vm').find_by_name(:vm_name) vm.custom_set(key, value) I am not sure if any of these used custom attribute mixin. If they did not, can you tell me how to create the custom attribute via mixin?
Forgot to do it in the last comment #5, so adding a needinfo here.
!) this will not raise a deprecation yet 2) this will raise a deprecation config.active_support.deprecation in vmdb/config/environments/production.rb is set to :notify by default. Change it to :log to see the deprecations in the rails log, matching the environment, probably production.log. When people develop their automate code in development mode, this is the default and it will be seen without changing anything.
FIXED. Verified the fix for BZ on 5.10.3. The production log logs warning when invalid CA name is set.
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/RHSA-2019:0796