EVerest / EVerest/ocpp-csms

Misleading usage info concerning outdated positional argument `certificates`

Open
#8 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
17
Forks
6
PR merge metrics
No merged PRs in 30d

Description

The current usage information for `central_system.py` (as of commit f0e826e) implies that the previous behavior of specifying the path to certificates as a positional argument is still supported. However, it appears that the new `--certs` option is now the only functional way to define the certificate directory.

```sh
$ python central_system.py -h
usage: central_system.py [-h] [--version] [--host HOST] [--port PORT] [--tls-host TLS_HOST] [--tls-port TLS_PORT] [--cert-chain CERT_CHAIN]
[--certs CERTS] [--reject-auth]
[certificates]

A simple OCPP 1.6 and 2.0.1 CSMS

positional arguments:
certificates Directory containing certificates (default: identical to --certs

options:
[…]
--certs CERTS Directory containing certificates (default: ../everest-core/build/dist/etc/everest/certs)
[…]
```

To address this inconsistency, either update the usage information to reflect the current behavior or implement a mechanism that allows both methods to work interchangeably. Below is a rough code suggestion to illustrate the idea (to be added after [L95 of `central_system.py`](https://github.com/EVerest/ocpp-csms/blob/f0e826e6652ec2637c429b1317ea3b4060496f55/central_system.py#L95)):

```python
if args.certificates:
if args.certs != parser.get_default("certs"):
logging.error(
'Both, positional argument certificates and option --certs are defined and have different values. This is not resolved automatically.')
exit(0)
else:
args.certs = args.certificates
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.