Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
- job: copr_build
trigger: pull_request
identifier: copr_pull
manual_trigger: true
targets:
- fedora-all

Expand Down
11 changes: 1 addition & 10 deletions src/stratis_cli/_error_reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def _interpret_errors_2( # pylint: disable=too-many-return-statements

if dbus_name == "org.freedesktop.zbus.Error" and isinstance(
context, DPClientSetPropertyContext
): # pragma: no cover
):
return (
f"stratisd failed to perform the operation that you "
f"requested, because it could not set the D-Bus "
Expand Down Expand Up @@ -335,15 +335,6 @@ def _interpret_errors_2( # pylint: disable=too-many-return-statements
f"service sent the following message: {dbus_message}."
)

if isinstance(context, DPClientSetPropertyContext): # pragma: no cover
return (
f"stratisd failed to perform the operation that you "
f"requested, because it could not set the D-Bus "
f'property "{context.property_name}" belonging to '
f'interface "{error.interface_name}" to "{context.value}". '
f"It returned the following error: {dbus_message}."
)

if isinstance(context, DPClientGetPropertyContext): # pragma: no cover
return (
f"stratisd failed to perform the operation that you "
Expand Down
6 changes: 2 additions & 4 deletions tests/integration/logical/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ def setUp(self):

def test_creation(self):
"""
Creation of two volumes at once should fail.
Creation of two volumes at once should succeed.
"""
command_line = self._MENU + [self._POOLNAME] + self._VOLNAMES
self.check_error(StratisCliEngineError, command_line, _ERROR)
TEST_RUNNER(command_line)
Comment on lines +47 to +50
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's read the test file to see lines 47-50 and 109-110
cd tests/integration/logical && wc -l test_create.py

Repository: stratis-storage/stratis-cli

Length of output: 89


🏁 Script executed:

# Read the relevant sections of the test file
sed -n '40,115p' tests/integration/logical/test_create.py

Repository: stratis-storage/stratis-cli

Length of output: 2641


🏁 Script executed:

# Search for comments about filesystem/volume creation restrictions in the entire repository
rg -n -C3 -i 'only one filesystem|one volume per request|single filesystem per'

Repository: stratis-storage/stratis-cli

Length of output: 1257


Verify the actual restriction status and update the contradictory code accordingly.

The contradiction identified is real: Create3TestCase.test_creation() creates two volumes in a single call, but Create5TestCase.setUp() explicitly splits volume creation into separate calls with the comment "only one filesystem per request is currently allowed." This inconsistency indicates either:

  1. The restriction has been lifted and the comment at lines 109-110 (and similar comment in test_destroy.py line 85) should be removed.
  2. The test at lines 47-50 is incorrect and should split the volume creation to match the documented restriction.

Clarify which scenario applies and update the code and comments accordingly.

🧰 Tools
🪛 Ruff (0.14.10)

49-49: Consider [*self._MENU, self._POOLNAME, *self._VOLNAMES] instead of concatenation

Replace with [*self._MENU, self._POOLNAME, *self._VOLNAMES]

(RUF005)



class Create4TestCase(SimTestCase):
Expand Down Expand Up @@ -106,8 +106,6 @@ def setUp(self):
command_line = ["pool", "create", self._POOLNAME] + _DEVICE_STRATEGY()
RUNNER(command_line)

# Creation of two volumes is split up into two calls to RUNNER,
# since only one filesystem per request is currently allowed.
command_line = self._MENU + [self._POOLNAME] + self._VOLNAMES[0:1]
RUNNER(command_line)

Expand Down
Loading