Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos-caddy
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Guillaume Hervier
slapos-caddy
Commits
ea41a867
Commit
ea41a867
authored
Sep 13, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pbs: adds migration code for management of known_host file
parent
f6501731
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
slapos/recipe/pbs.py
slapos/recipe/pbs.py
+4
-0
No files found.
slapos/recipe/pbs.py
View file @
ea41a867
...
@@ -254,6 +254,10 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
...
@@ -254,6 +254,10 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
# Create known_hosts file by default.
# Create known_hosts file by default.
# In some case, we don't want to create it (case where we share IP mong partitions)
# In some case, we don't want to create it (case where we share IP mong partitions)
if
not
self
.
isTrueValue
(
self
.
options
.
get
(
'ignore-known-hosts-file'
)):
if
not
self
.
isTrueValue
(
self
.
options
.
get
(
'ignore-known-hosts-file'
)):
# Migration code: if known_hosts file contains entry with just IP, then it
# is updated to use [IP]:port. It allows to share same IP among partitions
if
parsed_url
.
hostname
in
known_hosts_file
:
del
known_hosts_file
[
parsed_url
.
hostname
]
known_hostname
=
"[%s]:%s"
%
(
parsed_url
.
hostname
,
parsed_url
.
port
)
known_hostname
=
"[%s]:%s"
%
(
parsed_url
.
hostname
,
parsed_url
.
port
)
known_hosts_file
[
known_hostname
]
=
entry
[
'server-key'
].
strip
()
known_hosts_file
[
known_hostname
]
=
entry
[
'server-key'
].
strip
()
...
...
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