diff --git a/app/models/service.rb b/app/models/service.rb index 5ce5af69593..a158ac642bd 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -372,11 +372,11 @@ def self.queue_chargeback_reports(options = {}) end def chargeback_report_name - "Chargeback-Vm-Monthly-#{name}" + "Chargeback-Vm-Monthly-#{name}-#{id}" end def generate_chargeback_report(options = {}) - _log.info("Generation of chargeback report for service #{name} started...") + _log.info("Generation of chargeback report for service #{name} with #{id} started...") MiqReportResult.where(:name => chargeback_report_name).destroy_all report = MiqReport.new(chargeback_yaml) options[:report_sync] = true diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb index fddfb3c96af..312975c46f2 100644 --- a/spec/models/service_spec.rb +++ b/spec/models/service_spec.rb @@ -442,7 +442,7 @@ describe "#chargeback_report_name" do it "creates chargeback report's name" do - expect(@service.chargeback_report_name).to eq "Chargeback-Vm-Monthly-Test_Service_1" + expect(@service.chargeback_report_name).to eq "Chargeback-Vm-Monthly-Test_Service_1-#{@service.id}" end end