Package lib :: Module validation
[show private | hide private]
[frames | no frames]

Module lib.validation

pylint mark: 6.67
Function Summary
  check_hostname(name)
Check the correctness of a proposed host name.
  check_mountpoint(mountpoints, size)
Check the correctness of a proposed set of mountpoints.
  check_password(passwd1, passwd2)
Check the correctness of a proposed password, writen twice.
  check_username(name)
Check the correctness of a proposed user name.
  invalid_names()
Find out which user names should not be used.

Function Details

check_hostname(name)

Check the correctness of a proposed host name.
Returns:
  • 0 valid.
  • 1 wrong length.
  • 2 contains white spaces.
  • 3 contains invalid characters.

check_mountpoint(mountpoints, size)

Check the correctness of a proposed set of mountpoints.
Returns:
  • 0 Doesn't exist root path.
  • 1 Path duplicated.
  • 2 Size incorrect.
  • 3 Contains invalid characters.

check_password(passwd1, passwd2)

Check the correctness of a proposed password, writen twice.
Returns:
  • 0 valid.
  • 1 wrong length. too short.
  • 2 wrong length. too long.
  • 3 strings do not match.

check_username(name)

Check the correctness of a proposed user name.
Returns:
  • 0 valid.
  • 1 contains invalid characters.
  • 2 contains uppercase characters.
  • 3 wrong length.
  • 4 contains white spaces.
  • 5 is already taken or prohibited.
  • 6 is root.

invalid_names()

Find out which user names should not be used.
Returns:
a set of prohibited user names.

Generated by Epydoc 2.1 on Wed Nov 9 13:46:23 2005 http://epydoc.sf.net