def __verify_can_write_to_logs_and_data(self, config):
        """Checks to make sure the user account running the agent has permission to read and write files
        to the log and data directories as specified in the config.

        If any verification fails, an exception is raised.

        @param config: The configuration
        @type config: Configuration
        """
        if not os.path.isdir(config.agent_log_path):
            raise Exception('The agent log directory \'%s\' does not exist.' % config.agent_log_path)

        if not os.access(config.agent_log_path, os.W_OK):
            raise Exception('User cannot write to agent log directory \'%s\'.' % config.agent_log_path)

        if not os.path.isdir(config.agent_data_path):
            raise Exception('The agent data directory \'%s\' does not exist.' % config.agent_data_path)

        if not os.access(config.agent_data_path, os.W_OK):
            raise Exception('User cannot write to agent data directory \'%s\'.' % config.agent_data_path)
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/agent_main.py/ScalyrAgent.__verify_can_write_to_logs_and_data/original