-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ncm-ceph: fix user for known_hosts and fix output for destroy and restart #595
Conversation
50fd52b
to
72fed66
Compare
@@ -161,8 +161,8 @@ sub ssh_known_keys { | |||
if (!$lines) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for looking at something that is not in the diff, but whaty's the purpose of this? It looks like you only care on whether the output is empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
($key_accept eq 'first') means: only add the ssh key blindy if it is not already there. If it is there, it will not replace it, it only does that when key_accept is 'always'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, github isn't showing you what I meant. I meant this chunk (expand the context):
my $cmd = ['/usr/bin/ssh-keygen', '-F', $host];
my $output = $self->run_command_as_ceph($cmd);
# Count the lines of the output
my $lines = $output =~ tr/\n//;
if (!$lines) {
Why do you need to count lines at all? It looks to me like you're doing something if there is output and something if there isn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to trim the newlines, because of the behaviour of ssh-keygen:
[kwaegema@daenerys ~]$ bla=`ssh-keygen -F gastlyf.ugent.be`
[kwaegema@daenerys ~]$ echo $bla
[kwaegema@daenerys ~]$
@kwaegema minor remark and update branch |
rebase instead of update branch |
done |
@stdweird rebased again |
@gvasilak can you have a look over this? |
Also @GRyall... |
ncm-ceph: fix user for known_hosts and fix output for destroy and restart
fixes #585 and #586