Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
moodle_rebase10.1.2
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
Dmitry Blinov
moodle_rebase10.1.2
Commits
1ce3bb3f
Commit
1ce3bb3f
authored
Dec 06, 2011
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add slave system in kvm and kvm_frontend (WIP)
parent
b5cb205a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
9 deletions
+39
-9
slapos/recipe/kvm/__init__.py
slapos/recipe/kvm/__init__.py
+37
-7
slapos/recipe/kvm_frontend/__init__.py
slapos/recipe/kvm_frontend/__init__.py
+2
-2
No files found.
slapos/recipe/kvm/__init__.py
View file @
1ce3bb3f
...
...
@@ -35,6 +35,8 @@ import pkg_resources
import
ConfigParser
import
hashlib
FALSE_VALUE_LIST
=
[
'n'
,
'no'
,
'0'
,
'false'
]
class
Recipe
(
BaseSlapRecipe
):
# To avoid magic numbers
...
...
@@ -86,13 +88,41 @@ class Recipe(BaseSlapRecipe):
target_port
=
vnc_port
)
self
.
linkBinary
()
self
.
computer_partition
.
setConnectionDict
(
dict
(
url
=
"https://[%s]:%s/vnc_auto.html?host=[%s]&port=%s&encrypt=1"
%
(
noVNC_conf
[
'source_ip'
],
noVNC_conf
[
'source_port'
],
noVNC_conf
[
'source_ip'
],
noVNC_conf
[
'source_port'
]),
password
=
kvm_conf
[
'vnc_passwd'
]))
ipv6_url
=
'https://[%s]:%s/vnc_auto.html?host=[%s]&port=%s&encrypt=1'
%
(
noVNC_conf
[
'source_ip'
],
noVNC_conf
[
'source_port'
],
noVNC_conf
[
'source_ip'
],
noVNC_conf
[
'source_port'
])
# Request frontend slave instance, unless contrary is specified
# XXX-Cedric : HARDCODE : during dev, request is OPT-IN
request_frontend
=
self
.
parameter_dict
.
get
(
'frontend'
,
'false'
)
#request_frontend = self.parameter_dict.get('frontend', True)
if
not
request_frontend
in
FALSE_VALUE_LIST
:
slave_frontend
=
self
.
request
(
# XXX-Cedric : how to "de-hardcode" url?
software_release
=
'/opt/slapdev/software/kvm-frontend/software.cfg'
,
software_type
=
'RootInstanceSoftware'
,
partition_reference
=
'%s_frontend'
%
self
.
computer_partition_id
,
shared
=
True
)
url
=
'https://%s:%s/%s/vnc_auto.html?host=%s&port=%s&encrypt=1&path=%s'
%
(
# XXX-Cedric : uh? how to fetch slave url/port/reference?
slave_frontend
.
getParameter
(
'domain'
),
slave_frontend
.
getParameter
(
'port'
),
slave_frontend
.
get
(
'reference'
),
slave_frontend
.
getParameter
(
'domain'
),
slave_frontend
.
getParameter
(
'port'
),
slave_frontend
.
get
(
'reference'
))
connection_dict
=
dict
(
url
=
url
,
backend_url
=
ipv6_url
,
password
=
kvm_conf
[
'vnc_passwd'
])
else
:
connection_dict
=
dict
(
url
=
ipv6_url
,
password
=
kvm_conf
[
'vnc_passwd'
])
self
.
computer_partition
.
setConnectionDict
(
connection_dict
)
return
self
.
path_list
...
...
slapos/recipe/kvm_frontend/__init__.py
View file @
1ce3bb3f
...
...
@@ -101,10 +101,10 @@ class Recipe(BaseSlapRecipe):
for
reference
,
url
in
slave_dict
.
iteritems
():
self
.
setConnectionDict
(
dict
(
site_url
=
url
),
reference
)
# XXX-Cedric : how to get/set slave parameters?
self
.
setConnectionDict
(
dict
(
site_url
=
node_parameter_dict
[
'site_url'
],
domain_ipv6_address
=
self
.
getGlobalIPv6Address
(),
domain_ipv4_address
=
self
.
getLocalIPv4Address
()))
domain_ipv6_address
=
self
.
getGlobalIPv6Address
()))
return
self
.
path_list
def
installLogrotate
(
self
):
...
...
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