~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to makeuser.py

  • Committer: mattgiuca
  • Date: 2008-02-06 03:07:09 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:429
makeuser and common.db now allow StudentID to be unsupplied / None.
This will insert a NULL into the DB (allowed by the schema).

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
import conf
38
38
import common.makeuser
39
39
 
40
 
if len(sys.argv) <= 6:
 
40
if len(sys.argv) <= 5:
41
41
    print "Usage: python makeuser.py <username> <password> <nick> " \
42
 
        "<fullname> <rolenm> <studentid>"
 
42
        "<fullname> <rolenm> [<studentid>]"
43
43
    sys.exit()
44
44
 
45
45
if os.getuid() != 0:
51
51
nick = sys.argv[3]
52
52
fullname = sys.argv[4]
53
53
rolenm = sys.argv[5]
54
 
studentid = sys.argv[6]
 
54
if sys.argv >= 6:
 
55
    studentid = sys.argv[6]
 
56
else:
 
57
    studentid = None
55
58
 
56
59
try:
57
60
    # Resolve the user's username into a UID