Example #1
0
 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))
Example #2
0
 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))