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
Labels
Merge Requests
104
Merge Requests
104
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
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):
...
@@ -249,21 +249,22 @@ class Recipe(object):
# The external information transfered from Slap Master has been processed
# The external information transfered from Slap Master has been processed
# so we extend with information gathered from partition resource file
# so we extend with information gathered from partition resource file
resource_home
=
instance_root
if
hasattr
(
slapformat
.
Partition
,
"resource_file"
):
while
not
os
.
path
.
exists
(
os
.
path
.
join
(
resource_home
,
slapformat
.
Partition
.
resource_file
)):
resource_home
=
instance_root
resource_home
=
os
.
path
.
normpath
(
os
.
path
.
join
(
resource_home
,
'..'
))
while
not
os
.
path
.
exists
(
os
.
path
.
join
(
resource_home
,
slapformat
.
Partition
.
resource_file
)):
if
resource_home
==
"/"
:
resource_home
=
os
.
path
.
normpath
(
os
.
path
.
join
(
resource_home
,
'..'
))
break
if
resource_home
==
"/"
:
else
:
break
# no break happened - let's add partition resources into options
else
:
logger
.
debug
(
"Using partition resource file {}"
.
format
(
# no break happened - let's add partition resources into options
os
.
path
.
join
(
resource_home
,
slapformat
.
Partition
.
resource_file
)))
logger
.
debug
(
"Using partition resource file {}"
.
format
(
with
open
(
os
.
path
.
join
(
resource_home
,
slapformat
.
Partition
.
resource_file
))
as
fi
:
os
.
path
.
join
(
resource_home
,
slapformat
.
Partition
.
resource_file
)))
partition_params
=
json
.
load
(
fi
)
with
open
(
os
.
path
.
join
(
resource_home
,
slapformat
.
Partition
.
resource_file
))
as
fi
:
# be very careful with overriding master's information
partition_params
=
json
.
load
(
fi
)
for
key
,
value
in
flatten_dict
(
partition_params
).
items
():
# be very careful with overriding master's information
if
key
not
in
options
:
for
key
,
value
in
flatten_dict
(
partition_params
).
items
():
options
[
key
]
=
value
if
key
not
in
options
:
options
[
key
]
=
value
# print out augmented options to see what we are passing
# print out augmented options to see what we are passing
logger
.
debug
(
str
(
options
))
logger
.
debug
(
str
(
options
))
return
self
.
_expandParameterDict
(
options
,
parameter_dict
)
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