Removing several devices doesn't work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Swift Proxy Charm |
Fix Released
|
Medium
|
Bartłomiej Poniecki-Klotz |
Bug Description
Everything on the docs of the remove-devices action, even the name, indicates it should be possible to remove more than device at a time. But that's currently not working due to swift-ring-builder asking for user confirmation by default whenever more than one device matches. This behavior can be overriden by passing it the -y flag.
For instance:
$ sudo swift-ring-builder /etc/swift/
Devices: id region zone ip address port replication ip replication port name weight partitions balance meta
27 1 1 ww.xx.yy.zz 6001 ww.xx.yy.zz 6001 sdf 100.00 4234 -2.01
28 1 1 ww.xx.yy.zz 6001 ww.xx.yy.zz 6001 sdg 100.00 4233 -2.04
29 1 1 ww.xx.yy.zz 6001 ww.xx.yy.zz 6001 sde 100.00 4233 -2.04
And you try to remove all of that host's devices:
$ juju run-action --wait swift-proxy/4 remove-devices ring=all search-
UnitId: swift-proxy/4
id: "11180"
message: 'Failed to remove device(s) for ww.xx.yy.zz pattern on /etc/swift/
Output: Command ''[''swift-
''ww.
results:
Stderr: |
Traceback (most recent call last):
File "/usr/bin/
File "/usr/lib/
File "/usr/lib/
File "/usr/lib/
if not opts.yes and input(input_
EOFError: EOF when reading a line
Stdout: |
Matched more than one device:
status: failed
timing:
completed: 2021-07-22 13:46:35 +0000 UTC
I believe this patch should be applied:
--- lib/swift_
+++ lib/swift_utils.py 2021-07-22 13:59:22.560895296 +0000
@@ -570,7 +570,7 @@
:type search_value: str
:raises: SwiftProxyCharm
"""
- cmd = ['swift-
+ cmd = ['swift-
try:
except subprocess.
Changed in charm-swift-proxy: | |
importance: | Undecided → Medium |
status: | New → Triaged |
tags: | added: good-first-bug |
Changed in charm-swift-proxy: | |
assignee: | nobody → Bartłomiej Poniecki-Klotz (barteus) |
Changed in charm-swift-proxy: | |
milestone: | none → 22.04 |
Changed in charm-swift-proxy: | |
status: | Fix Committed → Fix Released |
Fix proposed to branch: master /review. opendev. org/c/openstack /charm- swift-proxy/ +/814415
Review: https:/