Skip to content

Commit

Permalink
drop date override from OCP flow (#4606)
Browse files Browse the repository at this point in the history
* drop date override from OCP flow since its not required.
  • Loading branch information
lcouzens authored Aug 3, 2023
1 parent c9ef539 commit b451f56
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 80 deletions.
26 changes: 0 additions & 26 deletions koku/masu/processor/ocp/ocp_report_parquet_summary_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# SPDX-License-Identifier: Apache-2.0
#
"""Updates report summary tables in the database."""
import calendar
import logging
from datetime import datetime

Expand All @@ -17,7 +16,6 @@
from masu.external.date_accessor import DateAccessor
from masu.processor.ocp.ocp_cloud_updater_base import OCPCloudUpdaterBase
from masu.util.common import date_range_pair
from masu.util.common import determine_if_full_summary_update_needed
from masu.util.ocp.common import get_cluster_alias_from_cluster_id
from masu.util.ocp.common import get_cluster_id_from_provider
from reporting.provider.ocp.models import UI_SUMMARY_TABLES
Expand Down Expand Up @@ -50,30 +48,6 @@ def __init__(self, schema, provider, manifest):

def _get_sql_inputs(self, start_date, end_date):
"""Get the required inputs for running summary SQL."""
with OCPReportDBAccessor(self._schema) as accessor:
# This is the normal processing route
if self._manifest:
# Override the bill date to correspond with the manifest
bill_date = self._manifest.billing_period_start_datetime.date()
report_periods = accessor.get_usage_period_query_by_provider(self._provider.uuid)
report_periods = report_periods.filter(report_period_start=bill_date).all()
first_period = report_periods.first()
do_month_update = False
with schema_context(self._schema):
if first_period:
do_month_update = determine_if_full_summary_update_needed(first_period)
if do_month_update:
last_day_of_month = calendar.monthrange(bill_date.year, bill_date.month)[1]
start_date = bill_date
end_date = bill_date.replace(day=last_day_of_month)
if (
bill_date.year == self._date_accessor.today().year
and bill_date.month == self._date_accessor.today().month
):
end_date = bill_date.replace(day=self._date_accessor.today().day)
LOG.info(
log_json(msg="overriding start and end date to process full month", context=self._context)
)

if isinstance(start_date, str):
start_date = ciso8601.parse_datetime(start_date).date()
Expand Down

This file was deleted.

0 comments on commit b451f56

Please sign in to comment.