Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos-mynij-dev
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mynij
slapos-mynij-dev
Commits
1b4653ad
Commit
1b4653ad
authored
Feb 18, 2021
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/jupyter: Unserialize connection parameters
parent
1fcf1800
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
21 deletions
+7
-21
software/jupyter/buildout.hash.cfg
software/jupyter/buildout.hash.cfg
+1
-1
software/jupyter/instance-jupyter.cfg.in
software/jupyter/instance-jupyter.cfg.in
+1
-1
software/jupyter/test/test.py
software/jupyter/test/test.py
+5
-19
No files found.
software/jupyter/buildout.hash.cfg
View file @
1b4653ad
...
...
@@ -19,7 +19,7 @@ md5sum = de37ec3d4adb0be4c67bcc7397f27c91
[instance-jupyter]
filename = instance-jupyter.cfg.in
md5sum =
38bbb350a07ad2bb9f01b46122231708
md5sum =
cbc90e517ae3680ab8bef04c6f503af5
[jupyter-notebook-config]
filename = jupyter_notebook_config.py.jinja
...
...
software/jupyter/instance-jupyter.cfg.in
View file @
1b4653ad
...
...
@@ -175,7 +175,7 @@ instance-configuration =
raw jupyter-password ${jupyter-password:passwd}
[publish-connection-parameter]
recipe = slapos.cookbook:publish
.serialised
recipe = slapos.cookbook:publish
jupyter-classic-url = ${request-slave-frontend:connection-secure_access}/tree
url = ${:jupyter-classic-url}
jupyterlab-url = ${request-slave-frontend:connection-secure_access}/lab
...
...
software/jupyter/test/test.py
View file @
1b4653ad
...
...
@@ -43,12 +43,7 @@ setUpModule, InstanceTestCase = makeModuleSetUpAndTestCaseClass(
class
TestJupyter
(
InstanceTestCase
):
def
test
(
self
):
parameter_dict
=
self
.
computer_partition
.
getConnectionParameterDict
()
self
.
assertTrue
(
'_'
in
parameter_dict
)
try
:
connection_dict
=
json
.
loads
(
parameter_dict
[
'_'
])
except
Exception
as
e
:
self
.
fail
(
"Can't parse json in %s, error %s"
%
(
parameter_dict
[
'_'
],
e
))
connection_dict
=
self
.
computer_partition
.
getConnectionParameterDict
()
self
.
assertTrue
(
'password'
in
connection_dict
)
password
=
connection_dict
[
'password'
]
...
...
@@ -92,15 +87,11 @@ class TestJupyterAdditional(InstanceTestCase):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'frontend-additional-instance-guid'
:
'SOMETHING'
}
'frontend-additional-instance-guid'
:
'SOMETHING'
}
def
test
(
self
):
parameter_dict
=
self
.
computer_partition
.
getConnectionParameterDict
()
self
.
assertTrue
(
'_'
in
parameter_dict
)
try
:
connection_dict
=
json
.
loads
(
parameter_dict
[
'_'
])
except
Exception
as
e
:
self
.
fail
(
"Can't parse json in %s, error %s"
%
(
parameter_dict
[
'_'
],
e
))
connection_dict
=
self
.
computer_partition
.
getConnectionParameterDict
()
result
=
requests
.
get
(
connection_dict
[
'url'
],
verify
=
False
,
allow_redirects
=
False
)
...
...
@@ -151,12 +142,7 @@ class TestJupyterAdditional(InstanceTestCase):
class
TestJupyterPassword
(
InstanceTestCase
):
def
test
(
self
):
parameter_dict
=
self
.
computer_partition
.
getConnectionParameterDict
()
self
.
assertTrue
(
'_'
in
parameter_dict
)
try
:
connection_dict
=
json
.
loads
(
parameter_dict
[
'_'
])
except
Exception
as
e
:
self
.
fail
(
"Can't parse json in %s, error %s"
%
(
parameter_dict
[
'_'
],
e
))
connection_dict
=
self
.
computer_partition
.
getConnectionParameterDict
()
url
=
connection_dict
[
'url'
]
with
requests
.
Session
()
as
s
:
...
...
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