Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
verktoy
kindnavsync
Commits
8f4a9cb1
Commit
8f4a9cb1
authored
Mar 03, 2021
by
Vegard Vesterheim
Browse files
Updated according to comments in MR
!2
parent
c0623f2c
Changes
3
Hide whitespace changes
Inline
Side-by-side
bin/nettinst2room
View file @
8f4a9cb1
...
...
@@ -13,20 +13,12 @@ import collections.abc
import
copy
import
urllib.parse
# FIXME: why do I need this
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
"__file__"
),
".."
))
)
from
kindnavsync.navapi
import
NAVAPI
,
ObjectNotFound
# FIXME
# NAV_API_URL = "http://localhost/api/1"
NAV_API_URL
=
"https://uninavn.uninett.no/api/1"
NAV_API_URL
=
"https://uninav.uninett.no/api/1"
NAV_API_TIMEOUT
=
10.0
# FIXME
# KIND_SERVICE_URL = 'http://localhost:7080/api/nettinstallasjoner.json'
KIND_SERVICE_URL
=
"https://kind.uninett.no/api/nettinstallasjoner.json"
DEFAULT_ORGANIZATION
=
"uninett"
...
...
@@ -118,11 +110,8 @@ def merge_dict(d, updates):
def
get_kind_data
(
room
):
url
=
KIND_SERVICE_URL
if
room
:
url
=
KIND_SERVICE_URL
+
"?navn="
+
urllib
.
parse
.
quote
(
room
)
LOG
.
debug
(
"Fetching data from: %s"
,
url
)
return
requests
.
get
(
url
).
json
()
LOG
.
debug
(
"Fetching data from: %s"
,
KIND_SERVICE_URL
)
return
requests
.
get
(
KIND_SERVICE_URL
,
params
=
{
'navn'
:
room
}).
json
()
def
parse_args
():
...
...
requirements.txt
View file @
8f4a9cb1
requests
==2.22.0
simple_rest_client
==0.5.4
slack-log-handler
==0.3.0
deepdiff
setup.py
View file @
8f4a9cb1
...
...
@@ -16,6 +16,7 @@ setup(
'requests'
,
'simple_rest_client'
,
'slack_log_handler'
,
'deepdiff'
,
],
python_requires
=
'>3.4.0'
,
classifiers
=
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment