Fora
  • Getting Started
  • Outlining the differences
  • Frequently Asked Questions
  • Usage
    • Introduction
      • Inventories
      • Hosts & Groups
      • Scripts
    • Best practices
  • API
    • Operations Index
    • Fora API
      • fora.connectors
        • connectors.connector
        • connectors.local
        • connectors.ssh
        • connectors.tunnel_connector
        • connectors.tunnel_dispatcher
      • fora.operations
        • operations.api
        • operations.apt
        • operations.files
        • operations.git
        • operations.local
        • operations.pacman
        • operations.pip
        • operations.portage
        • operations.postgres
        • operations.system
        • operations.systemd
        • operations.utils
      • fora.connection
      • fora.example_deploys
      • fora.inventory_wrapper
      • fora.loader
      • fora.logger
      • fora.main
      • fora.remote_settings
      • fora.types
      • fora.utils
      • fora.version
  • Examples
    • Managing dotfiles
    • Using secrets
  • Links
    • Fora on GitHub
Powered by GitBook
On this page
  • class main.ArgumentParserError
  • class main.ThrowingArgumentParser
  • def ThrowingArgumentParser.error()
  • class main.ActionImmediateFunction
  • Functions
  • def main.main_run()
  • def main.show_inventory()
  • def main.main()
  1. API
  2. Fora API

fora.main

Provides the top-level logic of fora such as the CLI interface and main script dispatching.

class main.ArgumentParserError

Error class for argument parsing errors.

class main.ThrowingArgumentParser

An argument parser that throws when invalid argument types are passed.

def ThrowingArgumentParser.error()

def ThrowingArgumentParser.error(self, message: str) -> NoReturn:

Raises an exception on error.

class main.ActionImmediateFunction

An action that calls a function immediately when the argument is encountered.

Functions

def main.main_run()

def main.main_run(args: argparse.Namespace) -> None:

Main method used to run a script on an inventory.

Parameters

  • args: The parsed arguments

def main.show_inventory()

def main.show_inventory(inventory: str) -> None:

Display a summary of the given inventory.

Parameters

  • inventory: The inventory argument

def main.main()

def main.main(argv: Optional[list[str]] = None) -> None:

The main program entry point. This will parse arguments, load inventory and task definitions and run the given user script. Defaults to sys.argv[1:] if argv is None.

Previousfora.loggerNextfora.remote_settings

Last updated 3 years ago