Project

General

Profile

Bug #21503

Importing puppet classes fails when switching to different org

Added by Ondřej Pražák over 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Steps to reproduce:
1) Import several puppet classes in context of OrgA
2) Delete one of them
3) Switch context to OrgB
4) Import puppet classes
5) observe the error

 | ActiveRecord::RecordInvalid (Validation failed: Name is already taken):
 |   app/services/puppet_class_importer.rb:333:in `find_or_create_env'
 |   app/services/puppet_class_importer.rb:256:in `add_classes_to_foreman'
 |   app/services/puppet_class_importer.rb:71:in `block in obsolete_and_new'
 |   app/services/puppet_class_importer.rb:69:in `each'
 |   app/services/puppet_class_importer.rb:69:in `obsolete_and_new'
 |   app/controllers/concerns/foreman/controller/environments.rb:41:in `obsolete_and_new'
 |   app/controllers/concerns/application_shared.rb:15:in `set_timezone'
 |   app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 |   app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
 |   /home/vagrant/projects/katello/lib/katello/params_parser_wrapper.rb:12:in `call'
 |   lib/middleware/catch_json_parse_errors.rb:8:in `call'
 |   lib/middleware/session_safe_logging.rb:17:in `call'
 |   lib/middleware/tagged_logging.rb:18:in `call'


Related issues

Related to Foreman - Bug #17463: Importing classes for a new org fails when the environment already exist in a different orgClosed2016-11-23

Associated revisions

Revision c791180e (diff)
Added by Ondřej Pražák over 2 years ago

Fixes #21503 - Import puppet classes when organzations changed

History

#1 Updated by Ondřej Pražák over 2 years ago

  • Related to Bug #17463: Importing classes for a new org fails when the environment already exist in a different org added

#2 Updated by Ondřej Pražák over 2 years ago

  • Bugzilla link set to 1350159

#3 Updated by The Foreman Bot over 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4963 added

#4 Updated by Anonymous over 2 years ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#5 Updated by Daniel Lobato Garcia over 2 years ago

  • Legacy Backlogs Release (now unused) set to 296

Also available in: Atom PDF