Project

General

Profile

Bug #386

ImportClasses should be callable from a rake task

Added by Paul Kelly about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Importers
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

The import facility for environments and puppetclasses was updated in the GUI but there was a rake task that called the old API and this does not work now.


Related issues

Related to Foreman - Bug #239: Class import doesn't prune erased classesClosed2010-05-06

Associated revisions

Revision 41d40698 (diff)
Added by Paul Kelly about 8 years ago

Fixes #386 - Updated rake puppet:import_classes to support the new API

The rake task now queries for the changes and then performs the update.

Some additional sanity checking is performed in the execution phase.

A batch mode is provided via rake puppet:import:puppet_classes[true]. When
"true" is passed to this task then no user imput is required.

If the file config/ignored_classes_and_environments.yml is present then
its contents are stripped from the set of changes that the puppetclass
import will attempt to do. There is also a self documenting sample file in
extras/ignored_classes_and_environments.yml.sample

History

#1 Updated by Paul Kelly about 8 years ago

  • Subject changed from Import host and classes shold be callable from a rake task to ImportClasses should be callable from a rake task

#2 Updated by Ohad Levy about 8 years ago

  • Target version set to 0.1-6

#3 Updated by Paul Kelly about 8 years ago

  • Status changed from New to Ready For Testing
  • Branch set to bug/386-rake-calls-importClasses

Updated the rake task

#4 Updated by Ohad Levy about 8 years ago

i think you need to add support for actions via parameters, as this might be called from a cron job, or a repo hook script.

#5 Updated by Paul Kelly about 8 years ago

A batch mode has been supplied that requires no interaction. Activate by rake puppet:import:puppet_classes[true]

If the file config/ignored_classes_and_environments.yml is present then its contents are stripped from the set of changes that the puppetclass import will attempt to do. There is also a self documenting sample file in extras/ignored_classes_and_environments.yml.sample

#6 Updated by Paul Kelly about 8 years ago

rebased and tested

#7 Updated by Ohad Levy about 8 years ago

  • Status changed from Ready For Testing to Feedback

while trying to test, i've got the following test failing:

  1) Failure:
test_should_obey_config/ignored_classes_and_environments.yml(EnvironmentsControllerTest) [/test/functional/environments_controller_test.rb:149]:
not all expectations were satisfied
unsatisfied expectations:
- expected at least once, not yet invoked: Puppetclass(id: integer, name: string, nameindicator: string, operatingsystem_id: integer, created_at: datetime, updated_at: datetime).scanForClasses(any_parameters)
satisfied expectations:
- expected at least once, already invoked once: Environment(id: integer, name: string, created_at: datetime, updated_at: datetime).puppetEnvs(any_parameters)

#8 Updated by Paul Kelly about 8 years ago

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

#9 Updated by Ohad Levy about 8 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF