ceph/teuthology/lockstatus.py
Zack Cerza ad278fdc71 Remove the 'user@' prefix before checking status
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
2014-08-25 14:07:29 -06:00

15 lines
351 B
Python

import requests
import os
from .config import config
from .misc import canonicalize_hostname
def get_status(name):
name = canonicalize_hostname(name, user=None)
uri = os.path.join(config.lock_server, 'nodes', name, '')
response = requests.get(uri)
success = response.ok
if success:
return response.json()
return None