Commit 5f3916eb authored by Devaev Maxim's avatar Devaev Maxim

New validators collection for standards UNIX entities

parent 3cce11cb
# -*- coding: utf-8 -*-
__all__ = ["common", "network"]
__all__ = ["common", "network", "os"]
from common import ValidatorError
......
# -*- coding: utf-8 -*-
import re
from common import ValidatorError
##### Public methods #####
def validUserName(arg) :
if re.match("^[a-z_][a-z0-9_-]*$", arg) == None :
raise ValidatorError("Argument \"%s\" is not valid UNIX user name" % (arg))
return arg
def validGroupName(arg) :
if re.match("^[a-z_][a-z0-9_-]*$", arg) == None :
raise ValidatorError("Argument \"%s\" is not valid UNIX group name" % (arg))
return arg
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment