class RackForm(Form): cancel_label = _("Back") url = URLField(_("Ubuntu MAAS Region API address:"), help=_( "e.g. \"http://192.168.1.1:5240/MAAS\". " "localhost or 127.0.0.1 are not useful values here.")) secret = RackSecretField( _("MAAS shared secret:"), help=_("The secret can be found in /var/lib/maas/secret " "on the region controller. ")) def validate_url(self): if len(self.url.value) < 1: return _("API address must be set") def validate_secret(self): if len(self.secret.value) < 1: return _("Secret must be set") try: to_bin(self.secret.value) except binascii.Error as error: return _("Secret could not be decoded: %s") % (error, )
class RackForm(Form): url = URLField(_("Ubuntu MAAS Region API address:"), help=_( "e.g. \"http://192.168.1.1:5240/MAAS\". " "localhost or 127.0.0.1 are not useful values here.")) secret = PasswordField( _("MAAS shared secret:"), help=_("The secret can be found in /var/lib/maas/secret " "on the region controller. ")) def validate_url(self): if len(self.url.value) < 1: return _("API address must be set") def validate_secret(self): if len(self.secret.value) < 1: return _("Secret must be set")
class ProxyForm(Form): cancel_label = _("Back") url = URLField(_("Proxy address:"), help=proxy_help)
class ProxyForm(Form): url = URLField(_("Proxy address:"), help=proxy_help)
class MirrorForm(Form): url = URLField(_("Mirror address:"), help=mirror_help)
class MirrorForm(Form): cancel_label = _("Back") url = URLField(_("Mirror address:"), help=mirror_help)