Commit Graph

32 Commits

Author SHA1 Message Date
Tim Burke c8de76c7fd swift-account-audit: Log the bad status
Change-Id: Ib28d1948a571acf31926df82dd8c24910c227053
2021-04-08 17:34:49 -07:00
Zuul 02aea34c46 Merge "swift-account-audit: work with encryption" 2020-01-22 16:59:19 +00:00
Zuul f4fc811862 Merge "swift-account-audit: clean up some error formatting" 2019-10-16 04:03:03 +00:00
Tim Burke 3e90ddb37d swift-account-audit: clean up some error formatting
"127.0.0.1s:sdas" is confusing at best.

Change-Id: I37f78d5993082ac29b001e9563aa4b24fd009a27
2019-10-14 11:21:22 -07:00
Tim Burke 2f4fe56ca4 py3: fix swift-account-audit
Previously, we'd get a KeyError trying to read headers.

Change-Id: I5d9f86784a3e39577ab010d29d8d03b26ffda357
2019-10-14 11:21:06 -07:00
Tim Burke e58840c571 swift-account-audit: work with encryption
Change-Id: I26c5fe9d45a9765da0d30138ea2df16fd4e73d57
2019-10-14 11:01:59 -07:00
Tim Burke 79905ae794 Replace SOSO auth prefix in examples with more-standard AUTH
Change-Id: I98643d6acf248840a8360f31e446bc8ecb834898
2017-09-27 23:49:59 +00:00
Tim Burke 4716d3da11 swift-account-audit: compare each etag to the hash from container
...rather than only comparing the ETag from the last response over and
over again.

NB: This tool *does not* like EC data :-(

Change-Id: Idd37f94b07f607ab8a404dd986760361c39af029
Closes-Bug: 1266636
2017-09-27 23:49:59 +00:00
Tim Burke a741998bff Turn on F812 check
F812 list comprehension redefines <variable> from line ...

While the current violations were benign, this sort of code can easily
lead to subtle bugs. Seems worth checking, especially given how cheap it
is to bring existing code in line with it.

Change-Id: Ibdcf9f93b85a1f1411198001df6bdbfa8f92d114
2016-09-16 14:44:37 -07:00
Tim Burke 9890184ea9 Turn on H233 and start using print function
As much as anything, I'm just tired of seeing a bunch or piecemeal
fixes.

Note that we *need* to include

   from __future__ import print_function

in order to support things like

   print()  # Would print "()" (the repr of an empty tuple) otherwise
   print(foo, end='')  # Would SyntaxError
   print(bar, file=sys.stderr)  # Would SyntaxError

Change-Id: I8fdf0740e292eb1ee785512d02e8c552781dcae1
2016-07-08 16:19:52 +00:00
Zack M. Davis 1b8b08039a remove remaining simplejson uses, prefer standard library import
a1c32702, 736cf54a, and 38787d0f remove uses of `simplejson` from
various parts of Swift in favor of the standard libary `json`
module (introduced in Python 2.6). This commit performs the remaining
`simplejson` to `json` replacements, removes two comments highlighting
quirks of simplejson with respect to Unicode, and removes the references
to it in setup documentation and requirements.txt.

There were a lot of places where we were importing json from
swift.common.utils, which is less intuitive than a direct `import json`,
so that replacement is made as well.

(And in two more tiny drive-bys, we add some pretty-indenting to an XML
fragment and use `super` rather than naming a base class explicitly.)

Change-Id: I769e88dda7f76ce15cf7ce930dc1874d24f9498a
2015-11-16 12:34:24 -08:00
Victor Stinner c0af385173 py3: Replace urllib imports with six.moves.urllib
The urllib, urllib2 and urlparse modules of Python 2 were reorganized
into a new urllib namespace on Python 3. Replace urllib, urllib2 and
urlparse imports with six.moves.urllib to make the modified code
compatible with Python 2 and Python 3.

The initial patch was generated by the urllib operation of the sixer
tool on: bin/* swift/ test/.

Change-Id: I61a8c7fb7972eabc7da8dad3b3d34bceee5c5d93
2015-10-08 15:24:13 +02:00
ZhiQiang Fan f72704fc82 Change OpenStack LLC to Foundation
Change-Id: I7c3df47c31759dbeb3105f8883e2688ada848d58
Closes-bug: #1214176
2013-09-20 01:02:31 +08:00
Dirk Mueller 3d36a76156 Use Python 3.x compatible except construct
except x,y: was deprected and is removed in Python 3.x.
Use "except x as y:" instead which works in any Python
version >= 2.6.

Change-Id: I7008c74b807340f3457d3a0c8bd0b83f23169d14
2013-09-07 10:50:54 +02:00
Monty Taylor de2e5aa462 Update to flake8 instead of pep8.
Change-Id: I3d4a31111c3044da06611405ce80f208ef8a0ce3
2013-05-01 14:19:38 -04:00
Kun Huang 13eabdc744 Improve bin/swift-account-audit
1.Correct the usage of initializing a Ring object.
2.Fix typo.
3.Align lines of print_status part. (keep origin author mind)

note: Adam Kijak has commited it at early time, but didn't put it
      in Gerrit. I import his commit and send it in right Workflow.

Fixes: bug #1131901

Change-Id: If56316cc424045f7df662d60088382f7fd40e8b1
2013-02-24 20:04:30 +08:00
Joe Gordon 45f0502b52 Fix spelling mistakes
git ls-files | misspellings -f -
Source: https://github.com/lyda/misspell-check

Change-Id: I4132e6a276e44e2a8985238358533d315ee8d9c4
2013-02-12 16:39:40 -08: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
Chris Wedgwood 615d90b80d Show account names in output strings.
This helps when the output comes from concurrent workers doing the
checking as it's not strictly ordered.
2011-01-24 13:56:39 -08:00
Chris Wedgwood 4b4f07a039 Additional utf-8 encoding fixes to deal with containers. 2011-01-20 16:11:23 -08:00
Chris Wedgwood 92e3364622 Make sure we pass strings correctly to functions that will behave
badly otherwise (fix suggested by Chuck Thier).

Tweak account & container name output slightly (makes cut & paste
easier).
2011-01-20 14:57:06 -08:00
Chris Wedgwood 8a5f21b3ac Fix output formatting (missing tuple).
Fix to be robust when container and object counts are None (this
happens if accounts can't be located).
2011-01-18 12:08:22 -08:00
Chris Wedgwood e618dd567f Don't unnecessarily quote account, container or object values.
This fixed the problem where containers or objects with characters
that need quoting can't be audited because they aren't found.
2011-01-13 23:17:36 -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