Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
79d58689
Commit
79d58689
authored
Aug 06, 2012
by
Antoine Catton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TO REVERT: Pass the name of the slapos bridge to the buildout
parent
4c0de183
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
+26
-6
slapos/grid/SlapObject.py
slapos/grid/SlapObject.py
+5
-2
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+20
-4
slapos/grid/templates/buildout-tail.cfg.in
slapos/grid/templates/buildout-tail.cfg.in
+1
-0
No files found.
slapos/grid/SlapObject.py
View file @
79d58689
...
...
@@ -269,7 +269,8 @@ class Partition(object):
gid
=
stat_info
.
st_gid
return
(
uid
,
gid
)
def
install
(
self
):
# XXX : Remove bridge_name argument as soon as possible :
def
install
(
self
,
bridge_name
=
None
):
""" Creates configuration file from template in software_path, then
installs the software partition with the help of buildout
"""
...
...
@@ -309,7 +310,9 @@ class Partition(object):
server_url
=
self
.
server_url
,
software_release_url
=
self
.
software_release_url
,
key_file
=
self
.
key_file
,
cert_file
=
self
.
cert_file
cert_file
=
self
.
cert_file
,
# XXX : Remove the line below as soon as possible # XXX
bridge_name
=
bridge_name
,
# XXX
)
open
(
config_location
,
'w'
).
write
(
buildout_text
)
os
.
chmod
(
config_location
,
0640
)
...
...
slapos/grid/slapgrid.py
View file @
79d58689
...
...
@@ -139,6 +139,11 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
slapgrid_configuration
.
readfp
(
configuration_file
)
# Merges the two dictionnaries
option_dict
=
dict
(
slapgrid_configuration
.
items
(
"slapos"
))
# XXX : Remove the lines below as soon as possible # XXX
option_dict
.
update
(
bridge_name
=
slapgrid_configuration
.
get
(
'slapformat'
,
# XXX
'interface_name'
))
# XXX
if
slapgrid_configuration
.
has_section
(
"networkcache"
):
option_dict
.
update
(
dict
(
slapgrid_configuration
.
items
(
"networkcache"
)))
for
argument_key
,
argument_value
in
vars
(
argument_option_instance
...
...
@@ -266,7 +271,9 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
shacache_key_file
=
option_dict
.
get
(
'shacache-key-file'
,
None
),
shadir_cert_file
=
option_dict
.
get
(
'shadir-cert-file'
,
None
),
shadir_key_file
=
option_dict
.
get
(
'shadir-key-file'
,
None
),
develop
=
option_dict
.
get
(
'develop'
,
False
)
develop
=
option_dict
.
get
(
'develop'
,
False
),
# XXX: Remove the line below as soon as possible # XXX
bridge_name
=
option_dict
.
get
(
'bridge_name'
,
None
),
# XXX
),
option_dict
])
...
...
@@ -354,7 +361,8 @@ class Slapgrid(object):
shacache_key_file
=
None
,
shadir_cert_file
=
None
,
shadir_key_file
=
None
,
develop
=
False
):
develop
=
False
,
bridge_name
=
None
):
"""Makes easy initialisation of class parameters"""
# Parses arguments
self
.
software_root
=
os
.
path
.
abspath
(
software_root
)
...
...
@@ -395,6 +403,8 @@ class Slapgrid(object):
self
.
buildout
=
buildout
self
.
promise_timeout
=
promise_timeout
self
.
develop
=
develop
# XXX: Remove the line below as soon as possible # XXX
self
.
bridge_name
=
bridge_name
# XXX
def
checkEnvironmentAndCreateStructure
(
self
):
"""Checks for software_root and instance_root existence, then creates
...
...
@@ -616,13 +626,19 @@ class Slapgrid(object):
try
:
computer_partition_state
=
computer_partition
.
getState
()
if
computer_partition_state
==
"started"
:
local_partition
.
install
()
# XXX : Before
# local_partition.install()
# XXX : Rollback the line bellow asap
local_partition
.
install
(
bridge_name
=
self
.
bridge_name
)
computer_partition
.
available
()
local_partition
.
start
()
self
.
_checkPromises
(
computer_partition
)
computer_partition
.
started
()
elif
computer_partition_state
==
"stopped"
:
local_partition
.
install
()
# XXX : Before
# local_partition.install()
# XXX : Rollback the line bellow asap
local_partition
.
install
(
bridge_name
=
self
.
bridge_name
)
computer_partition
.
available
()
local_partition
.
stop
()
computer_partition
.
stopped
()
...
...
slapos/grid/templates/buildout-tail.cfg.in
View file @
79d58689
...
...
@@ -13,4 +13,5 @@ server_url = %(server_url)s
software_release_url = %(software_release_url)s
key_file = %(key_file)s
cert_file = %(cert_file)s
bridge_name = %(bridge_name)s
# This is end of zc.builodout profile's tail added by slapgrid
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