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
Levin Zimmermann
slapos
Commits
066a340c
Commit
066a340c
authored
Jun 13, 2017
by
Tomáš Peterka
Committed by
Rafael Monnerat
Jun 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[slapconfiguration] Don't expect new attributes to exist on all machines
parent
dfd4d114
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
slapos/recipe/slapconfiguration.py
slapos/recipe/slapconfiguration.py
+16
-15
No files found.
slapos/recipe/slapconfiguration.py
View file @
066a340c
...
...
@@ -249,21 +249,22 @@ class Recipe(object):
# The external information transfered from Slap Master has been processed
# so we extend with information gathered from partition resource file
resource_home
=
instance_root
while
not
os
.
path
.
exists
(
os
.
path
.
join
(
resource_home
,
slapformat
.
Partition
.
resource_file
)):
resource_home
=
os
.
path
.
normpath
(
os
.
path
.
join
(
resource_home
,
'..'
))
if
resource_home
==
"/"
:
break
else
:
# no break happened - let's add partition resources into options
logger
.
debug
(
"Using partition resource file {}"
.
format
(
os
.
path
.
join
(
resource_home
,
slapformat
.
Partition
.
resource_file
)))
with
open
(
os
.
path
.
join
(
resource_home
,
slapformat
.
Partition
.
resource_file
))
as
fi
:
partition_params
=
json
.
load
(
fi
)
# be very careful with overriding master's information
for
key
,
value
in
flatten_dict
(
partition_params
).
items
():
if
key
not
in
options
:
options
[
key
]
=
value
if
hasattr
(
slapformat
.
Partition
,
"resource_file"
):
resource_home
=
instance_root
while
not
os
.
path
.
exists
(
os
.
path
.
join
(
resource_home
,
slapformat
.
Partition
.
resource_file
)):
resource_home
=
os
.
path
.
normpath
(
os
.
path
.
join
(
resource_home
,
'..'
))
if
resource_home
==
"/"
:
break
else
:
# no break happened - let's add partition resources into options
logger
.
debug
(
"Using partition resource file {}"
.
format
(
os
.
path
.
join
(
resource_home
,
slapformat
.
Partition
.
resource_file
)))
with
open
(
os
.
path
.
join
(
resource_home
,
slapformat
.
Partition
.
resource_file
))
as
fi
:
partition_params
=
json
.
load
(
fi
)
# be very careful with overriding master's information
for
key
,
value
in
flatten_dict
(
partition_params
).
items
():
if
key
not
in
options
:
options
[
key
]
=
value
# print out augmented options to see what we are passing
logger
.
debug
(
str
(
options
))
return
self
.
_expandParameterDict
(
options
,
parameter_dict
)
...
...
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