Changes

Jump to: navigation, search

OPS435 Online Assignment 2S

1,225 bytes removed, 23:38, 4 April 2021
identify and select appropriate fabric API for each task
* Has access to matrix.senecacollege.ca
'''Due Date:''' Please follow the three stages of submission schedule:* Check point 1: complete the detail algorithm for each task in this assignment by November 25, 2020. Name it as a2s_algorithm.txt and upload it to your github repository* Check point 2: complete the coding of your fabric commands file from the algorithm for each task by Dec 2, 2020. Name it as a2s_[Seneca_name].py (replace [Seneca_name] with your Seneca email user name) and upload it to your github repo by Dec 2, 2020.* Check point 3: complete the testing and debugging using your VM in myvmlab by Dec 4, and also submit your algorithm file (a2s_algorithm.txt), test results, and the fabric file (a2s_[Seneca_name].py) to Blackboardby April 12, 2021.
'''Late Penalty:''' 20% per school day, and note that in order to pass this course, this assignment must be completed satisfactorily, i.e. a grade of 50% or more.
== Overview ==
: Study the Fabric API run(), sudo(), local(), and put() and utilize them to create a four new Fabric task tasks called userAdmin::* addUser(username):* findUser(username):* listUser():* listSysUser(): The userAdminaddUser(username) task should perform the following activities operations on a remote machine tosystem::* create a new user when necessary information is provided, and if the user name is already exist, the operation should fail.: The findUser(username) task should perform the following operations on a remote system::* scan the appropriate file(s) on the remote system and determine whether the named user exist or not and report accordingly.: The listUser() task should perform the following operations on a remote system::* delete an existing scan the appropriate file(s) on the remote system and produce a list of shell user when it is safe names on the system. Shell users are those users who can login to do sothe remote system and get a bash shell.: The listSysUser() task should perform the following operations on a remote system::* scan the appropriate file(s) on the remote system and produce a list of system user (non-shell) name on the system. System users are those users who will not get a bash shell.
== Tasks for this assignment ==
== Suggested work-flow for this assignment ==
=== create a <font color="blue">private</font> repository on github ===
* Use the same github account you have used for your assignment 1 repository.* Create a private repository named "ops435-a2ra2s" for this assignment.* Populate your private repository with appropriate files. Please check out the sample repository <b><font color='blue'>[https://github.com/rayfreeping/ops435-a2 here]</font></b>
=== Add collaborator to your ops435-a2r a2s private repository ===* Add your professor's github account as one of the collaborators to your ops435-a2r a2s private repository. This will allow your professor to pull the contents of your ops435-a2r a2s repository and also to review and suggest changes and fixes to your algorithm and/or python scriptyour fabric file.
* <b><font color='blue'>Make sure that your professor accepted your invitation from github.com.</font></b>
Follow the standard computation procedure: input - process - ouput when creating the algorithm document for this assignment.
==== input ====
* get what data (command line arguments/options) from the user using the functions provided by the argparse module* according to the arguments/options given at the command line, take appropriate processing action. do you need for each system administration operation
==== processing ====
* based on the file(s) specified, read the contents of each file what commands and use appropriate objects to store it* based on the command line arguments/options, process the data accordingly, which includes** data preprocessing (split a multi-day record into single day record)** record processing (preform required computation)in what order they should be executed
==== output ====
* output the required report based on the processed data==== identify and select appropriate python objects and functions ====The following python functions (to what information should be created, you may have more) are useful in handling the following sub-tasks:* reads login records from files and filters out unwanted records* convert login records into proper python object type so that it can be processed using as much built-in functions as possible * create function which generates daily usage reports by user and/or by remote host* create function which generates weekly usage reports by user and/display or by remote hostreturn
To help you with this assignment, you ==== identify and select appropriate fabric API for each task ====You can use the ur_templatefollowing as the template for your fabric file:<pre>from fabric.api import *'''OPS435 Assignment 2S - Winter 2021Program: a2r_[seneca_id].pyAuthor: Student Name"The python code in this file a2s_[seneca_id].py is original work written by[Student Name]. No code in this file is copied from any other source including any person, textbook, or on-line resource except those providedby the course instructor. I have not shared this python file with anyoneor anything except for submission for grading. I understand that the sample ops435-a2 repository as a starting point in designing your own Python Usage Report scriptAcademic Honesty Policy will be enforced and violators will be reported and appropriate action will be taken.<font color''' env.user ="student" def addUser(name): 'blue'><b>If you don't have enough time add a user with given user name to create all the functions for the data processing steps, you should study the functions in the ur_funcsremote system''' ...py def listUser(provided by your teacher), pick and use the one that may help: '''return a list of shell user on a remote system''' ... </b></font>
def listSysUser(): '''return a list of system (non-shell) user''' ... def findUser(name): '''find user with a given user name''' ... </pre> === Python script fabric file coding and debugging ===For each function, identify what type of objects should be passed to the function, and what type of objects should be returned to the caller.Once you have finished coding a functiontask, you should start a Python3 interactive shell, import your functions and manually test each function run it on matrix and verify its correctness.
=== Final Test===
Once you have all the individual function task tested and that each is working properly, perform the final test and compare with test data provided by your professor the sample tests and verify that your script produces fabric tasks produce the correct results before submitting your python program it on Blackboard. Upload all the files for this assignment 2 to your vm in myvmlab and perform the final test. == Sample login/logout records file and sample test run results==* can be found from the sample repository github.com/rayfreeping/ops435-a2
== Rubric ==
! Task !! Maximum mark !! Actual mark
|-
| User Requirement DocumentaddUser ||20 |||-| Program usage and Options || 20 |||-| Generate user name list || 10 |||-| Generate remote host IP list|| 10 25 ||
|-
| Daily Usage Report by User findUSer || 10 25 ||
|-
| Daily Usage Report by Remote Host listUser|| 10 25 ||
|-
| Weekly Usage Report by User listSysUser|| 10 25 ||
|-
| Weekly Usage Report by Remote Host || 10 ||
|-
 
| '''Total''' || 100 ||
== Submission ==
* Stage 1: upload your algorithm document file to your ops435-a2r repository in github.com by November 25, 2020* Stage 2: upload your python script for this assignment to your ops435-a2r repository in github.com and to your vm in myvmlab by Dec 2, 2020* Stage 3: After fully tested and debugged your python script fabric file for this assignment, update submit your algorithm, your python script, and your est results to your ops435-a2r repository in github.com. Also submit the algorithm document, the python script fabric file and final test result to blackboard by Dec 4April 12, 20202021.
1,760
edits

Navigation menu