hammer import activation-key fails for some keys with tracebacks like the following: Caught HammerCLIImport::MissingObjectError:Need to import content_view with id 133 while processing following line: {"base_channel_id"=>"133;None", "token"=>"7-f3e8de0a6f74dbb18a97099005018d2d", "note"=>"SOE-RHEL5-QA", "child_channel_id"=>"142;None", "usage_limit"=>nil, "org_id"=>"7", "server_group_id"=>"34"} /usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/base.rb:220:in `get_translated_id' /usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/activationkey.rb:71:in `import_single_row' /usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/activationkey.rb:69:in `each' /usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/activationkey.rb:69:in `import_single_row' /usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/base.rb:412:in `call' /usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/base.rb:412:in `cvs_iterate' /usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/csvhelper.rb:44:in `csv_each' /usr/lib/ruby/gems/1.8/gems/fastercsv-1.5.4/lib/faster_csv.rb:1545:in `each' /usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/csvhelper.rb:35:in `csv_each' /usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/base.rb:410:in `cvs_iterate' /usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/base.rb:422:in `import' /usr/lib/ruby/gems/1.8/gems/hammer_cli_import-0.8.0/lib/hammer_cli_import/base.rb:451:in `execute' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' This may be a 'normal' error-case - in which case, we shouldn't throw a traceback.
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
This is a more general issue than just AKs: <tlestach> ggainey: if a prereq. is missing, e.g. a content view, then we are not able to create an activation key associated with the missing content view ... <tlestach> ggainey: it's not a matter of act. keys, but generally Need to figure out a way to handle this more gracefully
Better way of handling mentioned exception. hammer-cli-import.git: fe68d97040582285615aefe4708d9b402c14ae91
Some more finetuning of log levels. hammer-cli-import.git: 34c72e041369cb065f823072059dfc438a7adef6
VERIFIED
installed space-walk tool and tested it
shifting this to ON_QA as discussed in the email will be handled by @ggainey
VERIFIED. rubygem-hammer_cli_import-0.10.4-1.1.el7sat.noarch string in comment #0 was touched a bit: Need to import content_view > Unable to import, first import content view # hammer import activation-key --csv-file /tmp/exports/activation-keys.csv Unable to import, first import content view with id 227 Unable to import, first import content view with id 227 Unable to import, first import content view with id 227 Unable to import, first import content view with id 225 Unable to import, first import content view with id 225 Unable to import, first import content view with id 227 Unable to import, first import content view with id 227 Unable to import, first import content view with id 224 Unable to import, first import content view with id 227 ... >>> handles MissingObjectError appropriately <<< # hammer import activation-key --verbose --csv-file /tmp/exports/activation-keys.csv ... Updating activation key with id: 37 Associating activation key [38] with content view [30] Updating activation key with id: 38 Caught RestClient::UnprocessableEntity:422 Unprocessable Entity while processing activation key 38 /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit' /usr/share/ruby/net/http.rb:852:in `start' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute' /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/resource.rb:76:in `put' /usr/share/gems/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:195:in `http_call' /usr/share/gems/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:150:in `call' /usr/share/gems/gems/apipie-bindings-0.0.8/lib/apipie_bindings/resource.rb:14:in `call' /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/base.rb:126:in `api_call' /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/base.rb:138:in `api_call' /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/base.rb:143:in `mapped_api_call' /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/base.rb:439:in `update_entity' /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/activationkey.rb:119:in `block (2 levels) in post_import' /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/importtools.rb:302:in `call' /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/importtools.rb:302:in `handle_missing_and_supress' /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/activationkey.rb:106:in `block in post_import' /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/activationkey.rb:105:in `each' /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/activationkey.rb:105:in `post_import' /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/base.rb:563:in `block in execute' /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/importtools.rb:302:in `call' /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/importtools.rb:302:in `handle_missing_and_supress' /usr/share/gems/gems/hammer_cli_import-0.10.4/lib/hammer_cli_import/base.rb:562:in `execute' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/abstract.rb:22:in `run' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/abstract.rb:22:in `run' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/share/gems/gems/hammer_cli-0.1.1/lib/hammer_cli/abstract.rb:22:in `run' /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run' /usr/share/gems/gems/hammer_cli-0.1.1/bin/hammer:102:in `<top (required)>' /usr/bin/hammer:23:in `load' /usr/bin/hammer:23:in `<main>' ... >>> caught exceptions (like RestClient::UnprocessableEntity:422) are shown only when using --verbose option <<<
This was delivered with Satellite 6.0 which was released on 10 September 2014.