Skip to content

Commit

Permalink
add-user: fix function header
Browse files Browse the repository at this point in the history
Problem: When the max_jobs column was added to the flux-accounting DB
in flux-framework#131, it was not added to the function declaration of add_user(),
resulting in a NOT NULL constraint failure when attempting to add a
user. This error gets raised when calling the add-user subcommand
in flux-account.py.

Solution: Add max_jobs to the function header of add_user() and
to the SQL statement of a user when being added to the flux-accounting
DB.
  • Loading branch information
cmoussa1 committed Sep 1, 2021
1 parent a70ab05 commit 94ac6d1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/bindings/python/fluxacct/accounting/user_subcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def add_user(
uid=65534,
admin_level=1,
shares=1,
max_jobs=5,
):

# get uid of user
Expand Down Expand Up @@ -83,9 +84,10 @@ def add_user(
admin_level,
bank,
default_bank,
shares
shares,
max_jobs
)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""",
(
int(time.time()),
Expand All @@ -97,6 +99,7 @@ def add_user(
bank,
default_bank,
shares,
max_jobs,
),
)
# commit changes
Expand Down

0 comments on commit 94ac6d1

Please sign in to comment.