2015-08-06 10:13:02 +09:00
|
|
|
#!/usr/bin/env python
|
2014-04-01 15:21:19 +08:00
|
|
|
# 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
|
2014-03-21 07:47:21 +05:30
|
|
|
#
|
2014-04-01 15:21:19 +08:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2014-03-21 07:47:21 +05:30
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
2014-04-01 15:21:19 +08:00
|
|
|
# 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.
|
2014-03-21 07:47:21 +05:30
|
|
|
|
|
|
|
import sys
|
|
|
|
from optparse import OptionParser
|
|
|
|
|
2014-04-01 15:21:19 +08:00
|
|
|
from swift.cli.info import print_info, InfoSystemExit
|
2014-03-21 07:47:21 +05:30
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2014-03-26 13:25:36 -07:00
|
|
|
parser = OptionParser('%prog [options] CONTAINER_DB_FILE')
|
2014-03-21 07:47:21 +05:30
|
|
|
parser.add_option(
|
2014-03-26 13:25:36 -07:00
|
|
|
'-d', '--swift-dir', default='/etc/swift',
|
2014-03-21 07:47:21 +05:30
|
|
|
help="Pass location of swift directory")
|
|
|
|
|
|
|
|
options, args = parser.parse_args()
|
|
|
|
|
2014-03-26 13:25:36 -07:00
|
|
|
if len(args) != 1:
|
|
|
|
sys.exit(parser.print_help())
|
2014-04-01 15:21:19 +08:00
|
|
|
|
|
|
|
try:
|
|
|
|
print_info('container', *args, **vars(options))
|
|
|
|
except InfoSystemExit:
|
|
|
|
sys.exit(1)
|