Lines Matching refs:etree
20 from lxml import etree
31 """ return an etree object representing fixed (static) networking
33 svcbundle = etree.Element("service_bundle", type="profile",
37 physical = etree.SubElement(svcbundle, "service", version="1",
39 instance = etree.SubElement(physical, "instance", enabled="true",
41 pg = etree.SubElement(instance, "property_group", type="application",
43 etree.SubElement(pg, "propval", type="astring", name="active_ncp",
47 install = etree.SubElement(svcbundle, "service", version="1",
49 instance = etree.SubElement(install, "instance", enabled="true",
58 pg4 = etree.SubElement(instance, "property_group",
61 etree.SubElement(pg4, "propval", type="astring", name="address_type",
65 etree.SubElement(pg4, "propval", type="net_address_v4",
67 etree.SubElement(pg4, "propval", type="astring", name="name",
69 etree.SubElement(pg4, "propval", type="net_address_v4",
72 etree.SubElement(pg4, "propval", type="astring", name="name",
76 link = etree.SubElement(instance, "property_group",
79 etree.SubElement(link, "propval", type="astring",
81 etree.SubElement(link, "propval", type="astring",
83 etree.SubElement(link, "propval", type="astring",
85 etree.SubElement(link, "propval", type="astring",
88 pg6 = etree.SubElement(instance, "property_group",
91 etree.SubElement(pg6, "propval", type="astring",
93 etree.SubElement(pg6, "propval", type="net_address_v6",
95 etree.SubElement(pg6, "propval", type="astring", name="name",
97 etree.SubElement(pg6, "propval", type="net_address_v6",
100 pg6 = etree.SubElement(instance, "property_group",
103 etree.SubElement(pg6, "propval", type="astring",
105 etree.SubElement(pg6, "propval", type="astring", name="name",
107 etree.SubElement(pg6, "propval", type="astring",
109 etree.SubElement(pg6, "propval", type="astring",
125 pg = etree.SubElement(instance, "property_group", type=hr_pg_type,
127 etree.SubElement(pg, "propval", type=hr_pval_type,
129 etree.SubElement(pg, "propval", type=hr_pval_type,
134 dns = etree.SubElement(svcbundle, "service", version="1",
136 etree.SubElement(dns, "instance", enabled="true", name="default")
137 pg = etree.SubElement(dns, "property_group", type="application",
139 prop = etree.SubElement(pg, "property", type="net_address",
141 proplist = etree.SubElement(prop, "net_address_list")
144 etree.SubElement(proplist, "value_node", value=nameservers)
147 etree.SubElement(proplist, "value_node", value=entry)
149 search = etree.SubElement(pg, "property", type="astring",
151 etree.SubElement(search, "astring_list")
157 """ return an etree object representing the root account
159 svcbundle = etree.Element("service_bundle", type="profile",
161 service = etree.SubElement(svcbundle, "service", version="1",
163 instance = etree.SubElement(service, "instance", enabled="true",
165 root_pg = etree.SubElement(instance, "property_group", type="application",
167 etree.SubElement(root_pg, "propval", type="astring", name="type",
171 etree.SubElement(root_pg, "propval", type="astring", name="password",
174 etree.SubElement(root_pg, "propval", type="astring", name="password",
178 etree.SubElement(root_pg, "propval", type="astring", name="expire",
182 prop = etree.SubElement(root_pg, "property", type="astring",
184 alist = etree.SubElement(prop, "astring_list")
185 etree.SubElement(alist, "value_node", value=sshkey)
191 """ return an etree object to set a public SSH key for root
193 svcbundle = etree.Element("service_bundle", type="profile",
195 service = etree.SubElement(svcbundle, "service", version="1",
197 instance = etree.SubElement(service, "instance", enabled="true",
199 root_pg = etree.SubElement(instance, "property_group", type="application",
201 prop = etree.SubElement(root_pg, "property", type="astring",
203 alist = etree.SubElement(prop, "astring_list")
204 etree.SubElement(alist, "value_node", value=key)
209 """ return an etree object representing the instance's hostname
212 svcbundle = etree.Element("service_bundle", type="profile",
214 service = etree.SubElement(svcbundle, "service", version="1",
216 instance = etree.SubElement(service, "instance", enabled="true",
218 pg = etree.SubElement(instance, "property_group", type="application",
220 etree.SubElement(pg, "propval", type="astring", name="nodename",
222 etree.SubElement(pg, "propval", type="boolean",
230 given etree object
238 xml_str = etree.tostring(tree, pretty_print=True, encoding=encoding,
242 comment = etree.Comment(" Auto-generated by OpenStack Nova ")
244 xml_list.insert(2, etree.tostring(comment))