lock: remove description when unlocking

This will hopefully make it easier to track down what's leaving nodes unlocked.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This commit is contained in:
Josh Durgin 2013-03-07 09:40:25 -08:00
parent 4f68e3ee12
commit cef6e5d5e9

View File

@ -57,10 +57,13 @@ def lock(ctx, name, user=None):
def unlock(ctx, name, user=None):
if user is None:
user = teuthology.get_user()
desc_success = update_lock(ctx, name, description='')
success, _ , _ = send_request('DELETE', _lock_url(ctx) + '/' + name + '?' + \
urllib.urlencode(dict(user=user)))
if success:
log.debug('unlocked %s', name)
if not desc_success:
log.warn('failed to remove description for %s', name)
else:
log.error('failed to unlock %s', name)
return success