diff options
Diffstat (limited to 'bin/swift')
-rwxr-xr-x | bin/swift | 32 |
1 files changed, 21 insertions, 11 deletions
@@ -37,7 +37,7 @@ from swiftclient import command_helpers from swiftclient.utils import config_true_value, prt_bytes from swiftclient.multithreading import MultiThreadingManager from swiftclient.exceptions import ClientException -from swiftclient.version import version_info +from swiftclient import __version__ as client_version def get_conn(options): @@ -245,9 +245,11 @@ st_download_help = ''' Download objects from containers Positional arguments: - <container> Name of container to download from + <container> Name of container to download from. To download a + whole account, omit this and specify --all. <object> Name of object to download. Specify multiple times - for multiple objects + for multiple objects. Omit this to download all + objects from the container. Optional arguments: --all Indicates that you really want to download @@ -693,6 +695,7 @@ def st_post(parser, args, thread_manager): if not args: headers = split_headers( options.meta, 'X-Account-Meta-', thread_manager) + headers.update(split_headers(options.header, '', thread_manager)) try: conn.post_account(headers=headers) except ClientException as err: @@ -706,6 +709,7 @@ def st_post(parser, args, thread_manager): (args[0].replace('/', ' ', 1), args[0]) headers = split_headers(options.meta, 'X-Container-Meta-', thread_manager) + headers.update(split_headers(options.header, '', thread_manager)) if options.read_acl is not None: headers['X-Container-Read'] = options.read_acl if options.write_acl is not None: @@ -1148,11 +1152,11 @@ adding "-V 2" is necessary for this.'''.strip('\n')) if __name__ == '__main__': - version = version_info.version_string() + version = client_version parser = OptionParser(version='%%prog %s' % version, usage=''' usage: %%prog [--version] [--help] [--snet] [--verbose] - [--debug] [--quiet] [--auth <auth_url>] + [--debug] [--info] [--quiet] [--auth <auth_url>] [--auth-version <auth_version>] [--user <username>] [--key <api_key>] [--retries <num_retries>] [--os-username <auth-user-name>] [--os-password <auth-password>] @@ -1171,11 +1175,11 @@ Command-line interface to the OpenStack Swift API. Positional arguments: <subcommand> delete Delete a container or objects within a container - downlad Download objects from containers + download Download objects from containers list Lists the containers for the account or the objects for a container post Updates meta information for the account, container, - or object + or object; creates containers if not present stat Displays information for the account, container, or object upload Uploads files or directories to the given container @@ -1197,8 +1201,11 @@ Examples: parser.add_option('-v', '--verbose', action='count', dest='verbose', default=1, help='Print more info') parser.add_option('--debug', action='store_true', dest='debug', - default=False, help='Show the curl commands of all http ' - 'queries.') + default=False, help='Show the curl commands and results ' + 'of all http queries regardless of result status.') + parser.add_option('--info', action='store_true', dest='info', + default=False, help='Show the curl commands and results ' + ' of all http queries which return an error.') parser.add_option('-q', '--quiet', action='store_const', dest='verbose', const=0, default=1, help='Suppress status output') parser.add_option('-A', '--auth', dest='auth', @@ -1320,9 +1327,12 @@ Examples: signal.signal(signal.SIGINT, immediate_exit) - if options.debug: + if options.debug or options.info: logger = logging.getLogger("swiftclient") - logging.basicConfig(level=logging.DEBUG) + if options.debug: + logging.basicConfig(level=logging.DEBUG) + elif options.info: + logging.basicConfig(level=logging.INFO) had_error = False |