From 1bb89285f52fa15db9c5204d99074935a24a204e Mon Sep 17 00:00:00 2001 From: Marcin Stolarek Date: Wed, 26 Jan 2022 12:47:35 +0100 Subject: [PATCH] Add prototypes of some basic functions to be used --- ansible_deploy/command_line.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/ansible_deploy/command_line.py b/ansible_deploy/command_line.py index add596ea..7f601836 100644 --- a/ansible_deploy/command_line.py +++ b/ansible_deploy/command_line.py @@ -1,6 +1,32 @@ """Main module for ansible-deploy""" import sys + +def get_sub_command(): + """Function to check the first arguments (argv[1..]) looking for a subcommand""" + +def parse_options(): + """Generic function to parse options for all commands, we validate if the option was allowed for + specific subcommand outside""" + +def validate_options(options, subcommand): + """Function checking if the options set are allowed in this subcommand""" + if subcommand == "run": + if "task" not in options: + return False + +def load_configuration(): + """Function responsible for reading configuration files and running a schema validator against + it""" + +def validate_user_infra_stage(): + """Function checking if user has rights to execute command on selected infrastructure + Required for: run, lock and unlock operations""" + +def validate_user_task(): + """Function checking if user has rights to execute the task + Rquired for: run""" + def main(): """ansible-deploy endpoint function""" sys.exit(0)