Skip to content

Commit

Permalink
Remove old CLI + cleanup (#1519)
Browse files Browse the repository at this point in the history
* Remove old cli

* Update theme

* Remove shim

* display_version: True
  • Loading branch information
iameskild authored Oct 27, 2022
1 parent 72d855a commit 77d15e7
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 617 deletions.
61 changes: 0 additions & 61 deletions nebari/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,61 +0,0 @@
import argparse
import logging
import sys

from pydantic.error_wrappers import ValidationError

from nebari.cli.cost import create_cost_subcommand
from nebari.cli.deploy import create_deploy_subcommand
from nebari.cli.destroy import create_destroy_subcommand
from nebari.cli.initialize import create_init_subcommand
from nebari.cli.keycloak import create_keycloak_subcommand
from nebari.cli.render import create_render_subcommand
from nebari.cli.support import create_support_subcommand
from nebari.cli.upgrade import create_upgrade_subcommand
from nebari.cli.validate import create_validate_subcommand
from nebari.provider.terraform import TerraformException
from nebari.version import __version__


def cli(args):
parser = argparse.ArgumentParser(description="Nebari command line")
parser.add_argument(
"-v",
"--version",
action="version",
version=__version__,
help="Nebari version number",
)
parser.set_defaults(func=None)

subparser = parser.add_subparsers(help=f"Nebari - {__version__}")
create_deploy_subcommand(subparser)
create_render_subcommand(subparser)
create_init_subcommand(subparser)
create_validate_subcommand(subparser)
create_destroy_subcommand(subparser)
create_support_subcommand(subparser)
create_upgrade_subcommand(subparser)
create_keycloak_subcommand(subparser)
create_cost_subcommand(subparser)

args = parser.parse_args(args)

if args.func is None:
parser.print_help(sys.stderr)
sys.exit(1)

logging.basicConfig(level=logging.INFO)

try:
args.func(args)
except ValidationError as valerr:
sys.exit(
"Error: The schema validation of the nebari-config.yaml failed."
" The following error message may be helpful in determining what went wrong:\n\n"
+ str(valerr)
)
except ValueError as ve:
sys.exit("\nProblem encountered: " + str(ve) + "\n")
except TerraformException:
sys.exit("\nProblem encountered: Terraform error\n")
52 changes: 0 additions & 52 deletions nebari/cli/_keycloak.py

This file was deleted.

53 changes: 0 additions & 53 deletions nebari/cli/cost.py

This file was deleted.

72 changes: 0 additions & 72 deletions nebari/cli/deploy.py

This file was deleted.

38 changes: 0 additions & 38 deletions nebari/cli/destroy.py

This file was deleted.

9 changes: 1 addition & 8 deletions nebari/cli/_init.py → nebari/cli/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,8 @@ def handle_init(inputs: InitInputs):
disable_prompt=inputs.disable_prompt,
)

# TODO remove when Typer CLI is out of BETA
whoami = "nebari"
if inputs.nebari:
whoami = "nebari"

try:
with open(f"{whoami}-config.yaml", "x") as f:
with open("nebari-config.yaml", "x") as f:
yaml.dump(config, f)
except FileExistsError:
raise ValueError(
Expand Down Expand Up @@ -303,8 +298,6 @@ def guided_init_wizard(ctx: typer.Context, guided_init: str):

# pull in default values for each of the below
inputs = InitInputs()
# TODO remove when Typer CLI is out of BETA
inputs.nebari = True

# CLOUD PROVIDER
rich.print(
Expand Down
Loading

0 comments on commit 77d15e7

Please sign in to comment.