24 Commits

Author SHA1 Message Date
Zuul
2c7e12289f Merge "Optionally drop common prefixes in swift-*-info output" 2018-03-13 03:39:02 +00:00
Tim Burke
36c42974d6 py3: Port more CLI tools
Bring under test

 - test/unit/cli/test_dispersion_report.py
 - test/unit/cli/test_info.py and
 - test/unit/cli/test_relinker.py

I've verified that swift-*-info (at least) behave reasonably under
py3, even swift-object-info when there's non-utf8 metadata on the
data/meta file.

Change-Id: Ifed4b8059337c395e56f5e9f8d939c34fe4ff8dd
2018-02-28 21:10:01 +00:00
Tim Burke
f95befb37f Optionally drop common prefixes in swift-*-info output
Add a --drop-prefixes flag to swift-account-info, swift-container-info,
and swift-object-info. This makes the output between the three more
consistent.

Change-Id: I98252ff74c4983eaad0a93d9a9fc527c74ffce68
2017-09-13 22:47:04 +00:00
Christian Schwede
2410b616bb Fix swiftdir option and usage of storage policy aliases
If swift-recon/swift-get-nodes/swift-object-info is used with the
swiftdir option they will read rings from the given directory; however
they are still using /etc/swift/swift.conf to find the policies on the
current node.

This makes it impossible to maintain a local swift.conf copy (if you
don't have write access to /etc/swift) or check multiple clusters from
the same node.

Until now swift-recon was also not usable with storage policy aliases,
this patch fixes this as well.

Closes-Bug: 1577582
Closes-Bug: 1604707
Closes-Bug: 1617951
Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Co-Authored-By: Thiago da Silva <thiago@redhat.com>
Change-Id: I13188d42ec19e32e4420739eacd1e5b454af2ae3
2017-07-12 16:23:04 -04:00
Yuan Zhou
6cc10d17de Update bin scripts to be storage policy aware
swift-container-info:
    Print policy container info

swift-object-info:
    Allow to specify storage policy name when looking for object info
    Notify if there is missmatch between ring location and the actual
    object path in filesystem

swift-get-nodes:
    Allow to specify storage policy name when looking for account/
    container/object ring location
    Notify if there is missmatch between ring and the policy

Lookup policy name in swift.conf; 'Legacy' container will use
policy-0's name; 'Unknown' is shown if policy not found in swift.conf

DocImpact
Implements: blueprint storage-policies
Change-Id: I450d40dc6e2d8f759187dff36d658e52737ae2a5
2014-06-18 20:57:09 -07:00
Madhuri Kumari
a37f90b3f1 Removed hard coded location of ring
In bin/swift-object-info, removed the hard coded location of ring.

Change-Id: Ie328633f5f4de755c9dcc4bb52341bb97087419d
2014-03-25 16:14:00 +05:30
Samuel Merritt
92fc917b4b Let swift-object-info skip etag verification
Now swift-object-info has a "-n" option that will cause the etag
verification to be skipped; on large objects, the etag verification
takes the vast majority of the runtime, and sometimes you just want to
know which account owns the 5 GB monstrosity without waiting around while
its checksum is verified.

Change-Id: Id284570633eb7b98046cdb948d7c37a152de1195
2014-01-16 12:55:50 -08:00
Peter Portante
9411a24ba7 Revert "Refactor common/utils methods to common/ondisk"
This reverts commit 7760f41c3ce436cb23b4b8425db3749a3da33d32

Change-Id: I95e57a2563784a8cd5e995cc826afeac0eadbe62
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013-10-07 17:18:09 -04:00
Jenkins
111ebb9a4b Merge "Fix bad hash_path reference" 2013-10-07 21:08:13 +00:00
Peter Portante
61e135e211 Fix bad hash_path reference
Mea culpa: these two scripts were missed in commit:

  https://review.openstack.org/46956

Fixes bug 1235441

Change-Id: I4303bc808448a79bddbb991526b0cca26150b392
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2013-10-07 11:18:28 -04:00
ZhiQiang Fan
f72704fc82 Change OpenStack LLC to Foundation
Change-Id: I7c3df47c31759dbeb3105f8883e2688ada848d58
Closes-bug: #1214176
2013-09-20 01:02:31 +08:00
Kun Huang
63061e37ed Add notes for /srv/node in swift-object-info
'devices' is set in object-server.conf on each node, not in ring data,
and the things printed here is just for watching not for running, so
just leave a note here. (this https://review.openstack.org/#/c/23951/
is used for running, so just a note is not enough)

mark this commit as bug fixing is because this script is the last place
using /srv/node but not from conf as Chmouel said.

fixes import change on read_metadata
fixes bug #885006
Change-Id: I727ec2d01c093af61fd3895e5701d87ef67cd9ff
2013-07-23 13:46:51 +08:00
Monty Taylor
de2e5aa462 Update to flake8 instead of pep8.
Change-Id: I3d4a31111c3044da06611405ce80f208ef8a0ce3
2013-05-01 14:19:38 -04:00
Samuel Merritt
35f4d29ed6 Upgrade pep8 to 1.3.3.
This required a bunch of whitespace-poking of the scripts in bin, but
that's all. Now every file in swift/ and bin/ is pep8-1.3.3-compliant,
so hopefully we can be done with this pep8 stuff for a good long time.

Change-Id: I44fdb41d219c57400a4c396ab7eb0ffa9dcd8db8
2012-11-26 18:15:21 -08:00
Samuel Merritt
2ccf219ec1 Make scripts in bin/ PEP8-compliant.
Also made tox's PEP8 check look at the scripts in bin/ to keep them
PEP8-compliant.

Change-Id: I710365ea929d7fc15578d5f742a236bad47ef28e
2012-05-04 08:24:51 -07:00
Jenkins
6682138b0a Merge "Make ring class interface slightly more abstracted from implementation." 2012-03-22 20:25:06 +00:00
John Dickinson
1ecf5ebba1 updated copyright date for all files
Change-Id: Ifd909d3561c2647770a7e0caa3cd91acd1b4f298
2012-03-19 13:45:34 -05:00
Michael Barton
e008c2ebb8 Make ring class interface slightly more abstracted from implementation.
Change-Id: I0f55d61c7b8de30460f17a69e5d9946494dbda6e
2012-03-14 22:00:30 +00:00
David Goetz
51ce438f7f changing /usr/bin/python to /usr/bin/env python 2011-03-24 15:51:44 -07:00
David Goetz
86cb12036b removing blank excepts 2011-01-26 14:31:33 -08:00
Anne Gentle
8823427161 Changed copyright notices on py files and the single rst file with a copyright notice 2011-01-04 17:34:43 -06:00
gholt
57970bdeb5 Cleaned up the bins; patched the broken test (when run standalone) 2010-12-29 12:00:08 -08:00
Michael Barton
f432269013 add gettext to all binaries 2010-12-22 17:18:30 +00:00
Monty Taylor
76e6c6ea6c Renamed bin files in the tree so that setup.py install does the same thing
as a deb install.
2010-07-14 09:58:38 -05:00