vital2 / Vital-development

MIT License
18 stars 11 forks source link

Update how CollectCourseStats script is called, simplifying the current command to something portable. #55

Closed suryansh1 closed 4 years ago

suryansh1 commented 4 years ago

The current call involves a long winded command

home/vital/.virtualenvs/vital/bin/python2.7 /home/vital/vital2.0/source/virtual_lab/vital_site/manage.py CollectCourseStats -a

This needs to be simplified to something which can be used by someone without much knowledge of Vital

suryansh1 commented 4 years ago

Manage.py is just a wrapper used to call various Commands listed in the commands directory

Output of manage ``

Type 'manage.py help ' for help on a specific subcommand.

Available subcommands:

[auth] changepassword createsuperuser

[captcha] captcha_clean

[django] check compilemessages createcachetable dbshell diffsettings dumpdata flush inspectdb loaddata makemessages makemigrations migrate sendtestemail shell showmigrations sqlflush sqlmigrate sqlsequencereset squashmigrations startapp startproject test testserver

[sessions] clearsessions

[staticfiles] collectstatic findstatic runserver

[vital] AddNotificationMessage AutoStartVMs ChangesRequiringUsersLogout CollectCourseStats CollectXenDomDetails DeleteNotificationMessage EmailCommonNotification ForceLogoutInactiveUsers ForceRebaseVms RegenerateConfFiles RemoveCourse RemoveOldVitalUsers ResetActivationCode ResetCourse ResetSftpAllUsers ResetStudentEnvironment ShutdownVMsOnXen StartServerStatsCollection TestMultipleStudentVMs UnblockAll UnblockUserByEmailId ZmqSlave ``

suryansh1 commented 4 years ago

I have created a command line utility called manage. It is a bash script which resides in /usr/local/bin directory in dev right now.

This utility takes the arguments and passed to it and then internally does the original call to the python script, with these arguments.

Example, instead of /home/vital/.virtualenvs/vital/bin/python2.7 /home/vital/vital2.0/source/virtual_lab/vital_site/manage.py CollectCourseStats -a, we can just do manage CollectCourseStats -a

Same goes for manage RemoveCourse -c 13

suryansh1 commented 4 years ago

I have even added a small tutorial in the commented section of the utility, for someone unfamiliar with bash scripts. This is the output currently, in dev

manage-2

manage-1