Esempio n. 1
0
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, )
Esempio n. 2
0
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")
Esempio n. 3
0
class ProxyForm(Form):

    cancel_label = _("Back")

    url = URLField(_("Proxy address:"), help=proxy_help)
Esempio n. 4
0
class ProxyForm(Form):

    url = URLField(_("Proxy address:"), help=proxy_help)
Esempio n. 5
0
class MirrorForm(Form):

    url = URLField(_("Mirror address:"), help=mirror_help)
Esempio n. 6
0
class MirrorForm(Form):

    cancel_label = _("Back")

    url = URLField(_("Mirror address:"), help=mirror_help)