def find_service_manifest(xml_file):
"""Find the path to the first service manifest for an application"""
root = ET.parse(xml_file).getroot()
import_elem = root.find('fabric:ServiceManifestImport', XML_NS)
if import_elem is None:
raise ValueError('Could not find service manifest import section')
ref_elem = import_elem.find('fabric:ServiceManifestRef', XML_NS)
if ref_elem is None:
raise ValueError('Could not find service manifest reference section')
manifest_name = ref_elem.attrib.get('ServiceManifestName', None)
if not manifest_name:
raise ValueError('Could not find service manifest name')
return os.path.join(os.path.dirname(xml_file), manifest_name,
'ServiceManifest.xml')
评论列表
文章目录