def getBlockXML(xmlFile, imageName, deviceName): tree = ElementTree.parse(xmlFile) root = tree.getroot() imageName = POOL_NAME + '/' + imageName root.find('source').attrib['name'] = imageName root.find('source').find('host').attrib['name'] = str(eval(ceph('mon_status').stdout)['monmap']['mons'][0]['name']) #root.find('target').attrib['dev'] = deviceName return ElementTree.tostring(root)
def getBlockXML(xmlFile, imageName, deviceName): tree = ElementTree.parse(xmlFile) root = tree.getroot() imageName = POOL_NAME + '/' + imageName root.find('source').attrib['name'] = imageName root.find('source').find('host').attrib['name'] = str( eval(ceph('mon_status').stdout)['monmap']['mons'][0]['name']) #root.find('target').attrib['dev'] = deviceName return ElementTree.tostring(root)
def get_monmap(mapfile): status = ceph("mon", "getmap", o=mapfile) return status.exit_code == 0
def needs_ceph(): try: sh.ceph("--version") except sh.CommandNotFound: pytest.skip("the ceph CLI was not found")