Skip to content
Browse files

retag

  • Loading branch information...
2 parents d527f13 + 0b6aae3 commit 8ac4e415e6a48795fbb6b21f738619afe236481b @dannyauble dannyauble committed Oct 2, 2008
Showing with 23 additions and 0 deletions.
  1. +23 −0 src/slurmctld/job_mgr.c
View
23 src/slurmctld/job_mgr.c
@@ -2013,7 +2013,30 @@ static int _job_create(job_desc_msg_t * job_desc, int allocate, int will_run,
job_desc->user_id, assoc_rec.acct, assoc_rec.partition);
error_code = ESLURM_INVALID_ACCOUNT;
return error_code;
+ } else if(!assoc_ptr && !accounting_enforce) {
+ /* if not enforcing associations we want to look for
+ the default account and use it to avoid getting
+ trash in the accounting records.
+ */
+ debug2("_job_create: looking for default account for user %u "
+ "since they do not have a valid association "
+ "with account '%s' on this cluster",
+ job_desc->user_id, job_desc->account);
+ assoc_rec.acct = NULL;
+ assoc_mgr_fill_in_assoc(acct_db_conn, &assoc_rec,
+ accounting_enforce, &assoc_ptr);
+ if(!assoc_ptr) {
+ debug3("_job_create: no default association "
+ "found for user %u", job_desc->user_id);
+ } else {
+ info("_job_create: account '%s' has no association "
+ "for user %u using default account '%s'",
+ job_desc->account, job_desc->user_id,
+ assoc_rec.acct);
+ xfree(job_desc->account);
+ }
}
+
if (job_desc->account == NULL)
job_desc->account = xstrdup(assoc_rec.acct);
if (accounting_enforce &&

0 comments on commit 8ac4e41

Please sign in to comment.
Something went wrong with that request. Please try again.