From e694075c7fdcc9c4579d55b792da7a1391401b35 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 27 Mar 2018 16:40:59 +0200 Subject: testbeds, prototypes, model: Add docstrings This adds docstrings for methods of in the testbeds, prototypes and certain things in the model. --- rumba/utils.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'rumba/utils.py') diff --git a/rumba/utils.py b/rumba/utils.py index a522e94..f6d6c1c 100644 --- a/rumba/utils.py +++ b/rumba/utils.py @@ -47,7 +47,9 @@ logger = log.get_logger(__name__) class SwapOutStrategy(enum.Enum): - + """ + What action to perform on swap-out. + """ NO = 0 AUTO = 1 PAUSE = 2 @@ -55,7 +57,9 @@ class SwapOutStrategy(enum.Enum): class SyslogsStrategy(enum.Enum): - + """ + What prototype and system logs to retrieve. + """ NO = 0 DEFAULT = 1 DMESG = 2 @@ -75,12 +79,29 @@ CUSTOM_SYSLOGS = SyslogsStrategy.CUSTOM class ExperimentManager(object): - + """ + Helper class for running a Rumba experiment. + """ def __init__(self, experiment, swap_out_strategy=AUTO_SWAPOUT, syslogs_strategy=NO_SYSLOGS, syslogs=None): + """ + Initializes the ExperimentManager. + + :param experiment: The experiment name. + :param swap_out_strategy: What action to perform on swap-out. + :param syslog_strategy: What system and prototype logs to retrieve + before swap-out. + :param syslogs: The location of the syslogs in case of custom syslogs. + + .. note:: Options for swap_out_strategy are NO_SWAPOUT, AUTO_SWAPOUT, + PAUSE_SWAPOUT, PROMPT_SWAPOUT. + + .. note:: Options for syslog_strategy are NO_SYSLOGS, DEFAULT_SYSLOGS, + DMESG_SYSLOGS, CUSTOM_SYSLOGS. + """ assert isinstance(experiment, model.Experiment), \ 'An experiment instance is required.' self.experiment = experiment -- cgit v1.2.3