OPSI package

Subpackages

Submodules

OPSI.Application module

Applications for the use of opsi in an twisted-application context.

class OPSI.Application.AppRunner(app, config)

Bases: object

Parameters:
  • app (Any) –

  • config (Dict[str, Any]) –

run()
Return type:

None

class OPSI.Application.Application(config)

Bases: object

Parameters:

config (Dict[str, Any]) –

profiler = {'cprofiler': <class 'OPSI.Application.CProfileRunner'>, 'profiler': <class 'OPSI.Application.ProfileRunner'>}
run()
Return type:

None

setup()
Return type:

None

shutdown()
Return type:

None

class OPSI.Application.CProfileRunner(app, config)

Bases: _BaseProfiler

Parameters:
  • app (Any) –

  • config (Dict[str, Any]) –

class OPSI.Application.ProfileRunner(app, config)

Bases: _BaseProfiler

Parameters:
  • app (Any) –

  • config (Dict[str, Any]) –

OPSI.Config module

Various important configuration values.

This module should be used to refer to often used values in a consistent way instead of hardcoding the values.

If new values are added they must be added that the module stays functional independen of the current underlying system.

These values are not intended to be changed on-the-fly! Doing so might result in unforseen problems and is strongly discouraged!

OPSI.Exceptions module

OPSI Exceptions. Deprecated, use opsicommon.exceptions instead.

exception OPSI.Exceptions.CommandNotFoundException

Bases: RuntimeError

OPSI.Logger module

opsi python library - Logger

OPSI.Logger.Logger(logFile=None)
Parameters:

logFile (Any) –

Return type:

Logger

OPSI.Object module

General classes used in the library.

As an example this contains classes for hosts, products, configurations.

Deprecated, use opsicommon.objects instead.

OPSI.Object.objectsDiffer(obj1, obj2, excludeAttributes=None)
Parameters:
  • obj1 (Any) –

  • obj2 (Any) –

  • excludeAttributes (List[str]) –

Return type:

bool

OPSI.SharedAlgorithm module

Algorithms to get a product order for an installation.

Changed in version 4.0.6.1.

Changed in version 4.0.7.1: Refactored algorithm 1.

exception OPSI.SharedAlgorithm.CircularProductDependencyError(message='')

Bases: BackendUnaccomplishableError

Parameters:

message (str) –

ExceptionShortDescription = 'A circular dependency between products.'
class OPSI.SharedAlgorithm.OrderBuild(elementCount, requs, completing)

Bases: object

Describes the building of an ordering

Parameters:
  • elementCount (int) –

  • requs (Requirements) –

  • completing (bool) –

getOrdering()
Return type:

List[Any]

proceed()
Return type:

bool

class OPSI.SharedAlgorithm.OrderRequirement(prior, posterior, fulfilled=False)

Bases: object

Represents a request for ordering of two elements with a notice if it is fulfilled.

Parameters:
  • prior (int) –

  • posterior (int) –

  • fulfilled (bool) –

class OPSI.SharedAlgorithm.Requirements

Bases: object

Comprises a list with ordering requirements and ordered lists of them

add(requirement)
Parameters:

requirement (OrderRequirement) –

Return type:

None

firstPriorNotOccurringAsPosterior(startI)
Parameters:

startI (int) –

Return type:

Tuple[Any, int]

getCount()
Return type:

int

getOrderByPosteriors()
Return type:

List[OrderRequirement]

getOrderByPrior()
Return type:

List[OrderRequirement]

getRequList()
Return type:

List[OrderRequirement]

indexOfFirstNotFulfilledRequirementOrderedByPrior()
Return type:

int

posteriorIndexOf(posti)

Searches first occurrence of posti as posterior value in the posterior-ordered sequence of requirements

Parameters:

posti (int) –

Return type:

int

class OPSI.SharedAlgorithm.XClassifiedProduct(product)

Bases: object

has String member id, int members priority, revisedPriority, and a member that is intendend to be a reference to a Product

Parameters:

product (Product) –

OPSI.SharedAlgorithm.addActionRequest(productOnClientByProductId, productId, productDependenciesByProductId, availableProductsByProductId, addedInfo=None)
Parameters:
  • productOnClientByProductId (Dict[str, ProductOnClient]) –

  • productId (str) –

  • productDependenciesByProductId (Dict[str, ProductDependency]) –

  • availableProductsByProductId (Dict[str, Product]) –

  • addedInfo (Optional[Dict[str, Any]]) –

Return type:

None

OPSI.SharedAlgorithm.addDependentProductOnClients(productOnClients, availableProducts, productDependencies)
Parameters:
  • productOnClients (List[ProductOnClient]) –

  • availableProducts (List[Product]) –

  • productDependencies (List[ProductDependency]) –

Return type:

List[ProductOnClient]

OPSI.SharedAlgorithm.generateProductOnClientSequence(productOnClients, sortedList)
Parameters:
  • productOnClients (List[ProductOnClient]) –

  • sortedList (List[str]) –

Return type:

List[ProductOnClient]

OPSI.SharedAlgorithm.generateProductOnClientSequenceX(productOnClients, sortedList)
Parameters:
  • productOnClients (List[ProductOnClient]) –

  • sortedList (List[str]) –

Return type:

List[ProductOnClient]

OPSI.SharedAlgorithm.generateProductOnClientSequence_algorithm1(productOnClients, availableProducts, productDependencies)
Parameters:
  • productOnClients (List[ProductOnClient]) –

  • availableProducts (List[Product]) –

  • productDependencies (List[ProductDependency]) –

Return type:

List[ProductOnClient]

OPSI.SharedAlgorithm.generateProductSequenceFromRequPairs_algorithm1(availableProducts, setupRequirements)
Parameters:
  • availableProducts (List[Product]) –

  • setupRequirements (List[Any]) –

Return type:

List[Product]

OPSI.SharedAlgorithm.generateProductSequenceFromRequPairs_algorithm2(availableProducts, setupRequirements)

Build priority classes and indices

Parameters:
  • availableProducts (List[Product]) –

  • setupRequirements (List[Any]) –

Return type:

List[Product]

OPSI.SharedAlgorithm.generateProductSequence_algorithm1(availableProducts, productDependencies)
Parameters:
  • availableProducts (List[Product]) –

  • productDependencies (List[ProductDependency]) –

Return type:

List[Product]

OPSI.SharedAlgorithm.getSetupRequirements(productDependencies)
Parameters:

productDependencies (List[ProductDependency]) –

Return type:

List[Tuple[str, str]]

OPSI.SharedAlgorithm.modifySortingClassesForAlgorithm1(products, setupRequirements)
Parameters:
  • products (List[Product]) –

  • setupRequirements (List[Any]) –

Return type:

bool

OPSI.Types module

Type forcing features.

This module contains various methods to ensure force a special type on an object. Deprecated, use opsicommon.types instead.

OPSI.UI module

OPSI.setup module

Module contents

opsi python library.

This module is part of the desktop management solution opsi (open pc server integration) http://www.opsi.org