(self, user, passw, uid, gid, gecos,
                 home, shell)
return FileUtil(self.passwd_file).putdata(line, 'a')
Add a *nix user to a /etc/passwd file
Add a *nix user to a /etc/passwd file
Add a * nix user to a / etc / passwd file
def add_user(self, user, passw, uid, gid, gecos,
                 home, shell):
        """Add a *nix user to a /etc/passwd file"""
        line = "%s:%s:%s:%s:%s:%s:%s\n" % \
                (user, passw, uid, gid, gecos, home, shell)
        if line in FileUtil(self.passwd_file).getdata('r'):
            return True
        return FileUtil(self.passwd_file).putdata(line, 'a')
def add_user ( self , user , passw , uid , gid , gecos , home , shell ) : line = "%s:%s:%s:%s:%s:%s:%s\n" % ( user , passw , uid , gid , gecos , home , shell ) if line in FileUtil ( self . passwd_file ) . getdata ( 'r' ) : return True return FileUtil ( self . passwd_file ) . putdata ( line , 'a' )