Commit fda29151 authored by Qarnot computing's avatar Qarnot computing

Fixup sla mock

parent 393421d6
......@@ -128,22 +128,18 @@ class SLARCClientFake(SLARCClient):
# Also, we'll only generate the 'downtime' SLO as it's the only one that will
# be used by upper level anyway.
slo_8c = SLO(id='83e5ca70-29ee-455c-8dc7-9a5606750fec' + itl.uuid, objective='downtime',
target_value=10, current_value=1, unit='minutes', status='active')
slo_2c = SLO(id='bb8778f3-3249-4c3a-a73b-0d71a7c97d8b' + itl.uuid, objective='downtime',
target_value=10, current_value=1, unit='minutes', status='active')
slo_1c = SLO(id='babc8f62-f33e-4b06-85a3-559ff7232839' + itl.uuid, objective='downtime',
target_value=10, current_value=1, unit='minutes', status='active')
slo = SLO(id='00000000-1111-1111-1111-111111111111' + itl.uuid, objective='downtime',
# target_value=10, current_value=10 - int(itl.uuid[-1:]), unit='minutes', status='active')
target_value=10, current_value=int(itl.uuid[-1:]), unit='minutes', status='active')
sla_status = SLAStatus(id='00000000-2222-2222-2222-222222222222', entity_type='uuid',
entity_id=itl.uuid, valid_from=datetime.now(timezone.utc), valid_until=datetime.now(timezone.utc),
status='active', slos=[slo_8c, slo_2c, slo_1c])
status='active', slos=[slo])
return sla_status
class SLARCClientHttp(SLARCClient):
def __init__(self, remote_endpoint):
self._remote_endpoint = remote_endpoint
......@@ -155,9 +151,8 @@ class SLARCClientHttp(SLARCClient):
return urljoin(urljoin(self._remote_endpoint, 'api/slas/by-type/uuid/'), itl.uuid)
async def get_sla_status_for_itl(self, itl: ITLoad) -> SLAStatus:
log.debug("Getting SLA status for %s, with URI %s", itl.uuid, self._query_uri_for_itl(itl))
log.debug("Getting SLA status for %s, with URI ", itl.uuid)
response = await self._http_session.get(url=self._query_uri_for_itl(itl))
response.raise_for_status()
json_sla_status = await response.json()
log.debug("SLA json: %s", json_sla_status)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment