Module xg :: Class Connection
[hide private]
[frames] | no frames]

Class Connection

source code

object --+
         |
        Connection

Track information needed to connect to an Xgrid controller.

Instance Methods [hide private]
 
__init__(self, hostname=0, password=0, kerberos=False)
Create a Connection object to be passed to other objects.
source code
 
_buildConnectString(self)
Builds the connect_string.
source code
 
connectString(self)
Returns the connection string to be used in Xgrid commands.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, hostname=0, password=0, kerberos=False)
(Constructor)

source code 

Create a Connection object to be passed to other objects.

To connect to a specific Xgrid controller, create a Connection object and then pass it to the Controller, Grid or Job objects you create. This class performs no verification of the hostname or password.

Examples

Use the controller and password given in environmental vars.

>>> cn = Connection()

Specify a hostname and password.

>>> cn = Connection('xgrid.work.com','topsecret')

Use Kerberos.

>>> cn = Connection('xgrid.work.com',kerberos=True)

Usage

Parameters:
  • hostname (string) - The hostname of the xgrid controller, like "xgrid.work.com". If set to 0, it will default to the value set in the environment variable XGRID_CONTROLLER_HOSTNAME
  • password (string) - The password of the xgrid controller, like "mysecret". If set to 0, it will default to the value set in the environment variable XGRID_CONTROLLER_PASSWORD. For no password, set it equal to the empty string: password=''.
  • kerberos (boolean) - If True, connect using single sign on (SSO), instead of a password. You must have already obtained a kerberos ticket-granting ticket from the KDC that controlls the kerberos domain containing the Xgrid controller. If kerberos is True, the password is ignored.
Overrides: object.__init__