congress.datasources.plexxi_driver module

class congress.datasources.plexxi_driver.PlexxiDriver(name='', args=None, session=None)

Bases: congress.datasources.datasource_driver.PollingDataSourceDriver, congress.datasources.datasource_driver.ExecutionDriver

AFFINITIES = 'affinities'
HOSTS = 'hosts'
HOST_GUESTS = 'hosts.guests'
HOST_MACS = 'hosts.macs'
PLEXXISWITCHES = 'plexxiswitches'
PLEXXISWITCHES_MACS = 'plexxiswitches.macs'
PORTS = 'ports'
VMS = 'vms'
VM_MACS = 'vms.macs'
VSWITCHES = 'vswitches'
VSWITCHES_HOSTS = 'vswitches.hosts'
VSWITCHES_MACS = 'vswitches.macs'
connect_to_plexxi()

Connect to PlexxiCore.

Create a CoreSession connecting congress to PlexxiCore using credentials provided in datasources.conf

execute(action, action_args)

Overwrite ExecutionDriver.execute().

static get_datasource_info()
classmethod get_schema()

Creates a table schema for incoming data from PlexxiCore.

Returns a dictionary map of tablenames corresponding to column names for that table. Both tableNames and columnnames are strings.

keystoneauth()

Acquire a keystone auth token for API calls

Called when congress is running with keystone as the authentication method.This provides the driver a keystone token that is then placed in the header of API calls made to congress.

name_response()

Checks for any entries in the RepeatedName table.

For all entries found in the RepeatedName table, the corresponding VM will be then prefixed with ‘conflict-‘ in PlexxiCore.

name_rule_check()

Checks to see if a RepeatedNames rule already exists

This method is used to prevent the driver from recreating additional RepeatedNames tables each time congress is restarted.

name_rule_create()

Creates RepeatedName table for unique names policy.

The RepeatedName table contains the name and plexxiUuid of VMs that have the same name in the Plexxi table and the Nova Table.

string_to_bool(string)

Used for parsing boolean variables stated in datasources.conf.

update_from_datasource()

Called when it is time to pull new data from this datasource.

Pulls lists of objects from PlexxiCore, if the data does not match the correspondig table in the driver’s raw state or has not yet been added to the state, the driver calls methods to parse this data.

Once all data has been updated,sets self.state[tablename] = <list of tuples of strings/numbers> for every tablename exported by PlexxiCore.