This is for the same reasoning as oslo_log. We don't want to depending
on OpenStack libraries.
Change-Id: I34e66af578d3f4b5ac5e710554aad91524285816
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
When I first started grafyaml, I wanted to better understand how
existing OpenStack libraries worked. So, with that in mind, I choose
oslo_log as the logging class for this program. However, now that we
have imported it under openstack-infra, we don't really want to depend
on OpenStack libraries, incase there is a breakage. The main reason
for this, if OpenStack libraries break, we still want the
infrastructure to work so we can fix the problem.
Change-Id: Iee9b1d9d9abb4da4d285531b64a7e2505240be12
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
When you run grafana-dashboards, it currently lacks some basic
information what it is actually doing. So, start building out some
logging to help others who decide to run the command.
Change-Id: I27b0c444139c5772b29ae3bd2c9550c6567dd4d6
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
We are currently lacking some basic coverage for grafana-dashboards
command. This break is cosmetic but will allow future patchsets to
expand on it.
Change-Id: Idf80ac28b1d5aafac1b10305db26db4e766838c6
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
The long term goal here is to eventually create python-grafana from
our embedded grafana.py file. So, most of this code just makes the
Grafana object more user friendly.
However, we've also added some validation around create_dashboard, we
added some checks before we create and after. To ensure we actually
created our new dashboards.
Finally, add some sphinx docs since everybody loves documentation.
Change-Id: Icbba403afe5208fbef1855118d4c3f4293461e00
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Add 2 new tests for the __init__ function. Testing with / without the
apikey. Also rework our requests_mock logic.
Change-Id: Idea77b59b1ea2d6a2566e48810aa19c0455479ac
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Here we are replacing pypy with docs. Mostly because we gate on docs
and not pypy.
Change-Id: I896e403a397b3964dcb3209cfcc84efcbe513fba
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Like JJB, Zuul and Nodepool, we need to have a CLI command to validate
our configuration files.
Change-Id: I4ccac21a2d77917667e1e844ab9ee1f1f281ea9f
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Like we do with JJB, we create a md5sum of the dashboard then cache
it. This is a simple way to determine if a yaml file has changed.
Change-Id: If7b80b84c5bbcb0d30b0325bae6b8e726bb2f41b
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Also rework index file to include README over a dedicated readme file.
Change-Id: I70108fb627131e7a8bfec6e64cbfc093e65ca48b
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Since we are not an official OpenStack project, no need to look like
one.
Change-Id: I6925799ebaf4086ea499be81c2be9de2aedb57ac
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Currently grafana will generate a slug based on the title name. For
now, we can use an existing python library to do this. Ideally, we'll
need to make sure the slugs generated between both are kept in sync.
How hard can that be?
Also move our validation logic into parser.py, since they are closely
related.
Change-Id: Id43f51d3f9db9131c25a8130f957572344a7d8f1
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Previous to this we actually didn't install our requests dependency.
So grafyaml actually didn't work :( Now we have basic coverage with
mock.
Change-Id: I771ea12e444ea851d76983df75f69d1569653f9d
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Grafana 2.1.0 added basic auth support. With that in mind, the api key
is now optional.
Change-Id: Ie186fa9ce48ca4ae222f75345e9b660f5ffa2909
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This fixes an issue where we were lumping each panel into all rows,
regardless of the yaml syntax provided.
Also add unit test for code coverage.
Change-Id: Ibc1e086d777692889f9c1dc26741e247bf90a985
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Also remove invalid comment about setup.py being managed my requirements repo.
Change-Id: I0b3e604b14648f9ae52ca2381269c13cf9e1574f
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
These are currently unsed and left over bits from cookie-cutter.
Change-Id: I99d143898e2ef8e7dbd6e0c470d6afdba89fc1f7
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
In Openstack I don't think we need to be too concerned with what we're
loading from yaml, but another project might? So, in the name of
reusability, I propose we use safe_load. Unless of course this actually
breaks something :)
Change-Id: Ib64f84cba22290a5059e649aee94d65dfa78344f
This will centeralize our overlapping yaml code paths.
Change-Id: Ib8bc0fc93b49363cb511d9891a24ea48fdee136d
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Unless anybody has major objections, we can drop coverage for them.
Change-Id: I3337987bae825ede377d5c88d2c028b25e66dfb1
Signed-off-by: Paul Belanger <pabelanger@redhat.com>