Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prototypes of some basic functions to be used #3

Merged
merged 1 commit into from
Jan 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions ansible_deploy/command_line.py
Original file line number Diff line number Diff line change
@@ -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)