Skip to content

stored: list all devices if device is invalid/missing#2122

Merged
BareosBot merged 7 commits intobareos:masterfrom
florian-at-bareos:issue2051
Feb 10, 2025
Merged

stored: list all devices if device is invalid/missing#2122
BareosBot merged 7 commits intobareos:masterfrom
florian-at-bareos:issue2051

Conversation

@florian-at-bareos
Copy link
Contributor

@florian-at-bareos florian-at-bareos commented Jan 16, 2025

Fixes #2051: bareos commandline tools should show available
devicenames if a device is required and was not correctly specified

Note that this applies for all storage utilities.

Thank you for contributing to the Bareos Project!

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
    Required backport PRs have been created
  • Correct milestone is set
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
Tests
  • Decision taken that a test is required (if not, then remove this paragraph)
  • The choice of the type of test (unit test or systemtest) is reasonable
  • Testname matches exactly what is being tested
  • On a fail, output of the test leads quickly to the origin of the fault

@florian-at-bareos florian-at-bareos changed the title list available devices if invalid device specified stored: list all devices if device is invalid Jan 17, 2025
@florian-at-bareos florian-at-bareos marked this pull request as ready for review January 17, 2025 11:58
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

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

The linked issue also asked for this list to be printed if no device name was given. I think to do this you need to remove the required clause from device_names and handle the .size() == 0 case explicitly.

@florian-at-bareos
Copy link
Contributor Author

florian-at-bareos commented Jan 23, 2025

The linked issue also asked for this list to be printed if no device name was given. I think to do this you need to remove the required clause from device_names and handle the .size() == 0 case explicitly.

I don't know if this is worth it, because removing the required clause from device_names creates confusion in the manual where it is stated that specifying devices is optional where it actually isn't. The same applies if one wants to have an option (e.g. --available-devices) to output the valid devices where we basically have to remove 'required' from every parameter of the command line tool.

@sebsura
Copy link
Contributor

sebsura commented Jan 24, 2025

I think its definitely worth it. If you dont remember that you need to enter a device name, then you will probably also not remember that you need to put in a nonsense name to get the actual list of candidate devices.

This feature makes the most sense when it gets executed when you forget to input the device name imo.

@florian-at-bareos florian-at-bareos force-pushed the issue2051 branch 2 times, most recently from 4f7de54 to ee39a82 Compare January 27, 2025 12:47
@sebsura sebsura changed the title stored: list all devices if device is invalid stored: list all devices if device is invalid/missing Feb 3, 2025
@sebsura sebsura added this to the 25.0.0 milestone Feb 3, 2025
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

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

Thanks for your work!

florian-at-bareos and others added 7 commits February 10, 2025 16:21
Fixes bareos#2051: bareos commandline tools should show available
devicenames if a device is required and was not correctly specified

Note that this applies for the storage utilities bscan, bextract, bls
and bcopy.
This test also checks whether all available devices are printed if none
is specified.
@BareosBot BareosBot merged commit 1eeb25f into bareos:master Feb 10, 2025
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.

bareos commandline tools should show available devicenames if a device is required and was not correctly specified

3 participants