Project

General

Profile

Bug #11272

ceph-disk zap should ensure block device

Added by Travis Rhoden over 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
03/30/2015
Due date:
% Done:

0%

Source:
other
Tags:
Backport:
hammer
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

If you try to zap a directory, you get an ugly traceback:

[gqas014][INFO  ] Running command: sudo /usr/sbin/ceph-disk zap /dev/sdc
[gqas014][WARNIN] Traceback (most recent call last):
[gqas014][WARNIN]   File "/usr/sbin/ceph-disk", line 2768, in <module>
[gqas014][WARNIN]     main()
[gqas014][WARNIN]   File "/usr/sbin/ceph-disk", line 2746, in main
[gqas014][WARNIN]     args.func(args)
[gqas014][WARNIN]   File "/usr/sbin/ceph-disk", line 2464, in main_zap
[gqas014][WARNIN]     zap(dev)
[gqas014][WARNIN]   File "/usr/sbin/ceph-disk", line 1013, in zap
[gqas014][WARNIN]     with file(dev, 'wb') as dev_file:
[gqas014][WARNIN] IOError: [Errno 21] Is a directory: '/dev/sdc'
[gqas014][ERROR ] RuntimeError: command returned non-zero exit status: 1
[ceph_deploy][ERROR ] RuntimeError: Failed to execute command: /usr/sbin/ceph-disk zap /dev/sdc

Related issues

Copied to Ceph - Backport #12589: ceph-disk zap should ensure block device Resolved 03/30/2015

Associated revisions

Revision 8e1bcf21 (diff)
Added by Loic Dachary over 3 years ago

ceph-disk: always check zap is applied on a full device

zap only makes sense on a full device and this is verified for

ceph-disk prepare --zap-disk

but not for

ceph-disk zap

Unify the two and add a test to check that it fails as expected when
trying to zap a directory.

http://tracker.ceph.com/issues/11272 Fixes: #11272

Signed-off-by: Loic Dachary <>

Revision 3e128637 (diff)
Added by Loic Dachary over 3 years ago

tests: ceph-disk.sh test zap gitbuilder false negative

When looking for an error message and testing ceph disk zap, use grep -q
to not display the error message that will be mistaken for a real error
by the gitbuilder parser.

http://tracker.ceph.com/issues/11272 Refs: #11272

Signed-off-by: Loic Dachary <>

Revision a4783853 (diff)
Added by Loic Dachary about 3 years ago

ceph-disk: always check zap is applied on a full device

zap only makes sense on a full device and this is verified for

ceph-disk prepare --zap-disk

but not for

ceph-disk zap

Unify the two and add a test to check that it fails as expected when
trying to zap a directory.

http://tracker.ceph.com/issues/11272 Fixes: #11272

Signed-off-by: Loic Dachary <>
(cherry picked from commit 8e1bcf21f090fc98ac9b495d76614e3012f5872a)

Conflicts:
src/test/ceph-disk.sh : trivial resolution

History

#1 Updated by Loic Dachary over 3 years ago

  • Status changed from New to Need Review
  • Assignee set to Loic Dachary
  • Regression set to No

#2 Updated by Loic Dachary over 3 years ago

  • Status changed from Need Review to Resolved

#3 Updated by Ken Dreyer over 3 years ago

  • Status changed from Resolved to Pending Backport
  • Backport set to hammer

We're cherry-picking this downstream in RHCS 1.3, so it would be great to get it fixed upstream in Hammer too!

#4 Updated by Loic Dachary about 3 years ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF