RabbitMQSynchronizer

RabbitMQSynchronizer

RabbitMQSynchronizer keeps the RabbitMQ user database synchronized with the CS RabbitMQ user database is updated according to changes in CS.

class DIRAC.FrameworkSystem.Utilities.RabbitMQSynchronizer.RabbitMQSynchronizer

Bases: object

__init__()
sync(_eventName, _params)

Synchronizes the internal RabbitMQ user database with the current content of CS.

Parameters
  • _eventName – any value, this parameter is ignored, but needed by caller function.

  • _params

    • any value, this parameter is ignored, but needed by caller function.

Return type

S_OK

Example

s.sync( None, None )

DIRAC.FrameworkSystem.Utilities.RabbitMQSynchronizer.getAllowedGroupName()
Returns name of the group of which users are allowed

to connect to RabbitMQ server.

Returns

group name

Return type

str

DIRAC.FrameworkSystem.Utilities.RabbitMQSynchronizer.getAllowedHostProperty()
Returns property. The hosts that contain it

are allowed to connect to RabbitMQ server.

Returns

property name

Return type

str

DIRAC.FrameworkSystem.Utilities.RabbitMQSynchronizer.getDNsForValidHosts(accessProperty)
Returns DN of hosts which contains accessProperty based on current

CS settings.

Parameters

accessProperty (str) –

Returns

list of hosts with accessProperty set.

Return type

list

DIRAC.FrameworkSystem.Utilities.RabbitMQSynchronizer.getSpecialUsersForRabbitMQDatabase()
Returns a list of special users

that will not be processed (e.g. removed) while updating the RabbitMQ database.

Returns

list of user logins.

Return type

list

DIRAC.FrameworkSystem.Utilities.RabbitMQSynchronizer.listDifference(list1, list2)
Calculates differences between two lists.

The original order of the list is not preserved.

Return type

list

DIRAC.FrameworkSystem.Utilities.RabbitMQSynchronizer.updateRabbitMQDatabase(newUsers, specialUsers=None)
Updates the internal user database of RabbitMQ server.

The current user list from the database is compared to newUsers list. The users that are not present in the database, but are in newUsers list are added. The users that are present in the database, but are not in newUsers list are deleted. The specialUser list contains logins that will not be processed at all.

Parameters
  • newUsers (list) – user logins to be processed.

  • specialUsers (list) – special users that will not be processed.