#2257 PR merged
: Do not abort in case of invalid user input but retry¶
Labels: enhancement
, cleanup
, fixed / solved / done
jsmeix opened issue at 2019-10-18 13:03:¶
-
Type: Enhancement
-
Impact: Low
-
Reference to related issue (URL):
https://github.com/rear/rear/issues/2253 -
How was this pull request tested?
I tested the plain code by running it as a separated script
and for me the input seems to work o.k.
but I cannot actually test it with TSM or NBU
because I have neither of them. -
Brief description of the changes in this pull request:
Let the user enter date and time again and again until the input is
valid
or the user pressed only ENTER to restore the most recent available
backup.
Replaced 'LogPrint' with 'UserOutput' because
the former shows messsages only in verbose mode
while the latter shows messages always to the user
(this does not matter in practice during 'rear recover'
but 'UserOutput' is the ceaner code for user output
and I noticed that in my separated test script).
jsmeix commented at 2019-10-18 13:05:¶
@schabrolles
perhaps -if time permits - you could even test it with TSM?
@gdha
I would appreciate it if you could have a look at the plain code,
perhaps you notice something suspicious?
jsmeix commented at 2019-10-18 13:09:¶
There is also
verify/GALAXY10/default/550_request_point_in_time_restore_parameters.sh
which could benefit from such an enhancement.
The following scripts look also suspicious:
# find usr/share/rear -name '*.sh' | xargs grep -l WAIT_SECS
usr/share/rear/restore/DP/default/460_press_y_to_continue.sh
usr/share/rear/restore/DUPLICITY/default/400_restore_duplicity.sh
usr/share/rear/verify/default/040_validate_variables.sh
usr/share/rear/verify/DP/default/500_select_dp_restore.sh
usr/share/rear/verify/DP/default/450_request_gui_restore.sh
usr/share/rear/verify/NBU/default/380_request_client_destination.sh
usr/share/rear/verify/TSM/default/400_verify_tsm.sh
For next week (if time permits)...
jsmeix commented at 2019-10-21 10:13:¶
When there are no objections I would like to "just merged" it
so that things could be tested by users "out there"
as long as ReaR 2.6 is still under development.
jsmeix commented at 2019-10-22 07:15:¶
I think this one is sufficiently complete and consistent now
so that - if there are no objections - I would merge it today afternoon.
I kept WAIT_SECS as separated user config variable for now
but I think in the future WAIT_SECS should be removed
and only USER_INPUT_TIMEOUT should be kept and
the remaining direct read
calls should be replaced
by UserInput
in a future ReaR 3.0 version, cf.
https://github.com/rear/rear/issues/1390
and
https://github.com/rear/rear/issues/1705
jsmeix commented at 2019-10-23 08:58:¶
I "just merged" it so that things can be tested right now
as long as ReaR 2.6 is still under development.
Please report if there are regressions so that I can fix them,
ideally each one as a new and separated GitHub issue.
jsmeix commented at 2019-10-23 09:02:¶
With
https://github.com/rear/rear/pull/2257
merged plus
https://github.com/rear/rear/commit/08f59566a968681771b64bfc5c791b34b8384cf5
I think this issue is solved as far as possible for me for now
and hopefully even without regressions.
I would appreciate it if ReaR users in particular those who
use BACKUP=TSM or BACKUP=NBU or BACKUP=GALAXY10
could test that changes as long as ReaR 2.6 is still under development
and report if there are regressions so that I can fix them,
preferably each one as a new and separated GitHub issue.
[Export of Github issue for rear/rear.]