Skip to content

feat: more descriptive messages when no sources are selected to backup - #1613

Merged
real-yfprojects merged 3 commits into
borgbase:masterfrom
diivi:feat/no-sources-descriptive-message
Mar 2, 2023
Merged

real-yfprojects merged 3 commits into
borgbase:masterfrom
diivi:feat/no-sources-descriptive-message

Conversation

@diivi

@diivi diivi commented Feb 26, 2023

Copy link
Copy Markdown
Contributor

fixes #1463
image

@real-yfprojects real-yfprojects left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think a change to create.py would be better suited.

@diivi

diivi commented Feb 27, 2023

Copy link
Copy Markdown
Contributor Author

I looked through create.py, but didn't understand how it can detect an error from borg.
The run method is responsible for executing a command, and only that method knows whether borg returned this error message.
This method is called from the JobsManager which should remain untouched.
So how can I parse the output that borg gives from a subclass of BorgJob, when only BorgJob actually runs the command? Thanks

@real-yfprojects

Copy link
Copy Markdown
Collaborator

While you can't catch the error in create.py you can foresee it. This is already done but not working correctly as we noticed:

if n_backup_folders == 0 and '--paths-from-command' not in extra_cmd_options:
ret['message'] = trans_late('messages', 'Add some folders to back up first.')
return ret

@real-yfprojects real-yfprojects left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great! This is exactly what I had in mind.

@real-yfprojects
real-yfprojects merged commit a00ed62 into borgbase:master Mar 2, 2023
ratchek pushed a commit to ratchek/vorta that referenced this pull request Apr 4, 2023
Fixes borgbase#1463. This makes the code count the database rows for the current profile only. 
Previously one could run a backup without any sources when one had sources configured in a different profile.

* src/vorta/borg/create.py (BorgCreateJob.prepare)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR: More descriptive message when there are no sources.

2 participants