Skip to content
Snippets Groups Projects
Commit 9a602f38 authored by Henrik Thostrup Jensen's avatar Henrik Thostrup Jensen
Browse files

allow not specifying end time in protocol stack

parent b0e464fd
No related branches found
No related tags found
No related merge requests found
...@@ -72,7 +72,7 @@ class ProviderClient: ...@@ -72,7 +72,7 @@ class ProviderClient:
schedule = nsiconnection.ScheduleType( schedule = nsiconnection.ScheduleType(
xmlhelper.createXMLTime(criteria.schedule.start_time) if criteria.schedule.start_time is not None else None, xmlhelper.createXMLTime(criteria.schedule.start_time) if criteria.schedule.start_time is not None else None,
xmlhelper.createXMLTime(criteria.schedule.end_time) xmlhelper.createXMLTime(criteria.schedule.end_time) if criteria.schedule.end_time is not None else None
) )
sd = criteria.service_def sd = criteria.service_def
......
...@@ -94,7 +94,7 @@ class ProviderService: ...@@ -94,7 +94,7 @@ class ProviderService:
# create DTOs (EROs not supported yet) # create DTOs (EROs not supported yet)
start_time = xmlhelper.parseXMLTimestamp(criteria.schedule.startTime) if criteria.schedule.startTime is not None else None start_time = xmlhelper.parseXMLTimestamp(criteria.schedule.startTime) if criteria.schedule.startTime is not None else None
end_time = xmlhelper.parseXMLTimestamp(criteria.schedule.endTime) end_time = xmlhelper.parseXMLTimestamp(criteria.schedule.endTime) if criteria.schedule.endTime is not None else None
schedule = nsa.Schedule(start_time, end_time) schedule = nsa.Schedule(start_time, end_time)
src_stp = helper.createSTP(p2ps.sourceSTP) src_stp = helper.createSTP(p2ps.sourceSTP)
......
...@@ -107,8 +107,11 @@ class RequesterClient: ...@@ -107,8 +107,11 @@ class RequesterClient:
else: else:
start_time = None start_time = None
assert schedule.end_time.tzinfo is None, 'End time must NOT have time zone' if schedule.end_time is not None:
end_time = schedule.end_time.replace(tzinfo=UTC()).isoformat() assert schedule.end_time.tzinfo is None, 'End time must NOT have time zone'
end_time = schedule.end_time.replace(tzinfo=UTC()).isoformat()
else:
end_time = None
if not type(sd) is nsa.Point2PointService: if not type(sd) is nsa.Point2PointService:
raise ValueError('Cannot create request for service definition of type %s' % str(type(sd))) raise ValueError('Cannot create request for service definition of type %s' % str(type(sd)))
......
...@@ -71,7 +71,7 @@ class RequesterService: ...@@ -71,7 +71,7 @@ class RequesterService:
# Create DTOs - this overlaps heavily with the parsing done in providerservice - unify sometime # Create DTOs - this overlaps heavily with the parsing done in providerservice - unify sometime
start_time = xmlhelper.parseXMLTimestamp(criteria.schedule.startTime) if criteria.schedule.startTime is not None else None start_time = xmlhelper.parseXMLTimestamp(criteria.schedule.startTime) if criteria.schedule.startTime is not None else None
end_time = xmlhelper.parseXMLTimestamp(criteria.schedule.endTime) end_time = xmlhelper.parseXMLTimestamp(criteria.schedule.endTime) if criteria.schedule.endTime is not None else None
schedule = nsa.Schedule(start_time, end_time) schedule = nsa.Schedule(start_time, end_time)
# check for service type sometime # check for service type sometime
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment