freckles.context package

Submodules

freckles.context.config module

class freckles.context.config.ContextConfig(alias, config_dict, extra_repos=None, config_unlocked=None)[source]

Bases: object

add_cnf_interpreter(interpreter_name, schema)[source]
cnf
config(interpreter_name, *overlays)[source]
config_value(key, interpreter_name=None)[source]
class freckles.context.config.ContextConfigTingCast[source]

Bases: ting.ting_cast.TingCast

A TingCast to create freckles profiles by reading yaml files.

CNF_PROFILE_ATTRIBUTES = [<ting.ting_attributes.FileStringContentAttribute object>, <ting.ting_attributes.FrontmatterAndContentAttribute object>, <ting.ting_attributes.ValueAttribute object>, <ting.ting_attributes.DictContentAttribute object>]
class freckles.context.config.ContextConfigs(repo_name, tingsets, cnf, default_config_dicts=None, **kwargs)[source]

Bases: ting.tings.TingTings

A class to manage freckles profiles.

This reads all ‘*.profile’ files in the freckles config folder. Those are later used to create a freckles context (per profile). It also checks whether there exists a ‘default.profile’ file with the ‘accept_freckles_license’ value set to ‘true’. Only if that is the case will it allow custom profiles (mainly for security reasons - the user should explicitely accept that certain configurations can be insecure).

Parameters:repos (str, list) – a list of local folders containing ‘*.context’ files
Returns:an index of config files
Return type:TingTings
DEFAULT_TING_CAST

alias of ContextConfigTingCast

create_context_config(context_name, config_chain=None, extra_repos=None)[source]

Creates a new context configuration out of the provided config_chain and extra repos.

If the config_chain argument is empty, the ‘default’ profile will be used.

get_config_type(config_obj)[source]
classmethod load_user_context_configs(repos=None)[source]
resolve_context_config_dict(config_chain, current_config_dict=None)[source]
freckles.context.config.is_unlocked()[source]
freckles.context.config.lock()[source]
freckles.context.config.unlock()[source]

freckles.context.freckles_context module

class freckles.context.freckles_context.FrecklesContext(context_name, config)[source]

Bases: object

adapters
add_config_interpreter(interpreter_name, schema)[source]
add_dynamic_frecklet(path_or_frecklet_content, validate=False, check_path=True)[source]
augment_repo(repo_orig)[source]
augment_repos(repo_list)[source]
callbacks
check_repo(repo)[source]
config(interpreter_name, *overlays)[source]
config_value(key, interpreter_name=None)[source]
context_name
copy_frecklet(frecklet_name, dest_path)[source]
create_frecklecutable(frecklet_name, only_from_index=True)[source]
create_run_environment(adapter, env_dir=None)[source]
download_repo(repo, task_parent)[source]
ensure_local_repos(repo_list)[source]
execute_external_command(command, args=None, parent_task=None)[source]
export(dest_path, delete_destination_before_copy=False, ignore_errors=False)[source]
frecklet_index
frkl_pkg
get_frecklet(frecklet_name, validate=False, index_name=None)[source]
get_frecklet_names()[source]
load_frecklet(frecklet_full_path_or_name_or_content, validate=False)[source]

Loads a frecklet.

First, checksi if argument is a path and exists. If that is the case, uses that to create the frecklet. If not, tries to find a frecklet with the provided name. If that doesn’t exists either, it tries to interprete the string as frecklet content.

save_run_info_file(new_data=None)[source]

Save the run info file, optionally merge it with new data beforehand.

Parameters:new_data (dict) – new data to be merged on top of current dict, will be ignored if None
update_pull_cache(path)[source]
update_repos(force=False, timeout=-1)[source]
freckles.context.freckles_context.startup_housekeeping()[source]

freckles.context.run_config module

class freckles.context.run_config.FrecklesRunConfig(target_dict=None, target_string=None, elevated=None, no_run=False, metadata=None)[source]

Bases: freckles.context.run_config.FrecklesRunTarget

config
classmethod create(target_dict_or_string, elevated=None, no_run=False, metadata=None)[source]
elevated
metadata
no_run
class freckles.context.run_config.FrecklesRunTarget(target_dict=None, target_string=None)[source]

Bases: object

become_pass
config
connection_type
host
login_pass
port
protocol
ssh_key
user

Module contents