Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
Alain Takoudjou
slapos.toolbox
Commits
fff3f953
Commit
fff3f953
authored
Jul 25, 2012
by
Antoine Catton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace OrderedDict by simple dict
Mybad, OrderedDict is not needed, moreover it reduces performances.
parent
68ef8900
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
slapos/container/config.py
slapos/container/config.py
+2
-3
slapos/container/prepare.py
slapos/container/prepare.py
+0
-1
No files found.
slapos/container/config.py
View file @
fff3f953
# -*- coding: utf-8 -*-
import
collections
import
StringIO
class
LXCConfig
(
object
):
...
...
@@ -39,7 +38,7 @@ class LXCConfig(object):
with
open
(
filename
,
'r'
)
as
lxcconf_file
:
self
.
_values
=
self
.
_load
(
lxcconf_file
.
read
())
else
:
self
.
_values
=
collections
.
OrderedD
ict
()
self
.
_values
=
d
ict
()
def
__getattr__
(
self
,
name
):
return
self
.
_get
(
name
)
...
...
@@ -51,7 +50,7 @@ class LXCConfig(object):
self
.
_set
(
name
,
value
)
def
_load
(
self
,
config_string
):
result
=
collections
.
OrderedD
ict
()
result
=
d
ict
()
for
line
in
config_string
.
split
(
'
\
n
'
):
if
not
line
.
strip
().
startswith
(
'#'
)
and
line
.
strip
()
!=
''
:
if
'='
not
in
line
:
...
...
slapos/container/prepare.py
View file @
fff3f953
...
...
@@ -49,7 +49,6 @@ def main(sr_directory, partition_list):
def
start
(
sr_directory
,
partition_path
):
return
lxc_start
=
os
.
path
.
join
(
sr_directory
,
'parts/lxc/bin/lxc-start'
)
config_filename
=
os
.
path
.
join
(
partition_path
,
'config'
)
...
...
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