Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uniqueness of service for generation chargeback report for SSUI #17082

Merged
merged 1 commit into from
Mar 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/models/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/models/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down