Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aura-engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Kruse
aura-engine
Commits
8d04a182
Commit
8d04a182
authored
5 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Fixes to make Fetcher compatible with new logic.
parent
0d1f509c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/scheduling/calender_fetcher.py
+6
-5
6 additions, 5 deletions
modules/scheduling/calender_fetcher.py
with
6 additions
and
5 deletions
modules/scheduling/calender_fetcher.py
+
6
−
5
View file @
8d04a182
...
...
@@ -29,7 +29,7 @@ class CalendarFetcher:
# fetch upcoming schedules from STEERING
try
:
self
.
logger
.
debug
(
"
Fetching schedules from STEERING
"
)
self
.
__fetch_schedule_data__
()
self
.
fetched_schedule_data
=
self
.
__fetch_schedule_data__
()
except
urllib
.
error
.
HTTPError
as
e
:
self
.
logger
.
critical
(
"
Cannot fetch from
"
+
self
.
url
[
"
calendar
"
]
+
"
! Reason:
"
+
str
(
e
))
self
.
fetched_schedule_data
=
None
...
...
@@ -89,6 +89,7 @@ class CalendarFetcher:
# ------------------------------------------------------------------------------------------ #
def
__fetch_schedule_data__
(
self
):
servicetype
=
"
calendar
"
schedule
=
None
# fetch data from steering
...
...
@@ -118,7 +119,7 @@ class CalendarFetcher:
self
.
logger
.
critical
(
"
no JSON data checks. I believe what i get here
"
)
#self.fetched_schedule_data = self.remove_unnecessary_data(schedule)
return
self
.
remove_unnecessary_data
(
schedule
_from_pv
)
return
self
.
remove_unnecessary_data
(
schedule
)
# ------------------------------------------------------------------------------------------ #
def
__fetch_schedule_playlists__
(
self
):
...
...
@@ -219,12 +220,12 @@ class CalendarFetcher:
# Send request to the API and read the data
try
:
if
type
not
in
self
.
data
:
if
type
not
in
self
.
url_parameter
:
if
self
.
url
[
type
]
==
""
:
return
False
request
=
urllib
.
request
.
Request
(
url
)
else
:
request
=
urllib
.
request
.
Request
(
url
,
self
.
data
[
type
])
request
=
urllib
.
request
.
Request
(
url
,
self
.
url_parameter
[
type
])
response
=
urllib
.
request
.
urlopen
(
request
)
html_response
=
response
.
read
()
...
...
@@ -252,7 +253,7 @@ class CalendarFetcher:
schedule
=
self
.
remove_data_in_the_past
(
schedule
)
count_after
=
len
(
schedule
)
self
.
logger
.
info
(
"
Removed %d unnecessary schedules from response.
"
%
(
count_before
-
count_after
))
self
.
logger
.
info
(
"
Removed %d unnecessary schedules from response.
Entries left: %d
"
%
(
(
count_before
-
count_after
),
count_after
))
return
schedule
# ------------------------------------------------------------------------------------------ #
def
remove_data_more_than_24h_in_the_future
(
self
,
schedule_from_pv
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment