Files
5a8cfd6e06d4ee7f47c5926c3859cbd6161c0d1a
swift /bin /swift-container-info

52 lines
1.7 KiB
Plaintext
Raw Normal View History

# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from optparse import OptionParser
try:
print_info('container', *args, **opts)
except InfoSystemExit:
sys.exit(1)
opts['stale_reads_ok'] = True
print('Warning: Possibly Stale Data')
run_print_info(args, opts)
sys.exit(2)
else:
print('Container info failed: %s' % e)
sys.exit(1)
parser = OptionParser('%prog [options] CONTAINER_DB_FILE')
'-d', '--swift-dir', default='/etc/swift',
'--drop-prefixes', default=False, action="store_true",
help="When outputting metadata, drop the per-section common prefixes")
options, args = parser.parse_args()
sys.exit(parser.print_help())