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
Xiaowu Zhang
slapos.toolbox
Commits
5b34159b
Commit
5b34159b
authored
8 years ago
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: realpath function shouldn't fail if unneeded paths are not present in the config
This also makes the function easier to test
parent
6bceac64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
slapos/runner/utils.py
slapos/runner/utils.py
+5
-10
No files found.
slapos/runner/utils.py
View file @
5b34159b
...
...
@@ -129,7 +129,7 @@ def getCurrentSoftwareReleaseProfile(config):
return
realpath
(
config
,
os
.
path
.
join
(
software_folder
,
config
[
'software_profile'
]))
# XXXX No Comments
except
:
except
IOError
:
return
''
...
...
@@ -762,16 +762,11 @@ def realpath(config, path, check_exist=True):
"""
split_path = path.split('
/
')
key = split_path[0]
allow_list = {
'
software_root
': config['
software_root
'],
'
instance_root
': config['
instance_root
'],
'
workspace
': config['
workspace
'],
'
runner_workdir
': config['
runner_workdir
'],
'
software_link
': config['
software_link
']
}
if key not in allow_list:
virtual_path_list = ('
software_root
', '
instance_root
', '
workspace
',
'
runner_workdir
', '
software_link
')
if key not in virtual_path_list:
return ''
allow_list = {path: config[path] for path in virtual_path_list if path in config}
del split_path[0]
path = os.path.join(allow_list[key], *split_path)
if check_exist:
...
...
This diff is collapsed.
Click to expand it.
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