Пример #1
0
 def test_valid_content(self):
     xml = """<?xml version="1.0" encoding="utf-8"?>
         <SharedConfig>
          <Deployment name="MY_INSTANCE_ID">
           <Service name="myservice"/>
           <ServiceInstance name="INSTANCE_ID.0" guid="{abcd-uuid}" />
          </Deployment>
         <Incarnation number="1"/>
         </SharedConfig>"""
     ret = azure_helper.iid_from_shared_config_content(xml)
     self.assertEqual("MY_INSTANCE_ID", ret)
Пример #2
0
def iid_from_shared_config(path):
    with open(path, "rb") as fp:
        content = fp.read()
    return iid_from_shared_config_content(content)
Пример #3
0
def iid_from_shared_config(path):
    with open(path, "rb") as fp:
        content = fp.read()
    return iid_from_shared_config_content(content)