Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in slogs #4

Open
aebruno opened this issue Apr 11, 2019 · 0 comments
Open

Bug in slogs #4

aebruno opened this issue Apr 11, 2019 · 0 comments

Comments

@aebruno
Copy link
Member

aebruno commented Apr 11, 2019

There's a bug in the parameter checking code on this line

This checks to see if the user passed in a date and a user list or just a user list. The issue is that when the user provides dates in this format 030119 for example, this gets passed to the id command. If there exists a user on the system with a uid of 30119 for example, this will return true and mistakenly be taken as a user name and passed to sacct.

For example, suppose a user exists on the system:

$ id 030119
uid=30119(janedoe) gid=12345(janedoe)

This call to slogs will fail:

$ slogs 030119 testuser -X --accounts=testaccount
Retrieving accounting data for user 030119 ...
Invalid time specification (pos=0): testuser

The short term workaround is to just use a different date format like so:

$ slogs '2019-03-01' testuser -X --accounts=testaccount
Retrieving accounting data for user testuser ...
               JobID      User      NCPUS               Start    Elapsed     ReqMem     AveRSS     MaxRSS 
-------------------- --------- ---------- ------------------- ---------- ---------- ---------- ----------

But the code should fixed to better test input parameters and be insensitive to date formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant