added -v option to st, ties into -q option, for higher levels of verbosity - currently on the stat command does anything with options.verbose > 1 - it will give you the storage url and token in case you need to drop into curl

This commit is contained in:
Clay Gerrard 2010-10-07 11:28:59 -05:00
parent 1c5490e29d
commit dfbb80693a

11
bin/st
View File

@ -1132,6 +1132,11 @@ def st_stat(options, args):
if not args: if not args:
try: try:
headers = conn.head_account() headers = conn.head_account()
if options.verbose > 1:
options.print_queue.put('''
StorageURL: %s
Auth Token: %s
'''.strip('\n') % (conn.url, conn.token))
container_count = int(headers.get('x-account-container-count', 0)) container_count = int(headers.get('x-account-container-count', 0))
object_count = int(headers.get('x-account-object-count', 0)) object_count = int(headers.get('x-account-object-count', 0))
bytes_used = int(headers.get('x-account-bytes-used', 0)) bytes_used = int(headers.get('x-account-bytes-used', 0))
@ -1397,8 +1402,10 @@ Example:
'''.strip('\n') % globals()) '''.strip('\n') % globals())
parser.add_option('-s', '--snet', action='store_true', dest='snet', parser.add_option('-s', '--snet', action='store_true', dest='snet',
default=False, help='Use SERVICENET internal network') default=False, help='Use SERVICENET internal network')
parser.add_option('-q', '--quiet', action='store_false', dest='verbose', parser.add_option('-v', '--verbose', action='count', dest='verbose',
default=True, help='Suppress status output') default=1, help='Print more info')
parser.add_option('-q', '--quiet', action='store_const', dest='verbose',
const=0, default=1, help='Suppress status output')
parser.add_option('-a', '--all', action='store_true', dest='yes_all', parser.add_option('-a', '--all', action='store_true', dest='yes_all',
default=False, help='Indicate that you really want the ' default=False, help='Indicate that you really want the '
'whole account for commands that require --all in such ' 'whole account for commands that require --all in such '