def __init__(self, dft, project):
    """Default constructor
    """

    # Initialize ancestor
    CliCommand.__init__(self, dft, project)

    # Create the output writer object
    self.OutputWriter = ContentInformationOutputWriter(self.project.content_information_definition)
Example #2
0
    def __init__(self, dft, project):
        """Default constructor
    """

        # Initialize ancestor
        CliCommand.__init__(self, dft, project)

        # Initialize a dictionnary to hold the list of installed packages
        self.installed_packages = {}
Example #3
0
  def __init__(self, dft, project):
    """Default constructor
    """

    # Initialize ancestor
    CliCommand.__init__(self, dft, project)

    # Set the log level from the configuration
    logging.basicConfig(level=project.dft.log_level)
Example #4
0
    def __init__(self, dft, project):
        """Default constructor
    """

        # Initialize ancestor
        CliCommand.__init__(self, dft, project)

        # Initialize a dictionnary to hold the list of installed packages
        self.installed_packages = {}

        # Flag to used to keep track of the need to uninstall APT in case wehad to install it
        self.need_to_strip_apt = False
Example #5
0
    def __init__(self, dft, project):
        """Default constructor
    """

        # Initialize ancestor
        CliCommand.__init__(self, dft, project)

        # Path to the ansible roles under dft_base
        self.ansible_dir = project.get_dft_base() + "/ansible"

        # Set the log level from the configuration
        print("setting logs " + project.dft.log_level)
        logging.basicConfig(level=project.dft.log_level)
Example #6
0
    def __init__(self, dft, project):
        """Default constructor
    """

        # Initialize ancestor
        CliCommand.__init__(self, dft, project)

        # Defines the loopback device used for image building. Initialiy it is None
        # Its value is retrieved from a call to "losetup -f" and stored in this member
        # Once released the member is set back to None
        self.loopback_device = None

        # Defines the absolute filepath to the image file. Default value is none. Value
        # is set when configuration is checked, and never set back to None.
        self.image_path = None

        # Flag used to know if the image is mounted or not. Initial value is False
        self.image_is_mounted = False
Example #7
0
    def __init__(self, dft, project):
        """Default constructor
    """

        # Initialize ancestor
        CliCommand.__init__(self, dft, project)

        # Initialize a dictionnary to hold the list of installed packages
        self.installed_packages = {}

        # By default the check is successfull since not rules were checked
        # This boolean will be set to False (meaning check failed) as soon as a
        # rule verification will fail
        self.is_check_successfull = True

        # This variable is used to store the result of a single rule check
        # The variable value is reset for each loop, while the scope of the
        # previous one is the whole execution
        self.is_rule_check_successfull = True
        self.is_rule_check_successfull = True

        # Rule counter used to display the total number of checked rules
        self.rule_counter = 0

        # Counter used to display the number of successful rules
        self.rule_successfull_counter = 0

        # Counter used to display the number of failed rules
        self.rule_failed_counter = 0

        # Counter used to display the number of rules matching expected result
        # either failed of successfull, but as expected (handy for unit tests)
        self.rule_as_expected_counter = 0

        # Size of block used to read files when computing hashes
        self.block_size = 65536
Example #8
0
    def __init__(self, dft, project):
        """Default constructor
    """

        # Initialize ancestor
        CliCommand.__init__(self, dft, project)
Example #9
0
#! /usr/bin/env python

#  Google Calendar TOOLS
#
#  Google calendar management tool
#  author: [email protected]
from cli_parser import cli_parser
from gcal_api import GoogleCalendarManager
from cli_command import CliCommand

if __name__ == "__main__":
    # Configure command line argument parser
    parser = cli_parser()
    args = parser.parse_args()

    remote_auth = (args.command == 'remoteauth')

    # Create Google Calendar Manager
    calendar_manager = GoogleCalendarManager(remote_auth=remote_auth)

    # Create CLI Commands Manager
    cli_commands = CliCommand(calendar_manager)

    # Execute function for args.command
    cli_commands.execute_cmd(args.command, args)