New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #20389 - Don't report a non numeric major version on debian sid #91
Conversation
There were the following issues with the commit message:
If you don't have a ticket number, please create an issue in Redmine. More guidelines are available in Coding Standards or on the Foreman wiki. This message was auto-generated by Foreman's prprocessor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agx Thanks, can you add a test? To do so, take a facts_json
that you want to import and put it here: https://github.com/theforeman/foreman_ansible/blob/master/test/unit/services/fact_parser_test.rb - that way we know it works "forever".
I'm fixing rubocop on other PR, but if you could fix the ones code climate mentions here that'd help a bit 😄 http://ci.theforeman.org/job/test_plugin_matrix/3479/database=postgresql,ruby=2.1,slave=fast/console
I would, but as I wrote in redmine running foreman from git is such a pita atm. When I enable the ansible module I can't even run the migrations (without it it works):
so I guess I'll just keep this in the fork we run together with the other stuff and hope that it looks better in a couple of months. |
Don't report a non numeric major version on debian sid since this otherwise fails like 2017-07-23T15:39:32 07623536 [app] [W] Action failed | ActiveRecord::RecordInvalid: Validation failed: Major version is too long (maximum is 5 characters), Major version is not a number | /usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/validations.rb:79:in `raise_record_invalid' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/validations.rb:43:in `save!' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/attribute_methods/dirty.rb:29:in `save!' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/transactions.rb:291:in `block in save!' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/transactions.rb:220:in `transaction' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/transactions.rb:348:in `with_transaction_returning_status' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/transactions.rb:291:in `save!' | /usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-4.2.9/lib/active_record/persistence.rb:51:in `create!' | /usr/share/foreman/vendor/ruby/2.3.0/gems/foreman_ansible-1.4.5/app/services/foreman_ansible/fact_parser.rb:14:in `operatingsystem' … Debian adds the numeric versions after the release to the /etc/os-release: http://metadata.ftp-master.debian.org/changelogs/main/b/base-files/base-files_10_changelog The puppet fact parser uses s.th. similar.
@dLobatog hacked around the errors by pruning the test db and using + ActiveSupport::Deprecation.behavior = [:stderr] Testcase is attached, rubocop should be happy now too. |
Thanks @agx - tests passed locally, still working on fixing test_plugin_foreman_ansible_master in Jenkins.. |
since this otherwise fails like
Debian adds the numeric versions after the release to the
/etc/os-release:
The puppet fact parser uses s.th. similar.