You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have ManageIQ Lasker instance running in production and we need to import updated existing custom_buttons as we did for service_dialogs or service_catalogs.
For now, we can export / import miq objects as service_dialogs, service_catalogs but only export works for custom_buttons, import fails.
rake evm:import:custom_buttons --trace -- --overwrite --source /tmp/custom_buttons_test
The error message (extract) :
** Invoke evm:import:custom_buttons (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute evm:import:custom_buttons
rake aborted!
StandardError: Error importing /tmp/custom_buttons_test/CustomButtons.yaml at ["/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.4/lib/active_record/validations.rb:80:in `raise_validation_error'", "/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.4/lib/active_record/validations.rb:53:in `save!'", "/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.4/lib/active_record/transactions.rb:318:in `block in save!'", "/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.4/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'", "/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.4/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in `transaction'", "/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.4/lib/active_record/transactions.rb:212:in `transaction'", "/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.4/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'", "/opt/manageiq/manageiq-gemset
...
ActiveRecord::RecordInvalid: Validation failed: CustomButtonSet: Name has already been taken
/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.4/lib/active_record/validations.rb:80:in `raise_validation_error'
/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.4/lib/active_record/validations.rb:53:in `save!'
/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.4/lib/active_record/transactions.rb:318:in `block in save!'
/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.4/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.4/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in `transaction'
/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.4/lib/active_record/transactions.rb:212:in `transaction'
/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.4/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.4/lib/active_record/transactions.rb:318:in `save!'
...
/opt/manageiq/manageiq-gemset/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/opt/manageiq/manageiq-gemset/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/opt/manageiq/manageiq-gemset/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/opt/manageiq/manageiq-gemset/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/opt/manageiq/manageiq-gemset/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/opt/manageiq/manageiq-gemset/bin/rake:23:in `load'
/opt/manageiq/manageiq-gemset/bin/rake:23:in `<main>'
Tasks: TOP => evm:import:custom_buttons
If I drop all custom_buttons and import them back with the same import command, everything works. The bad thing is that all IDs are regenerated, orders dismissed and so on ... I need to be able to import updated custom_buttons like I do with service_dialogs or service_catalogs.
Nevertheles it seems that the overwrite option that works for service_dialogs and service_catalogs ... doesn't work for custom_buttons.
Am I doing something wrong or is there a bug somewhere ?
Great regards !
Jocelyn
For more informations and reproduction :
Here is a sample yaml that creates a CustomButtonSet and a CustomButton :
---
custom_button_set:
- attributes:
name: Ressources|Service|test2345
description: Gestion des ressources test
set_type: CustomButtonSet
set_data:
:button_icon: pficon pficon-cloud-tenant
:display: true
:group_index: 3
:applies_to_class: Service
children:
custom_button:
- attributes:
name: test2345
description: test2345
applies_to_class: Service
options:
:button_icon: fa fa-user-plus
:button_type: default
:display: true
:open_url: false
:display_for: single
:submit_how: one
And the complete test on a lastest Najdorf version (that shows the second import fail) :
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
We have ManageIQ Lasker instance running in production and we need to import updated existing custom_buttons as we did for service_dialogs or service_catalogs.
For now, we can export / import miq objects as service_dialogs, service_catalogs but only export works for custom_buttons, import fails.
If I drop all custom_buttons and import them back with the same import command, everything works. The bad thing is that all IDs are regenerated, orders dismissed and so on ... I need to be able to import updated custom_buttons like I do with service_dialogs or service_catalogs.
Nevertheles it seems that the overwrite option that works for service_dialogs and service_catalogs ... doesn't work for custom_buttons.
Am I doing something wrong or is there a bug somewhere ?
Great regards !
Jocelyn
For more informations and reproduction :
Here is a sample yaml that creates a CustomButtonSet and a CustomButton :
And the complete test on a lastest Najdorf version (that shows the second import fail) :
It worked great ... but not the second time below even with the overwrite option :
Beta Was this translation helpful? Give feedback.
All reactions