ocf / ocflib

Python libraries for account and server management
https://pypi.python.org/pypi/ocflib
Other
15 stars 32 forks source link

Add quota schema and simple functions for manipulating it #20

Closed chriskuehl closed 8 years ago

chriskuehl commented 8 years ago

You can log in to mysql with anonymous (no password) to see the printed view which forms the core of the accounting.

You can log in with the ocfprinting user (in passwords file) to see the full jobs and refunds tables, plus some additional views.

The functions like get_quota work already (try accounts ckuehl, asdf, hjkl, pubstaff, and some you make up to see how it handles non-existent users).

chriskuehl commented 8 years ago

@jvperrin @matthew-mcallister

chriskuehl commented 8 years ago

@kpengboy

jvperrin commented 8 years ago

Looks like it had trouble backing up last night, is the printed view incorrect somehow?

mysqldump: Couldn't execute 'SHOW FIELDS FROM `printed`': View 'ocfprinting.printed' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them (1356)
----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot -c /opt/share/backups/rsnapshot.conf sync
----------------------------------------------------------------------------
ERROR: backup_script /opt/share/backups/backup-mysql returned 2
WARNING: Rolling back "mysql/"
jvperrin commented 8 years ago

Looks like the printed_today view is missing in the ocfprinting database right now, so any queries to the printed view is failing. Is there any reason why it's not present right now? I fixed it by adding back the view using the schema, but it looks like printed is still broken since all users and the today column are NULL.

chriskuehl commented 8 years ago

@jvperrin thanks for the comments

i noticed some other issues as well, going to figure out a reasonable way to get tests for this before i try to merge (and will address your comments as well)

chriskuehl commented 8 years ago

@jvperrin the backup failure is because i was manually messing with the database trying to fix some faulty schema.

decided that was a bad idea and wrote some proper tests now. i'm pretty confident that if these tests pass, the schema is correct. feel free to suggest additional cases i'm not thinking of.

chriskuehl commented 8 years ago

(and this should be ready to ship once i fix a jenkins-only test failure)

jvperrin commented 8 years ago

@chriskuehl Ok, sounds good!