Support of openstack-swift from liberty #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have openstack-swift liberty and i have some issues with some checks:
/etc/scripts/check_swift_object_servers
Usage:
usage: swift-recon <server_type> [-v] [--suppress] [-a] [-r] [-u] [-d]
[-l] [-T] [--md5] [--auditor] [--updater] [--expirer] [--sockstat]
[--human-readable]
swift-recon: error: no such option: --objmd5
/etc/scripts/check_swift_dispersion /etc/swift/dispersion.conf
/usr/lib/python2.7/site-packages/keystoneclient/service_catalog.py:196: UserWarning: Providing attr without filter_value to get_urls() is deprecated as of the 1.7.0 release and may be removed in the 2.0.0 release. Either both should be provided or neither should be provided.
'Providing attr without filter_value to get_urls() is '
Traceback (most recent call last):
File "/etc/scripts/check_swift_dispersion", line 41, in
stats = json.load(report)
File "/usr/lib64/python2.7/json/init.py", line 290, in load
**kw)
File "/usr/lib64/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 365, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 383, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
So i propose the following changes:
--- check_swift_dispersion.orig 2015-10-28 12:25:13.295319852 +0000
+++ check_swift_dispersion 2015-10-28 12:26:04.662768280 +0000
@@ -32,11 +32,11 @@
STATE_UNKNOWN=3
STATE_DEPENDENT=4
-dispersion_config = os.getenv("SWIFT_DISPERSION_CONFIG", "/etc/swift/swift.conf")
+dispersion_config = os.getenv("SWIFT_DISPERSION_CONFIG", "/etc/swift/dispersion.conf")
if len(argv) > 1:
dispersion_config = argv[1]
-with os.popen("swift-dispersion-report -j %s"
+with os.popen("swift-dispersion-report -j %s | grep "^{""
% dispersion_config) as report:
stats = json.load(report)
--- check_swift_object_servers.orig 2015-10-28 12:24:55.335163069 +0000
+++ check_swift_object_servers 2015-10-28 12:25:00.839211116 +0000
@@ -56,7 +56,7 @@
exit $STATE_UNKNOWN
fi
-CHECK=$(swift-recon --objmd5 | grep ' error')
+CHECK=$(swift-recon --md5 | grep ' error')
echo $CHECK
if echo "$CHECK" | grep -q ' 0 error'