aiidateam / aiida-core

The official repository for the AiiDA code
https://aiida-core.readthedocs.io
Other
435 stars 188 forks source link

`verdi computer configure ssh` on already configured host loads default boolean arguments instead of previous config #4952

Open dev-zero opened 3 years ago

dev-zero commented 3 years ago

Describe the bug

On reconfiguring an already setup host I noticed that the loaded defaults are the original defaults rather than the ones from the current configuration. Which is obviously annoying if you only want to change one thing and expect to be able to repeatedly hitting ENTER until you get to the value you want to change:

$ verdi computer configure show eiger
* username               timuel
* port                   22
* look_for_keys          False
* key_filename
* timeout                60
* allow_agent            False
* proxy_command          ssh -W eiger.cscs.ch:22 timuel@ela.cscs.ch
* compress               True
* gss_auth               False
* gss_kex                False
* gss_deleg_creds        False
* gss_host               eiger.cscs.ch
* load_system_host_keys  True
* key_policy             RejectPolicy
* use_login_shell        True
* safe_interval          30.0
$ verdi computer configure ssh eiger
Info: enter "?" for help
Info: enter "!" to ignore the default and set no value
User name [timuel]: 
Port number [22]: 
Look for keys [True]: 
SSH key file []: 
Connection timeout in s [60]: 
Allow ssh agent [True]: 
SSH proxy command [ssh -W eiger.cscs.ch:22 timuel@ela.cscs.ch]: 
Compress file transfers [True]: 
GSS auth [False]: 
GSS kex [False]: 
GSS deleg_creds [False]: 
GSS host [eiger.cscs.ch]: 
Load system host keys [True]: 
Key policy (RejectPolicy, WarningPolicy, AutoAddPolicy) [RejectPolicy]: 
Use login shell when executing command [True]: 
Connection cooldown time (s) [30.0]: 
Info: Configuring computer eiger for user tiziano.mueller@chem.uzh.ch.
Success: eiger successfully configured for tiziano.mueller@chem.uzh.ch

Expected behavior

Load all the defaults?

Your environment

sphuber commented 3 years ago

It seems that not all parameters have this problem, most of them actually load the value of the current configuration, do they not? The ones that don't seem to respect that are look_for_keys, allow_agent. At least those are different, there might of course be more keys that are affected but we don't notice because the values in your example config happen to be identical to the CLI defaults.

dev-zero commented 3 years ago

Yes, it is only the bool values which have the problem (see subject)

sphuber commented 3 years ago

Yes, it is only the bool values which have the problem (see subject)

Oops :smirk: sorry missed that part