예제 #1
0
파일: hetzner.py 프로젝트: wavewave/nixops
 def __init__(self, xml, config):
     MachineDefinition.__init__(self, xml, config)
     x = xml.find("attrs/attr[@name='hetzner']/attrs")
     assert x is not None
     attrs = [("main_ipv4", "mainIPv4", "string"),
              ("create_sub_account", "createSubAccount", "bool"),
              ("robot_user", "robotUser", "string"),
              ("robot_pass", "robotPass", "string"),
              ("partitions", "partitions", "string")]
     for var, name, valtype in attrs:
         node = x.find("attr[@name='" + name + "']/" + valtype)
         setattr(self, var, xml_expr_to_python(node))
예제 #2
0
파일: hetzner.py 프로젝트: NixOS/nixops
 def __init__(self, xml, config):
     MachineDefinition.__init__(self, xml, config)
     x = xml.find("attrs/attr[@name='hetzner']/attrs")
     assert x is not None
     attrs = [("main_ipv4", "mainIPv4", "string"),
              ("create_sub_account", "createSubAccount", "bool"),
              ("robot_user", "robotUser", "string"),
              ("robot_pass", "robotPass", "string"),
              ("partitions", "partitions", "string")]
     for var, name, valtype in attrs:
         node = x.find("attr[@name='" + name + "']/" + valtype)
         setattr(self, var, xml_expr_to_python(node))