Bug 986747 - ssm: ssm -f doesn't work when creating or adding
ssm: ssm -f doesn't work when creating or adding
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: system-storage-manager (Show other bugs)
All All
unspecified Severity medium
: rc
: ---
Assigned To: Lukáš Czerner
Petr Beňas
Depends On:
  Show dependency treegraph
Reported: 2013-07-21 22:41 EDT by Jimmy Pan
Modified: 2015-07-19 20:55 EDT (History)
4 users (show)

See Also:
Fixed In Version: system-storage-manager-0.4-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-06-13 05:46:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jimmy Pan 2013-07-21 22:41:33 EDT
Description of problem:
ssm -f should answer y to interactive questions, but it doesn't work when in create or add command when removing device from existent pool

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. setup loop devices with dd (/dev/loop0, /dev/loop1, /dev/loop2)
2. ssm add /dev/loop{0,1,2}
3. ssm -f create -p pool2 /dev/loop1
4. ssm -f add -p pool3 /dev/loop2

Actual results:
ssm still ask user to confirm whether remove device from another pool when use create or add command

ssm -f create -p pool2 /dev/loop1
Device '/dev/loop1' is already used in the 'lvm_pool'! Remove (N/y/q) ? N
Device '/dev/loop1' can not be used!!
"Error (2001): Device '/dev/loop1' can not be used!!"

ssm -f add -p pool3 /dev/loop2
Device '/dev/loop2' is already used in the 'lvm_pool'! Remove (N/y/q) ? N
No devices available to use for the 'pool3' pool!
Traceback (most recent call last):
  File "/usr/bin/ssm", line 33, in <module>
  File "/usr/lib/python2.7/site-packages/ssmlib/main.py", line 1485, in main
  File "/usr/lib/python2.7/site-packages/ssmlib/main.py", line 1008, in add
    PR.check(PR.NO_DEVICES, args.pool.name)
  File "/usr/lib/python2.7/site-packages/ssmlib/problem.py", line 275, in check
    raise exc(message)
  File "/usr/lib/python2.7/site-packages/ssmlib/problem.py", line 108, in __init__
    super(NoDevice, self).__init__(msg, errcode)
NameError: global name 'NoDevice' is not defined

Expected results:
Devices should be removed without confirmation and used to create the new pool

Additional info:
Comment 2 Lukáš Czerner 2013-07-31 07:12:04 EDT
This was fixed upstream with ea0d52abdfaa90b727f31bb81770951738281439.

Comment 3 Lukáš Czerner 2013-07-31 07:17:17 EDT
Correction, the trace was fixed by that commit. However you'll be still prompted even though -f has been provided.

Problem with making 'force' to work for everything is that we're actually using stack of tools and in this case you usually want to 'force' only the removal. However what if you're creating a file system, do you want to force it as well ? There is actually no way to tell.

No sure how to resolve this right now...

Comment 4 Lukáš Czerner 2013-08-06 09:40:56 EDT
Fixed upstream with https://sourceforge.net/p/storagemanager/code/ci/bb76641a30ff428021df6f99b0f3e32211e1e9a6/

Comment 5 Lukáš Czerner 2013-08-08 08:29:59 EDT
Building in system-storage-manager-0.4-1.el7
Comment 8 Petr Beňas 2013-10-31 12:14:35 EDT
Reproduced in system-storage-manager-0.3-1.el7.noarch and verified in system-storage-manager-0.4-1.el7.noarch.
Comment 9 Ludek Smid 2014-06-13 05:46:08 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Note You need to log in before you can comment on or make changes to this bug.