Skip to content

mgr/cephadm: Prevent unnecessary SSH reconfiguration#36492

Merged
sebastian-philipp merged 1 commit intoceph:masterfrom
ricardoasmarques:prevent-unnecessary-ssh-reconfiguration
Aug 7, 2020
Merged

mgr/cephadm: Prevent unnecessary SSH reconfiguration#36492
sebastian-philipp merged 1 commit intoceph:masterfrom
ricardoasmarques:prevent-unnecessary-ssh-reconfiguration

Conversation

@ricardoasmarques
Copy link
Contributor

When set-user, set-pub-key or set-priv-key are called "two" times with the same value, we can ignore the "second" call:

# ceph cephadm set-pub-key -i pub_key 
# ceph cephadm set-pub-key -i pub_key 
value already set

This will prevent unnecessary SSH reconfiguration and connections reset.

Signed-off-by: Ricardo Marques rimarques@suse.com


Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

Copy link
Contributor

@tchaikov tchaikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you prefix the title of your commit message with the subcomponent your are changing ? see https://github.com/ceph/ceph/blob/master/SubmittingPatches.rst#3-describe-your-changes

@ricardoasmarques ricardoasmarques force-pushed the prevent-unnecessary-ssh-reconfiguration branch from 3349dfd to 00e71d3 Compare August 6, 2020 12:19
@ricardoasmarques ricardoasmarques changed the title Prevent unnecessary SSH reconfiguration mgr/cephadm: Prevent unnecessary SSH reconfiguration Aug 6, 2020
@ricardoasmarques
Copy link
Contributor Author

could you prefix the title of your commit message with the subcomponent your are changing ? see https://github.com/ceph/ceph/blob/master/SubmittingPatches.rst#3-describe-your-changes

Fixed, thanks.

Copy link
Contributor

@mgfritch mgfritch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also extend this to set-ssh-config?

if inbuf is None or len(inbuf) == 0:
return -errno.EINVAL, "", "empty ssh config provided"
self.set_store("ssh_config", inbuf)
self.log.info('Set ssh_config')
self._reconfig_ssh()

When 'set-user', 'set-pub-key' or 'set-priv-key' are called two
times with the same value, we can ignore the second call.

Signed-off-by: Ricardo Marques <rimarques@suse.com>
@ricardoasmarques ricardoasmarques force-pushed the prevent-unnecessary-ssh-reconfiguration branch from 00e71d3 to 4cbf587 Compare August 6, 2020 15:53
@ricardoasmarques
Copy link
Contributor Author

also extend this to set-ssh-config?

if inbuf is None or len(inbuf) == 0:
return -errno.EINVAL, "", "empty ssh config provided"
self.set_store("ssh_config", inbuf)
self.log.info('Set ssh_config')
self._reconfig_ssh()

@mgfritch I've implemented the same behaviour on set-ssh-config.

I've also changed the message to make it more clear that SSH is not reconfigured because the value has not changed.

@tchaikov tchaikov dismissed their stale review August 6, 2020 15:56

dismissed

Copy link
Contributor

@mgfritch mgfritch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

if ssh_config_fname:
self.validate_ssh_config_fname(ssh_config_fname)
ssh_options += ['-F', ssh_config_fname]
self.ssh_config = ssh_config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@sebastian-philipp sebastian-philipp added the wip-swagner-testing My Teuthology tests label Aug 7, 2020
@sebastian-philipp
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants