src.driver package

Submodules

src.driver.bootstrap module

src.driver.bootstrap.bootstrap(**kwargs)[source]

Method to bootstrap EP2 controller

This method bootstraps EP2 to creates the neccessary objects and returns it to the driver.

Parameters:**kwargs (object) – kwargs must contains config dictionary, logger object.
Returns:Whether bootstrap updater was successfull or not src.core.haproxyupdater.haproxyupdate.HaproxyUPdate: Object for updating haproxy config src.core.nodefetchers.basefetcher: Object for fetching backends
Return type:bool

src.driver.defaultparams module

src.driver.driver module

src.driver.driver.drive()[source]

Method for starting ep2

This is the entry method which starts ep2 controller. It calls bootstrap module for bootstrapping ep2, reads ep2 config, initialises haproxy and starts the poll-update-repeat loop

Returns:Returns nothing
Return type:None
src.driver.driver.merge_with_default_config(config)[source]

src.driver.drivercache module

class src.driver.drivercache.DriverCache(node_ips)[source]

Bases: object

Class to provide caching for ep2

The backends fetched in a given run is stored in memory. The backends fetched in next run witll be compared to the ones already held by this class (node_ips). If there is a mismatch, only then update will be done

Parameters:node_ips (list) – list of backend IPs
need_to_update(node_ips)[source]

Method to check if haproxy needs to be updated

Parameters:node_ips (list) – list of backend IPs
Returns:Whether to update haproxy or not
Return type:bool

Module contents