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

RFE: Continue breaking out quads.py #25

Closed
jtaleric opened this issue Dec 16, 2016 · 5 comments
Closed

RFE: Continue breaking out quads.py #25

jtaleric opened this issue Dec 16, 2016 · 5 comments

Comments

@jtaleric
Copy link
Contributor

jtaleric commented Dec 16, 2016

Based on a conversation I had with @kambiz-aghaiepour here are my suggestions for yet another change for quads.py.

Currently QUADs.py is a huge python class that tackles many things. I would suggest breaking out the the following, to ease further development and allow a plugin model.

schedule.py - Which can live on its own since this is the bread and butter of Quads.. This contain all methods pertaining to QUADs schedule.

hosts.py - Anything interacting with the hosts is done here.

clouds.py - Anything interacting with the clouds is done here. Clouds are made up of Host objects, I would think.

tickets.py - Class to define a ticketing system.
    |
rt.py - Inherits tickets to build the RT ticketing system plugin.

provisioner.py - Class to define provisioning systems.
     |
foreman.py - inherits provisioner to build the Foreman provisioning plugin

tools.py -  House methods that can / should be shared across all these above classes.

I also recommended getting rid of all the bash scripts so you can easily switch out hammer for some other tool to execute a like command, ie beaker.

I would also recommend moving the code base into a lib/ instead of bin/ -- You can create a bin/quads.py that imports the quads lib, imports the config and executes the main method.

@sadsfae
Copy link
Member

sadsfae commented Dec 16, 2016

@jtaleric thank you for the suggestions, we're always welcome to improvements in design and structure. We'll chip away at this, possibly breaking them up into smaller pieces (we want to avoid large changesets for obvious reasons).

@jtaleric
Copy link
Contributor Author

Sounds good will, please keep this issue updated so I can track it here. I will discuss further ideas with @kambiz-aghaiepour.

@jtaleric
Copy link
Contributor Author

jtaleric commented Dec 21, 2016

@kambiz-aghaiepour Furthermore, I would break out the expect script https://github.com/redhat-performance/quads/blob/master/bin/juniper-set-port.exp and convert that to pyexpect. Also, I would use the same methodology above for this.

Ie create a networking.py, and then a juniper.py which inherits networking.py.

sadsfae pushed a commit that referenced this issue Jan 23, 2017
* split off the class definition and add additional
  class definitions to allow for more modular approach.
* Also looking to add an easy way to switch the backend
  data storage into a database.

Related-To: #25

Change-Id: I88abb0d465598aa1ea5666d6b28baf4037160400
@sadsfae
Copy link
Member

sadsfae commented Feb 8, 2017

I would also recommend moving the code base into a lib/ instead of bin/ -- You can create a bin/quads.py that imports the quads lib, imports the config and executes the main method.

This part is completed. We are keeping this open and are chipping away at it.

sadsfae pushed a commit that referenced this issue Apr 27, 2017
This change includes a number of improvements and
some bug fixes.

In terms of code aesthetics:
  * get rid of the [excessive] exit() calls in the quads library
    routines.  Ideally quads object class methods should operate
    on data, and return code or error status.  Program execution
    should not be terminated.
  * As opposed to printing results to the screen, return results
    in an array.  This will allow the calling party to decide on
    how to manage data.
  * If the data file is modified since it was read, add a method
    to determine if it is necessary to reread the data.
  * Use BasicHTTPServer to allow for GET and PUT methods to read
    data.  The benefit here is significant improvement in query
    times.  Also the quads-daemon becomes the "gatekeeper" and
    authoritative source of data (for reads as well as writes)
  * Setup a quads-daemon service file.
  * quads-cli is fully compatible with quads.py, but uses the
    quads-daemon service.

Minor bug fixes:
  * bin/quads-validate-env.sh
    If the schedule.yaml file was being updated while this script
    is launched a race condition is possible causing misleading
    emails to be generated with bogus content.  The script is updated
    to avoid this condition (note using the daemon would avoid the
    issue as well).
  * It was previously possible to set the start date / time on a
    host schedule to be after the end date!  (simple fix)
  * The color map was no longer usefule in simple-table-generator.py

Fixes: #66
Fixes: #67
Fixes: #68
Fixes: #69
related-to: #25

Change-Id: I646c59b2e9efbaf99cc79f168867c461ec7d40c3
@sadsfae sadsfae modified the milestone: 2.0 May 16, 2017
sadsfae pushed a commit that referenced this issue Aug 2, 2017
This adds checks to ensure that all the hosts in a given
environment have completed their build state.  If there are
any hosts that have not finished building, then the network
validation tests are skipped and the error is reported.

Once the host builds are completed, then the network validation
tests are run.  Both have to pass for the environment to be
released to the user.

related-to: #25
fixes: #48

Change-Id: Ie6df8df17ffbe84e42ba63f895dcae5c3074c547
@sadsfae
Copy link
Member

sadsfae commented Apr 19, 2018

A lot of things have changed since this was last filed, I don't think it's relevant any longer and most of the ideas behind this have been implemented.

I think a better place to watch the more pythonic enhancements is going to be these RFE here:

#140
#156

Above, we're going to see a full move from a legacy API built around SimpleHTTPServer and a move into CherryPy.

We'll also see a new API that's fully RESTful put in place and lastly a move away from manipulating locking, reads and writes of flat files into a proper ODM with mongo documents.

@sadsfae sadsfae closed this as completed Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants