ironic.common.vnc module

Functions for VNC graphical console drivers and novncproxy

ironic.common.vnc.get_console(node)[source]

Get the type and connection information about the console

Parameters:

node – the node object

Returns:

A dict containing keys ‘type’, ‘url’

ironic.common.vnc.novnc_authorize(node)[source]

Create and save a console token

A random token is created and is stored in the node ``driver_internal_info` along with creation time.

This is called by graphical console drivers when start_console is called.

Parameters:

node – the node object

Returns:

an authorized token

ironic.common.vnc.novnc_unauthorize(node)[source]

Clear any existing console token

Parameters:

node – the node object

ironic.common.vnc.novnc_validate(node, token)[source]

Validate the token.

Parameters:
  • node – the node object

  • token – the token for the authorization

Returns:

The ConsoleAuthToken object if valid

The token is valid if the token is in the database and the expires time has not passed.

ironic.common.vnc.token_valid_until(node)[source]

Calculate when the token will expire

Parameters:

node – the node object

Returns:

a datetime object representing expiration time

Raises:

NotAuthorized if no timestamp is stored in the node