Skip to content

Commit

Permalink
remove --client flag from prepare-node-script command
Browse files Browse the repository at this point in the history
  • Loading branch information
wyattrees committed Nov 12, 2024
1 parent 1eee065 commit 7034d93
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions anvil-python/anvil/commands/prepare_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
JUJU_CHANNEL = "3.4/stable"
SUPPORTED_RELEASE = "jammy"

PREPARE_NODE_TEMPLATE = f"""[ $(lsb_release -sc) != '{SUPPORTED_RELEASE}' ] && \
PREPARE_NODE_TEMPLATE = f"""#!/bin/bash
[ $(lsb_release -sc) != '{SUPPORTED_RELEASE}' ] && \
{{ echo 'ERROR: MAAS Anvil deploy only supported on {SUPPORTED_RELEASE}'; exit 1; }}
# :warning: Node Preparation for MAAS Anvil :warning:
Expand Down Expand Up @@ -64,9 +65,7 @@
[ -f $HOME/.ssh/id_rsa ] || ssh-keygen -b 4096 -f $HOME/.ssh/id_rsa -t rsa -N ""
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
ssh-keyscan -H $(hostname --all-ip-addresses) >> $HOME/.ssh/known_hosts
"""
COMMON_TEMPLATE = f"""
# Install the Juju snap
sudo snap install --channel {JUJU_CHANNEL} juju
Expand All @@ -84,17 +83,6 @@


@click.command()
@click.option(
"--client",
"-c",
is_flag=True,
help="Prepare the node for use as a client.",
default=False,
)
def prepare_node_script(client: bool = False) -> None:
def prepare_node_script() -> None:
"""Generate script to prepare a node for Anvil use."""
script = "#!/bin/bash\n"
if not client:
script += PREPARE_NODE_TEMPLATE
script += COMMON_TEMPLATE
console.print(script, soft_wrap=True)
console.print(PREPARE_NODE_TEMPLATE, soft_wrap=True)

0 comments on commit 7034d93

Please sign in to comment.