Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Nirina Malard
slapos
Commits
ee8e92db
Commit
ee8e92db
authored
Dec 09, 2011
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix behavior of slave instances between kvm and kvm frontend
parent
513a4660
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
slapos/recipe/kvm/__init__.py
slapos/recipe/kvm/__init__.py
+4
-3
slapos/recipe/kvm_frontend/__init__.py
slapos/recipe/kvm_frontend/__init__.py
+16
-4
No files found.
slapos/recipe/kvm/__init__.py
View file @
ee8e92db
...
...
@@ -106,11 +106,11 @@ class Recipe(BaseSlapRecipe):
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'
),
# XXX-Cedric : uh? how to fetch slave reference?
slave_frontend
.
getParameter
(
'domain
name
'
),
slave_frontend
.
getParameter
(
'port'
),
slave_frontend
.
get
(
'reference'
),
slave_frontend
.
getParameter
(
'domain'
),
slave_frontend
.
getParameter
(
'domain
name
'
),
slave_frontend
.
getParameter
(
'port'
),
slave_frontend
.
get
(
'reference'
))
connection_dict
=
dict
(
...
...
@@ -118,6 +118,7 @@ class Recipe(BaseSlapRecipe):
backend_url
=
ipv6_url
,
password
=
kvm_conf
[
'vnc_passwd'
])
else
:
# No frontend : just set raw IPv6
connection_dict
=
dict
(
url
=
ipv6_url
,
password
=
kvm_conf
[
'vnc_passwd'
])
...
...
slapos/recipe/kvm_frontend/__init__.py
View file @
ee8e92db
...
...
@@ -71,17 +71,19 @@ class Recipe(BaseSlapRecipe):
base_url
=
'https://%s:%s/'
%
(
frontend_domain_name
,
frontend_port_number
)
for
slave_instance
in
slave_instance_list
:
current_slave_dict
=
dict
()
current_slave_dict
[
'host'
]
=
slave_instance
.
get
(
'host'
)
current_slave_dict
[
'port'
]
=
slave_instance
.
get
(
'port'
)
current_slave_dict
[
'host'
]
=
slave_instance
.
get
ConnectionParameter
(
'host'
)
current_slave_dict
[
'port'
]
=
slave_instance
.
get
ConnectionParameter
(
'port'
)
if
current_slave_dict
[
'host'
]
is
None
\
or
current_slave_dict
[
'port'
]
is
None
:
continue
# Is target https or http?
current_slave_dict
[
'https'
]
=
slave_instance
.
get
(
'https'
,
'true'
)
current_slave_dict
[
'https'
]
=
slave_instance
.
getConnectionParameter
(
'https'
,
'true'
)
if
current_slave_dict
[
'https'
]
in
FALSE_VALUE_LIST
:
current_slave_dict
[
'https'
]
=
'false'
reference
=
slave_instance
.
get
(
'slave_reference'
)
# XXX-Cedric : how to fetch reference?
current_slave_dict
[
'reference'
]
=
reference
slave_dict
[
reference
]
=
"%s%s"
%
(
base_url
,
reference
.
replace
(
'-'
,
''
))
rewrite_rule_list
.
append
(
current_slave_dict
)
...
...
@@ -110,10 +112,20 @@ 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?
#
Send connection parameters of master instance
self
.
setConnectionDict
(
dict
(
site_url
=
node_parameter_dict
[
'site_url'
],
domain_ipv6_address
=
self
.
getGlobalIPv6Address
()))
# Send connection parameters of slave instances
for
slave_instance
in
slave_instance_list
:
slave_site_url
=
'%s%s'
%
(
node_parameter_dict
[
'site_url'
],
# XXX-Cedric reference?
slave_instance
.
get
(
'reference'
))
slave_instance
.
setConnectionDict
(
dict
(
site_url
=
slave_site_url
,
domainname
=
frontend_domain_name
),
port
=
frontend_port_number
)
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