Skip to content

Commit

Permalink
COST-2715: Include report_period_id in tag based rates delete. (proje…
Browse files Browse the repository at this point in the history
…ct-koku#3702)

Co-authored-by: Andrew Berglund <[email protected]>
  • Loading branch information
myersCody and adberglund authored Jun 24, 2022
1 parent de4abab commit bcb304f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion koku/masu/processor/ocp/ocp_cost_model_cost_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,15 @@ def _delete_tag_usage_costs(self, start_date, end_date, source_uuid):
"""Delete existing tag based rated entries"""
# Delete existing records
with OCPReportDBAccessor(self._schema) as report_accessor:
with schema_context(self._schema):
report_period = report_accessor.report_periods_for_provider_uuid(self._provider.uuid, start_date)
report_period_id = report_period.id
report_accessor.delete_line_item_daily_summary_entries_for_date_range_raw(
source_uuid,
start_date,
end_date,
table=OCPUsageLineItemDailySummary,
filters={"monthly_cost_type": "Tag"},
filters={"monthly_cost_type": "Tag", "report_period_id": report_period_id},
)

def update_summary_cost_model_costs(self, start_date, end_date):
Expand Down

0 comments on commit bcb304f

Please sign in to comment.