18 Commits

Author SHA1 Message Date
Thiago da Silva
a7c5ca0806 Fix locking in swift-recon-cron
The previous locking method would leave the lock dir lying around
if the process died unexpectedly, preventing others swift-recon-cron
process from running sucessfuly and requiring a manual clean.

Change-Id: Icb328b2766057a2a4d126f63e2d6dfa5163dd223
2018-08-15 21:51:14 +00:00
Zuul
0bc52a6036 Merge "swift-recon-cron: do not get confused by files in /srv/node" 2018-04-13 04:14:31 +00:00
Clay Gerrard
55a1b63db5 Let recon-cron work with conf.d
Change-Id: I862b74e0d9b20ba149581c1add6473dc1e5b2859
2018-01-11 12:36:45 -08:00
Stefan Majewsky
9d12575102 swift-recon-cron: do not get confused by files in /srv/node
swift-recon-cron looks at the drives mounted in directories below
/srv/node, but before this commit, it tried to call listdir() on
everything in this directory, even if it is not a directory.

Change-Id: Id281352f7ab6ecb520eb00f3649873d8c8678608
Signed-off-by: Stefan Majewsky <stefan.majewsky@sap.com>
2016-10-19 12:14:11 +02: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
janonymous
78cb608ff7 Python3: Fix Remaining issues of python3 compatibility in bin directory
Changes Of py3 in bin :

* https://review.openstack.org/#/c/196835/
* ConfigParser from six.moves

Change-Id: Ic0374c8e09dfd595ec12c4d31b17dad30eaa803c
2015-07-24 19:30:04 +05:30
Daisuke Morita
2792fe81a9 Show the sum of every policy's amount in /recon/async
After the release of Swift ver. 2.0.0, some recon responses do not
show each policy's information yet. To make things worse, some recon
results only count on policy-0's score, therefore the total is not
shown in the recon results.

With this patch, async_pending count of recon results becomes
policy-aware. Suppose a number of async_pending files for policy-0 is 2
and a number for policy-1 is 3, recon sums up every policy's amount
as follows.

$ curl http://<host>:<port>/recon/async
{"async_pending": 5} # It showed 2 before this commit

Related-Bug: 1375332
Change-Id: Ifc88b8c9e06b9f022a926a87ed807e938e1e0412
2014-11-14 20:47:04 +09:00
Florian Hines
f9d14971c2 Don't report async pendings on exception
If we encounter an exception trying to gather async pendings 'async'
doesn't exist and the cronjob ends up erroring out and leaving behind a
stale lock file.

Change-Id: I70a6d3f00bd2c9ce742e6d16af93804280707040
2014-01-04 00:19:22 -06:00
Monty Taylor
5a785aa5ee Add missing copyright license headers
We're working on adding enforcement that things have appropriate
copyright license headers. In anticipation of that, fix the files that don't
have them.

Change-Id: Ie0a9fd5eece5b6671ff4389b07b69ca29be7d017
2013-08-07 17:50:32 -03:00
Alex Gaynor
0f3b0410e3 Removed unnecessary monkeypatching of __builtin__
Replaced it with explicitly importing the gettext function, which is
significantly more readable.

Change-Id: Ia0a7edcf685fb6e4052a8290367b233169529ab8
2013-07-27 21:34:35 -07:00
Dirk Mueller
8aba2d602e Start using Hacking
Instead of blacklisting Hacking globally,
only blacklist those that currently occur frequently
(for a later followup patch), and fix the rest. In
detail:

H101  Use TODO(NAME)
H201  no 'except:' at least use 'except Exception:'
H231  octal number 022 should be written as 0o22
H401  docstring should not start with a space
H701  Empty localization string

Change-Id: Ib3b3d56b68d1cf15d3b67ac9749fcbdb876dc52a
2013-07-15 11:41:58 +02:00
Florian Hines
ccb6334c17 Expand recon middleware support
Expand recon middleware to include support for account and container
servers in addition to the existing object servers. Also add support
for retrieving recent information from auditors, replicators, and
updaters. In the case of certain checks (such as container auditors)
the stats returned are only for the most recent path processed.

The middleware has also been refactored and should now also handle
errors better in cases where stats are unavailable.

While new check's have been added the output from pre-existing
check's has not changed. This should allow existing 3rd party
utilities such as the Swift ZenPack to continue to function.

Change-Id: Ib9893a77b9b8a2f03179f2a73639bc4a6e264df7
2012-05-24 14:50:00 -05:00
Samuel Merritt
47f0dbb125 One PEP8 fix to make tox happy again.
Change-Id: I5ff2056f9f2eb99bfb98b020e3fc013332100e12
2012-05-09 12:28:00 -07:00
Brent Roskos
0d640971cd Fix related to bug #994502
Added support for configuring lock file location.
added an additional error handler.

Change-Id: I3635ed9694b9fb8526e0ca0591dc731da03a7128
2012-05-04 06:59:45 -04:00
Florian Hines
e9b5cb83ac simplejson import and exception/logging fixes 2011-09-01 13:46:13 -05:00
Florian Hines
8b6126984c object-replicator now optionally updates recon stats directly. also updated swift-recon-cron with a cleaner python version. 2011-08-31 02:14:35 -05:00
Florian Hines
749892338b few fixes to temp cronjob 2011-07-27 22:29:23 -05:00
Florian Hines
aa622eb799 recon middlewear for the object server and utils for cluster monitoring 2011-07-27 10:41:07 -05:00