swift-get-nodes doesn't handle blank args well
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Low
|
Unassigned |
Bug Description
Good news is, the traceback makes the trouble fairly obvious:
$ swift-get-nodes /etc/swift/
Account
Container cont
Object None
Traceback (most recent call last):
File "/usr/local/
File "/vagrant/
File "/vagrant/
File "/vagrant/
raise ValueError("No partition or account/
ValueError: No partition or account/
Still, we could handle it better, though.
Reviewed: https:/ /review. opendev. org/724141 /git.openstack. org/cgit/ openstack/ swift/commit/ ?id=1dfa41dada3 0c139129cb2771b 0d68c95fd84e32
Committed: https:/
Submitter: Zuul
Branch: master
commit 1dfa41dada30c13 9129cb2771b0d68 c95fd84e32
Author: Tim Burke <email address hidden>
Date: Tue Apr 28 10:45:27 2020 -0700
swift- get-nodes: Allow users to specify either quoted or unquoted paths
Now that we can have null bytes in Swift paths, we need a way for
operators to be able to locate such containers and objects. Our usual
trick of making sure the name is properly quoted for the shell won't
suffice; running something like
has the path get cut off after "AUTH_test/" because of how argv works.
So, add a new option, --quoted, to let operators indicate that they
already quoted the path.
Drive-bys:
* If account, container, or object are explicitly blank, treat them
as though they were not provided. This provides better errors when
account is explicitly blank, for example.
* If account, container, or object are not provided or explicitly
blank, skip printing them. This resolves abiguities about things
like objects whose name is actually "None".
* When displaying account, container, and object, quote them (since
they may contain newlines or other control characters).
Change-Id: I3d10e121b403de 7533cc3671604bc bdecb02c795 369680374e8233d a85d8d38f85
Related-Change: If912f71d8b0d03
Closes-Bug: #1875734
Closes-Bug: #1875735
Closes-Bug: #1875736
Related-Bug: #1791302