Пример #1
0
 def get_rpsl(self):
     s = []
     s += ["mntner: %s" % self.maintainer]
     s += ["descr: %s" % self.description]
     if self.password:
         s += ["auth: MD5-PW %s" % md5crypt(self.password)]
     s += ["admins: %s" % x.nic_hdl for x in self.admins.all()]
     s += ["mnt-by: %s" % self.maintainer]
     if self.extra:
         s += [self.extra]
     return rpsl_format("\n".join(s))
Пример #2
0
def test_md5_crypt(raw, value):
    assert md5crypt(**raw) == value
Пример #3
0
def test_md5_crypt():
    assert md5crypt("test", salt="1234") == "$1$1234$InX9CGnHSFgHD3OZHTyt3."
    assert md5crypt("test", salt="1234") == "$1$1234$InX9CGnHSFgHD3OZHTyt3."
    assert md5crypt("test", salt="1234",
                    magic="$5$") == "$5$1234$x29w4cwzSDnesjss/m2O1."