Revision e46b2bcf snf-pithos-tools/pithos/tools/sh.py

b/snf-pithos-tools/pithos/tools/sh.py
142 142
        parser.add_option('--until', action='store', dest='until',
143 143
                          default=None, help='show metadata until that date')
144 144
        parser.add_option('--format', action='store', dest='format',
145
                          default='%d/%m/%Y', help='format to parse until date')
145
                          default='%d/%m/%Y %H:%M:%S', help='format to parse until date (default: %d/%m/%Y %H:%M:%S)')
146 146
        parser.add_option('--shared', action='store_true', dest='shared',
147 147
                          default=False, help='show only shared')
148 148
        parser.add_option('--public', action='store_true', dest='public',
......
202 202
        parser.add_option('--until', action='store', dest='until',
203 203
                          default=None, help='show metadata until that date')
204 204
        parser.add_option('--format', action='store', dest='format',
205
                          default='%d/%m/%Y', help='format to parse until date')
205
                          default='%d/%m/%Y %H:%M:%S', help='format to parse until date (default: %d/%m/%Y %H:%M:%S)')
206 206
        parser.add_option('--version', action='store', dest='version',
207 207
                          default=None, help='show specific version \
208 208
                                  (applies only for objects)')
......
261 261
        parser.add_option('--until', action='store', dest='until',
262 262
                          default=None, help='remove history until that date')
263 263
        parser.add_option('--format', action='store', dest='format',
264
                          default='%d/%m/%Y', help='format to parse until date')
264
                          default='%d/%m/%Y %H:%M:%S', help='format to parse until date (default: %d/%m/%Y %H:%M:%S)')
265 265
        parser.add_option('--delimiter', action='store', type='str',
266 266
                          dest='delimiter', default=None,
267 267
                          help='mass delete objects with path staring with <src object> + delimiter')
......
276 276
            t = _time.strptime(self.until, self.format)
277 277
            until = int(_time.mktime(t))
278 278
        
279
        kwargs = {}
280
        if self.delimiter:
281
            kwargs['delimiter'] = self.delimiter
282
        elif self.recursive:
283
            kwargs['delimiter'] = '/'
284
        
279 285
        if object:
280
            kwargs = {}
281
            if self.delimiter:
282
                kwargs['delimiter'] = self.delimiter
283
            elif self.recursive:
284
                kwargs['delimiter'] = '/'
285 286
            self.client.delete_object(container, object, until, **kwargs)
286 287
        else:
287
            self.client.delete_container(container, until)
288
            self.client.delete_container(container, until, **kwargs)
288 289

  
289 290
@cli_command('get')
290 291
class GetObject(Command):

Also available in: Unified diff