Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-ganeti
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
snf-ganeti
Commits
5557b04c
Commit
5557b04c
authored
16 years ago
by
Michael Hanselmann
Browse files
Options
Downloads
Patches
Plain Diff
ganeti.bootstrap: Prepare for remote API certificate
Reviewed-by: amishchenko
parent
c4415fd5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/bootstrap.py
+8
-5
8 additions, 5 deletions
lib/bootstrap.py
with
8 additions
and
5 deletions
lib/bootstrap.py
+
8
−
5
View file @
5557b04c
...
...
@@ -322,15 +322,18 @@ def SetupNodeDaemon(cluster_name, node, ssh_key_check):
"""
sshrunner
=
ssh
.
SshRunner
(
cluster_name
)
gntpem
=
utils
.
ReadFile
(
constants
.
SSL_CERT_FILE
)
noded_cert
=
utils
.
ReadFile
(
constants
.
SSL_CERT_FILE
)
# in the base64 pem encoding, neither '!' nor '.' are valid chars,
# so we use this to detect an invalid certificate; as long as the
# cert doesn't contain this, the here-document will be correctly
# parsed by the shell sequence below
if
re
.
search
(
'
^!EOF\.
'
,
gntpem
,
re
.
MULTILINE
):
if
re
.
search
(
'
^!EOF\.
'
,
noded_cert
,
re
.
MULTILINE
):
raise
errors
.
OpExecError
(
"
invalid PEM encoding in the SSL certificate
"
)
if
not
gntpem
.
endswith
(
"
\n
"
):
raise
errors
.
OpExecError
(
"
PEM must end with newline
"
)
if
not
noded_cert
.
endswith
(
"
\n
"
):
noded_cert
+=
"
\n
"
# set up inter-node password and certificate and restarts the node daemon
# and then connect with ssh to set password and start ganeti-noded
...
...
@@ -339,7 +342,7 @@ def SetupNodeDaemon(cluster_name, node, ssh_key_check):
mycommand
=
(
"
umask 077 &&
"
"
cat >
'
%s
'
<<
'
!EOF.
'
&&
\n
"
"
%s!EOF.
\n
%s restart
"
%
(
constants
.
SSL_CERT_FILE
,
gntpem
,
(
constants
.
SSL_CERT_FILE
,
noded_cert
,
constants
.
NODE_INITD_SCRIPT
))
result
=
sshrunner
.
Run
(
node
,
'
root
'
,
mycommand
,
batch
=
False
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment