swauth scripts exit with non zero exit codes on failure now
This commit is contained in:
parent
59ff252362
commit
527a9ac0c7
@ -65,4 +65,4 @@ if __name__ == '__main__':
|
||||
ssl=(parsed.scheme == 'https'))
|
||||
resp = conn.getresponse()
|
||||
if resp.status // 100 != 2:
|
||||
print 'Account creation failed: %s %s' % (resp.status, resp.reason)
|
||||
exit('Account creation failed: %s %s' % (resp.status, resp.reason))
|
||||
|
@ -90,4 +90,4 @@ if __name__ == '__main__':
|
||||
ssl=(parsed.scheme == 'https'))
|
||||
resp = conn.getresponse()
|
||||
if resp.status // 100 != 2:
|
||||
print 'User creation failed: %s %s' % (resp.status, resp.reason)
|
||||
exit('User creation failed: %s %s' % (resp.status, resp.reason))
|
||||
|
@ -69,13 +69,11 @@ if __name__ == '__main__':
|
||||
objs = conn.get_container(container, marker=marker)[1]
|
||||
except ClientException, e:
|
||||
if e.http_status == 404:
|
||||
print 'Container %s not found' % (container)
|
||||
print 'swauth-prep needs to be rerun'
|
||||
exit()
|
||||
exit('Container %s not found. swauth-prep needs to be '
|
||||
'rerun' % (container))
|
||||
else:
|
||||
print 'Object listing on container %s failed with ' \
|
||||
'status code %d' % (container, e.http_status)
|
||||
break
|
||||
exit('Object listing on container %s failed with status '
|
||||
'code %d' % (container, e.http_status))
|
||||
if objs:
|
||||
marker = objs[-1]['name']
|
||||
else:
|
||||
|
@ -57,4 +57,4 @@ if __name__ == '__main__':
|
||||
ssl=(parsed.scheme == 'https'))
|
||||
resp = conn.getresponse()
|
||||
if resp.status // 100 != 2:
|
||||
print 'Account deletion failed: %s %s' % (resp.status, resp.reason)
|
||||
exit('Account deletion failed: %s %s' % (resp.status, resp.reason))
|
||||
|
@ -57,4 +57,4 @@ if __name__ == '__main__':
|
||||
ssl=(parsed.scheme == 'https'))
|
||||
resp = conn.getresponse()
|
||||
if resp.status // 100 != 2:
|
||||
print 'User deletion failed: %s %s' % (resp.status, resp.reason)
|
||||
exit('User deletion failed: %s %s' % (resp.status, resp.reason))
|
||||
|
@ -75,9 +75,9 @@ If the [user] is '.groups', the active groups for the account will be listed.
|
||||
conn = http_connect(parsed.hostname, parsed.port, 'GET', path, headers,
|
||||
ssl=(parsed.scheme == 'https'))
|
||||
resp = conn.getresponse()
|
||||
if resp.status // 100 != 2:
|
||||
print 'List failed: %s %s' % (resp.status, resp.reason)
|
||||
body = resp.read()
|
||||
if resp.status // 100 != 2:
|
||||
exit('List failed: %s %s' % (resp.status, resp.reason))
|
||||
if options.plain_text:
|
||||
info = json.loads(body)
|
||||
for group in info[['accounts', 'users', 'groups'][len(args)]]:
|
||||
|
@ -56,4 +56,4 @@ if __name__ == '__main__':
|
||||
ssl=(parsed.scheme == 'https'))
|
||||
resp = conn.getresponse()
|
||||
if resp.status // 100 != 2:
|
||||
print 'Auth subsystem prep failed: %s %s' % (resp.status, resp.reason)
|
||||
exit('Auth subsystem prep failed: %s %s' % (resp.status, resp.reason))
|
||||
|
@ -70,4 +70,4 @@ Example: %prog -K swauthkey test storage local http://127.0.0.1:8080/v1/AUTH_018
|
||||
conn.send(body)
|
||||
resp = conn.getresponse()
|
||||
if resp.status // 100 != 2:
|
||||
print 'Service set failed: %s %s' % (resp.status, resp.reason)
|
||||
exit('Service set failed: %s %s' % (resp.status, resp.reason))
|
||||
|
Loading…
Reference in New Issue
Block a user