Added top-level overall command

This commit is contained in:
Cian Hughes
2023-10-27 17:44:13 +01:00
parent dae9e33125
commit 6947fe8c99
4 changed files with 21 additions and 0 deletions

View File

@@ -121,6 +121,7 @@ def json_to_img(
str, typer.Option(help="The file to output the disk image to", prompt=True)
],
) -> None:
"""Takes a fuel-ignition json file and produces an ignition disk image file"""
selenium_container = None
fuelignition_container = None
fuelignition_image = None

View File

@@ -85,6 +85,7 @@ def create_ignition_disk(
str, typer.Option(help="Swarm token for connecting to the swarm", prompt=True)
],
) -> None:
"""Writes an ignition image to the specified disk for easy deployment of new nodes to the swarm""" # noqa
create_img(hostname, password, switch_ip_address, switch_port, swarm_token)
valid, response = validate()
if not valid:

View File

@@ -90,6 +90,7 @@ def create_img(
str, typer.Option(help="Swarm token for connecting to the swarm", prompt=True)
],
) -> None:
"""Creates an ignition image for deploying a new node to the swarm"""
switch_ip_address = ipaddress.ip_address(switch_ip_address)
if switch_port > MAX_PORT:
raise ValueError(f"Port must be less than {MAX_PORT}")

18
node_deployer.py Normal file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env python3
import typer
from create_img import create_img
from create_disk import create_ignition_disk
from autoignition import json_to_img
app = typer.Typer(
help="A tool for creating ignition images for automated deployment to a swarm"
)
app.command()(create_img)
app.command()(create_ignition_disk)
app.command()(json_to_img)
if __name__ == "__main__":
app()