~ttx/swift/final-1.4.0

« back to all changes in this revision

Viewing changes to bin/swauth-cleanup-tokens

  • Committer: Tarmac
  • Author(s): Greg Lange
  • Date: 2011-04-18 18:07:45 UTC
  • mfrom: (278.1.2 exit_codes)
  • Revision ID: tarmac-20110418180745-91d30qf9dhzfjsf1
swauth scripts now exit with proper exit codes

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
                objs = conn.get_container(container, marker=marker)[1]
70
70
            except ClientException, e:
71
71
                if e.http_status == 404:
72
 
                    print 'Container %s not found' % (container)
73
 
                    print 'swauth-prep needs to be rerun'
74
 
                    exit()
 
72
                    exit('Container %s not found. swauth-prep needs to be '
 
73
                        'rerun' % (container))
75
74
                else:
76
 
                    print 'Object listing on container %s failed with ' \
77
 
                        'status code %d' % (container, e.http_status)
78
 
                    break
 
75
                    exit('Object listing on container %s failed with status '
 
76
                        'code %d' % (container, e.http_status))
79
77
            if objs:
80
78
                marker = objs[-1]['name']
81
79
            else: