Skip to content
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

Do not abort in case of invalid user input but retry #2257

Conversation

jsmeix
Copy link
Member

@jsmeix jsmeix commented Oct 18, 2019

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 jsmeix added enhancement Adaptions and new features cleanup labels Oct 18, 2019
@jsmeix jsmeix added this to the ReaR v2.6 milestone Oct 18, 2019
@jsmeix jsmeix self-assigned this Oct 18, 2019
@jsmeix
Copy link
Member Author

jsmeix commented Oct 18, 2019

@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
Copy link
Member Author

jsmeix commented Oct 18, 2019

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
Copy link
Member Author

jsmeix commented Oct 21, 2019

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
Copy link
Member Author

jsmeix commented Oct 22, 2019

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.
#1390
and
#1705

@jsmeix jsmeix merged commit d43a09f into rear:master Oct 23, 2019
@jsmeix jsmeix deleted the do_not_abort_in_case_of_invalid_user_input_but_retry_issue2253 branch October 23, 2019 08:56
@jsmeix
Copy link
Member Author

jsmeix commented Oct 23, 2019

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
Copy link
Member Author

jsmeix commented Oct 23, 2019

With #2257 merged plus
08f5956
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant