helpers.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:service-fabric-cli 作者: Azure 项目源码 文件源码
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')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号