app/lib/actions/pulp/repository/create_in_plan.rb in katello-3.4.5 vs app/lib/actions/pulp/repository/create_in_plan.rb in katello-3.5.0.rc1
- old
+ new
@@ -5,14 +5,14 @@
alias_method :perform_run, :run
def plan(input)
plan_self(input)
pulp_extensions.repository.create_with_importer_and_distributors(input[:pulp_id],
- importer,
- distributors,
- display_name: input[:name])
+ importer,
+ distributors,
+ display_name: input[:name])
rescue => e
- raise error_message(e.http_body) || e
+ raise e.try(:http_body) ? error_message(e.http_body) || e : e
end
def error_message(body)
JSON.parse(body)['error_message']
rescue JSON::ParserError