resort.engine

Package containing engine classes.

class resort.engine.ProfileManager(base_dir, work_dir, profiles)

Bases: object

Manager for profiles located in a directory.

Parameters:
  • base_dir (str) – Directory path of this manager. Must be absolute.
  • work_dir (str) – Working directory. From base_dir if it is relative.
  • profiles (dict) – Dictionary containing profile type and instance entries.
load(prof_name)

Load the profile with the given name.

Parameters:prof_name (str) – Profile name.
Return type:ProfileStub
Returns:An stub to loaded profile.
store(prof_name, prof_type)

Store a profile with the given name and type.

Parameters:
  • prof_name (str) – Profile name.
  • prof_type (str) – Profile type.
class resort.engine.ProfileStub(base_dir, prof_name, prof, prof_dir)

Bases: object

Stub of a Profile with a ComponentStubRegistry.

Parameters:
  • prof_name (str) – Profile name.
  • prof (Profile) – Profile instance.
  • prof_dir (str) – Profile working directory.
context()

Create an exectution context.

Return type:execution.Context
Returns:The created execution context.
prepare(props)

Prepare stubbed profile and return its properties.

Parameters:props (dict) – Dictionary with previous properties.
Return type:dict
Returns:Properties dictionary.
component_list()

List of ComponentStub instances for this profile.

Return type:list
component(comp_name)

Component with the specified name.

Parameters:comp_name (str) – Specified component name.
Return type:ComponentStub
Returns:The component stub with the specified name.
class resort.engine.ComponentStub(comp_stub_reg, comp_name, prof)

Bases: object

Stub of a Component.

Parameters:
name()

Component name.

Return type:str
type_name()

Fully qualified name of component class or None.

Return type:str
dependencies()

Yield ComponentStub of dependencies of this component.

available(context)

Return component availability.

Return type:bool
Returns:Component availability.
insert(context, plan)

Include an insert operation to the given plan.

Parameters:
delete(context, plan)

Include a delete operation to the given plan.

Parameters:
class resort.engine.ComponentStubRegistry(prof)

Bases: object

Registry of ComponentStub.

Parameters:prof (Profile) – Involved profile.
get(comp_name)

Get the specified component.

Parameters:comp_name (str) – Specified component name.
Return type:ComponentStub
Returns:Specified component stub.