4 Commits

Author SHA1 Message Date
Jaromir Wysoglad
75fcc4b4e9 Fix cli commands
Something must have changed either with cliff or
with a different version of python. All of the
cli commands end with: "'Namespace' object is not subscriptable"
This is caused because of how the parsed_args fields
were accessed.

This patch addresses the issue. Now it accesses the fields
the same way as aodhclient does. The unit tests for cli
now use the arg parser to actually test this.

During this I also discovered incorrect mocking in the
configuration tests. I added another mock to the test cases
which were missing it.

Change-Id: Ib5dbbdb48bdfd3214ec76acc4c68649e25f695db
2023-11-14 09:33:14 +00:00
Jaromir Wysoglad
d0b868db94 Add i18n.py and use it in v1/base.py and v1/cli.py
This follow similar pattern as other repositories like ceilometer.

Change-Id: Id9abda5720bd93d7fe68ee10deb124bdb665a430
2023-11-08 02:28:00 -05:00
Jaromír Wysoglad
53b335aaca
Add automated unit testing and a set of tests (#9)
* Add unit testing

* Fix code according to CI

This includes:
  - formating changes
  - rewording of some doc strings
  - adding support to {label!~'value'} in rbac

* Add unit tests automation

* Fix CI automation

* Add requirements.txt
2023-09-05 14:54:33 +02:00
Jaromír Wysoglad
a580772449
Prometheus interaction (#7)
* Remove old observability client

* Add initial functionality for prometheus querying

* Fix a copy-paste error in get_client()

* Add additional functionality.

This commit adds:
    - commands:
        delete
        clear-tombstones
        snapshot
    - Better rbac injection as well as a possibility
      to disable rbac.
    - Configuration of prometheus_client through
      env variables and /etc/openstack/prometheus.yaml

* Make README up to date

* Implement Martin's PR comments

* Implement better support for label values in rbac

* PEP8
2023-08-03 15:30:19 +02:00