Skip to content

Commit

Permalink
fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
skatsaounis committed Nov 27, 2024
1 parent 18c9b07 commit e43e9c8
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 45 deletions.
72 changes: 36 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ The following instructions assume that you have three nodes `infra1`, `infra2`,

In addition, the instructions assume that MAAS Anvil deploys all available components (roles) on all three nodes:

- MAAS region controller
- MAAS rack controller (agent)
- PostgreSQL
- HAProxy
- MAAS region controller
- MAAS rack controller (agent)
- PostgreSQL
- HAProxy

### Preparation steps for each node

Expand Down Expand Up @@ -181,7 +181,7 @@ ubuntu@infra3:~$ maas-anvil cluster join \

If you receive an error message like the following:

```
```text
Please enter password for $node on anvil-controller
```

Expand Down Expand Up @@ -209,8 +209,8 @@ If you want to know exactly what configuration options are available and what ef

The configuration options of MAAS Anvil are generally divided into two categories:

- Deployment
- Software
- Deployment
- Software

In the deployment category you can configure general options for deployment, in the software category you can select versions and configuration of all charms used in MAAS Anvil and define how these charms are deployed.

Expand Down Expand Up @@ -358,7 +358,7 @@ ubuntu@infra1:~$ maas-anvil cluster list

#### `inspect`

If you suspect there is something wrong with your MAAS Anvil cluster you might also want to use the `maas-anvil inspect` command. It creates an introspection report of the current state of the cluster.
If you suspect there is something wrong with your MAAS Anvil cluster you might also want to use the `maas-anvil inspect` command. It creates an introspection report of the current state of the cluster.
You can read more about it in the [CLI reference section](#maas-anvil-inspect).

```bash
Expand Down Expand Up @@ -473,7 +473,7 @@ You can configure the VIP which should be used for the cluster in High availabil
> [!NOTE]
> The default values are `tls_mode:"disabled"`, `ssl_cert: ""` and `ssl_key: ""`.

To configure TLS for HAProxy, set `tls_mode` either to `termination` or `passthrough` and configure the path to the SSL certificate and the path to the private key for the SSL certificate. To disable it, set `tls_mode` to `disabled` and provide no SSL certificate or private key.
To configure TLS for HAProxy, set `tls_mode` either to `termination` or `passthrough` and configure the path to the SSL certificate and the path to the private key for the SSL certificate. To disable it, set `tls_mode` to `disabled` and provide no SSL certificate or private key.
If `passthrough` is selected, also provide `ssl_cacert` if you want to use a self-signed certificate.

> [!IMPORTANT]
Expand Down Expand Up @@ -518,17 +518,17 @@ juju:

MAAS Anvil is using the following charms:

- [maas-region](https://charmhub.io/maas-region)
- [maas-agent](https://charmhub.io/maas-agent)
- [haproxy](https://charmhub.io/haproxy)
- [postgresql](https://charmhub.io/postgresql)
- [keepalived](https://charmhub.io/keepalived)
- [maas-region](https://charmhub.io/maas-region)
- [maas-agent](https://charmhub.io/maas-agent)
- [haproxy](https://charmhub.io/haproxy)
- [postgresql](https://charmhub.io/postgresql)
- [keepalived](https://charmhub.io/keepalived)

For each of those charms you manually set the

- channel
- revision
- custom configuration
- channel
- revision
- custom configuration

Check which configuration can be passed to a charm in their respective documentation.

Expand Down Expand Up @@ -562,9 +562,9 @@ terraform:

## CLI interface

### maas-anvil [OPTIONS] COMMAND [ARGS]...
### maas-anvil [OPTIONS] COMMAND [ARGS]

```
```text
Usage: maas-anvil [OPTIONS] COMMAND [ARGS]...
MAAS Anvil is an installer that makes deploying MAAS charms in HA easy.
Expand Down Expand Up @@ -600,9 +600,9 @@ Commands:
juju-login Logs into the Juju controller used by MAAS Anvil.
```

### maas-anvil cluster [OPTIONS] COMMAND [ARGS]...
### maas-anvil cluster [OPTIONS] COMMAND [ARGS]

```
```text
Creates and manages a MAAS Anvil cluster across connected nodes.
Options:
Expand All @@ -629,7 +629,7 @@ Example:

### maas-anvil cluster bootstrap [OPTIONS]

```
```text
Usage: maas-anvil cluster bootstrap [OPTIONS]
Bootstraps the first node to initialize a MAAS Anvil cluster.
Expand All @@ -655,7 +655,7 @@ Example:

### maas-anvil cluster add [OPTIONS]

```
```text
Generates a token for a new node to join the cluster. Needs to be run on the
node where the cluster was bootstrapped.
Expand All @@ -673,7 +673,7 @@ Example:

### maas-anvil cluster join [OPTIONS]

```
```text
Joins the node to a cluster when given a join token. Needs to be run on the
joining node.
Expand All @@ -693,12 +693,12 @@ Example:
and use the token previously created with 'maas-anvil cluster add' on the bootstrap node.
maas-anvil cluster join \
--role database --role region --role agent --role haproxy \
--token $JOINTOKEN
--token $JOIN_TOKEN
```

### maas-anvil cluster list [OPTIONS]

```
```text
Lists all nodes in the MAAS Anvil cluster. Can be run on any node that is
connected to an active MAAS Anvil cluster.
Expand All @@ -713,7 +713,7 @@ Example:

### maas-anvil cluster remove [OPTIONS]

```
```text
Removes a node from the MAAS Anvil cluster. Needs to be run on the bootstrap
node.
Expand All @@ -728,7 +728,7 @@ Example:

### maas-anvil inspect

```
```text
Inspects the cluster and reports any issues it finds. A tarball of logs and
traces is created. You can attach this tarball to an issue filed in the MAAS
Anvil Github repository. github.com/canonical/maas-anvil
Expand All @@ -742,7 +742,7 @@ Options:

### maas-anvil juju-login

```
```text
Logs into the Juju controller used by MAAS Anvil. The login is performed
using the current host user.
Expand All @@ -755,9 +755,9 @@ Example:
maas-anvil juju-login
```

### maas-anvil manifest [OPTIONS] COMMAND [ARGS]...
### maas-anvil manifest [OPTIONS] COMMAND [ARGS]

```
```text
Generates and manages manifest files. A manifest file is a declarative YAML
file with which configurations for a MAAS Anvil cluster deployment can be
set. The manifest commands are read only.
Expand All @@ -778,7 +778,7 @@ Example:

### maas-anvil manifest generate [OPTIONS]

```
```text
Generates a manifest file. Either with the configuration of the currently
deployed MAAS Anvil cluster or, if no cluster was bootstrapped yet, a
default configuration.
Expand All @@ -796,7 +796,7 @@ Example:

### maas-anvil manifest list [OPTIONS]

```
```text
Lists manifest files that were used in the cluster.
Options:
Expand All @@ -810,7 +810,7 @@ Example:

### maas-anvil manifest show [OPTIONS]

```
```text
Shows the contents of a manifest file given an id. Get ids using the
'manifest list' command. Use '--id=latest' to show the most recently
committed manifest.
Expand All @@ -826,7 +826,7 @@ Example:

### maas-anvil prepare-node-script [OPTIONS]

```
```text
Generates a script to prepare the node for use with MAAS Anvil. This must be
run on every node on which you want to use MAAS Anvil.
Expand All @@ -841,7 +841,7 @@ Example:

### maas-anvil refresh [OPTIONS]

```
```text
Updates all charms within their current channel. A manifest file can be
passed to refresh the deployment with new configuration.
Expand Down
4 changes: 2 additions & 2 deletions anvil-python/anvil/commands/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def generate_software_manifest(manifest: Manifest) -> str:
cls=FormatEpilogCommand,
epilog="""
\b
List previously used manifest files.
List previously used manifest files.
maas-anvil manifest list
""",
)
Expand Down Expand Up @@ -121,7 +121,7 @@ def list(ctx: click.Context, format: str) -> None:
cls=FormatEpilogCommand,
epilog="""
\b
Show the contents of the most recently committed manifest file.
Show the contents of the most recently committed manifest file.
maas-anvil manifest show --id=latest
""",
)
Expand Down
2 changes: 1 addition & 1 deletion anvil-python/anvil/commands/prepare_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
epilog="""
\b
Prepare a node for usage with MAAS Anvil by generating the 'prepare-node-script' and
running it immediately by piping it to bash.
running it immediately by piping it to bash.
maas-anvil prepare-node-script | bash -x
""",
)
Expand Down
10 changes: 5 additions & 5 deletions anvil-python/anvil/provider/local/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@
cls=CatchGroup,
epilog="""
\b
Run the cluster bootstrap command to initialize the cluster with the first node.
Run the cluster bootstrap command to initialize the cluster with the first node.
maas-anvil cluster bootstrap \\\
\b
--role database --role region --role agent --role haproxy \\\
\b
--accept-defaults
\b
Once the cluster is bootstrapped you can join additional nodes by running
'maas-anvil cluster add' on the local node and
Once the cluster is bootstrapped you can join additional nodes by running
'maas-anvil cluster add' on the local node and
'maas-anvil cluster join' on the joining nodes.
""",
)
Expand Down Expand Up @@ -593,7 +593,7 @@ def join(
cls=FormatEpilogCommand,
epilog="""
\b
Verify the status of your MAAS Anvil cluster.
Verify the status of your MAAS Anvil cluster.
maas-anvil cluster list
""",
)
Expand Down Expand Up @@ -649,7 +649,7 @@ def list(ctx: click.Context, format: str) -> None:
cls=FormatEpilogCommand,
epilog="""
\b
Remove a node from the cluster. Run this command on the bootstrap node.
Remove a node from the cluster. Run this command on the bootstrap node.
maas-anvil cluster remove --fqdn infra2.
""",
)
Expand Down
3 changes: 2 additions & 1 deletion anvil-python/anvil/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import inspect
import logging
import sys
from typing import Any

import click
from sunbeam.plugins.interface.v1.base import PluginError
Expand All @@ -28,7 +29,7 @@
class EpilogFormatterMixin:
"""Mixin class for formatting epilogs with examples."""

def __init__(self, epilog: str | None = None) -> None:
def __init__(self, epilog: str | None = None, **kwargs: Any) -> None:
self.epilog = epilog

def format_epilog(
Expand Down

0 comments on commit e43e9c8

Please sign in to comment.