Skip to content

Misleading usage info concerning outdated positional argument certificates #8

Description

@acnixvkh

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.

$ 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):

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions