def update(self, imagepath, pxe, force_enable=None): if not isinstance(pxe, bool): pxe = True if pxe.lower() == 'true' else False (valid.Empty() | valid.Text())(imagepath) (valid.Boolean()(pxe)) return { "OVIRT_HOSTED_ENGINE_IMAGE_PATH": imagepath, "OVIRT_HOSTED_ENGINE_PXE": "yes" if pxe else None, "OVIRT_HOSTED_ENGINE_FORCE_ENABLE": "yes" if force_enable else None }
def validators(self): return { "rhn.username": valid.Ascii(), "rhn.profilename": valid.Ascii() | valid.Empty(), "rhn.url": valid.Empty() | valid.URL(), "rhn.ca": valid.Empty() | valid.URL(), "rhn.proxyhost": (valid.FQDNOrIPAddress() | valid.URL() | valid.Empty()), "rhn.proxyport": valid.Port() | valid.Empty(), "rhn.proxyuser": valid.Text() | valid.Empty(), "rhn.org": valid.Text() | valid.Empty(), "rhn.environment": valid.Text() | valid.Empty(), "rhn.activation_key": valid.Text() | valid.Empty(), }
def validators(self): ip_or_empty = valid.IPAddress() | valid.Empty() fqdn_ip_or_empty = valid.FQDNOrIPAddress() | valid.Empty() valid_bond_name = valid.RegexValidator( "^bond[0-9]+|007$", "a valid bond name (bond[0-9])") return { "hostname": fqdn_ip_or_empty, "dns[0]": ip_or_empty, "dns[1]": ip_or_empty, "ntp[0]": fqdn_ip_or_empty, "ntp[1]": fqdn_ip_or_empty, "dialog.nic.ipv4.address": valid.IPv4Address() | valid.Empty(), "dialog.nic.ipv4.netmask": (valid.IPv4Address() | valid.Number(bounds=[0, 32]) | valid.Empty()), "dialog.nic.ipv4.gateway": valid.IPv4Address() | valid.Empty(), "dialog.nic.ipv6.address": valid.IPv6Address() | valid.Empty(), "dialog.nic.ipv6.netmask": (valid.Number(bounds=[0, 128]) | valid.Empty()), "dialog.nic.ipv6.gateway": valid.IPv6Address() | valid.Empty(), "dialog.nic.vlanid": (valid.Number(bounds=[0, 4096]) | valid.Empty()), "bond.name": valid_bond_name, "bond.options": valid.Text(min_length=1) }
def validators(self): return {"snmp.password": valid.Text()}
def validators(self): return { "puppet.server": valid.FQDNOrIPAddress() | valid.Empty(), "puppet.certname": valid.Text() | valid.Empty() }
def update(self, enabled, server, certname): valid.Boolean()(enabled) (valid.Empty() | valid.FQDNOrIPAddress())(server) (valid.Empty() | valid.Text())(certname) return {"OVIRT_PUPPET_ENABLED": "yes" if enabled else None}
def update(self, imagepath): (valid.Empty() | valid.Text())(imagepath) return {"OVIRT_HOSTED_ENGINE_IMAGE_PATH": imagepath}