Commit Graph

372 Commits

Author SHA1 Message Date
Mike Terzo
00b2699d02 Fix exceptions to assign the exception to a variable (#248)
so that the logger can properly use it.
2016-06-06 20:09:36 -04:00
Chris Boot
d471663880 puppetboard/utils.py: fix Python3 compatibility (#247)
If xrange() is not defined, alias it to range().
2016-06-06 20:09:23 -04:00
Corey Hammerton
b7cd58ac2c More Easily View All Reports (#245)
* puppetboard/app.py: Refactoring the report event counts.

Writing the report event counts code in the node(), reports() and
reports_node() functions to iterate through report.events() instead
of querying the event counts endpoint for each report.

This solution is heavier than the original because we have to query
for all full event objects for each report and iterate through them
to interpret their statuses. I originally wanted to replace the
report.events() function with an events variable for the Report object
but that turned out to be not technically possible presently because
the report extended events' timestamps for in a different format which
python can't interpret. Specifically the timezone values contain ':',
there is no Python 2.x documentation that states timezones containing
colons is supported.

This does, however, lighten our dependency on the event-counts endpoint
which is marked as experimental. Which means that it may change or be
removed in a future release.

This also resolves a silent bug which may or may not include environment
filters on the event-counts queries. report.events() searches the Events
endpoint based on the report hash which eliminates the possibility of
mistaken relationships.

* puppetboard/app.py: Replacing url_for_* functions with a single url_for_field()

The url_for_pagination and url_for_environments functions only worked
with a single, fixed request argument, 'page' and 'env' respectively.
The new url_for_field() excepts 2 arguments, field: the name of the
argument to update, and value: its intended value.

Should consider adding a url_for_fields() function that accepts a
dict argument and updates all the request arguments using a dict.update().
There is currently no requirement for it so it will remain in the backlog.

* puppetboard/templates/reports.html: Adding a dropdown menu to limit the report count

This fixes https://github.com/voxpupuli/puppetboard/issues/202

This new dropdown allows users to select their desired number of reports
on the reports() and reports_node() pages. The available options are
app.config['REPORTS_COUNT'], 25, 50, 100 or All. The default value
is determined by the REPORTS_COUNT configuration value.

Had to modify url_for_field() to merge the request args to the view args
in order to generate the links that include the limit query string.
2016-06-06 20:09:07 -04:00
Joseph (Jy) Yaworski
554bd80e93 Merge pull request #249 from vchepkov/community
update links to github Puppet Community
2016-06-04 14:56:55 -04:00
Vadym Chepkov
b1a3d203a3 update links to github Puppet Community 2016-06-04 10:17:51 -04:00
Patrick K
59f27943fc reverse sort order to lump minorities in 'other' instead of majorities (#242) 2016-05-24 18:50:40 -04:00
Raphaël Pinson
0576e6d955 Add OVERVIEW_FILTER (#196) 2016-05-24 18:49:30 -04:00
Corey Hammerton
eb893ffef5 puppetboard/app.py: Protecting against ZeroDivisionErrors on calculations (#244)
This (re-)fixes https://github.com/voxpupuli/puppetboard/issues/220

Corner cases where new installations or empty environments will return
zero resources and zero nodes, this will result in a ZeroDivisionError.
Now if this happens setting the average-resources-per-node to zero.
2016-05-21 16:00:32 -04:00
Corey Hammerton
54fb258b06 puppetboard/app.py: Removing :func:puppetboard/report_latest (#237)
This fixes https://github.com/voxpupuli/puppetboard/issues/234

The report_latest() function was effectively deprecated when PuppetDB
introduced the latest_report_hash field in the Nodes endpoint response
format in version 3.2. With the breaking changes to PuppetDB 4.0.0
support this function can be safely removed.
2016-05-16 20:00:35 -04:00
Corey Hammerton
6c9bc4fda4 puppetboard/templates/_macros.html: Using the Semantic UI Pagination Menu (#236)
This fixes https://github.com/voxpupuli/puppetboard/issues/229

This menu provides a very user friendly interface for rendering the pagination
section, which is available in version 2.1.8. Updating the render_pagination
macro use the new HTML classes.
2016-05-16 20:00:16 -04:00
Corey Hammerton
c1284d21c6 utils.py: Adding logging to utils.py, specifically :func:puppetboard.utils.get_or_abort (#235)
This fixes https://github.com/voxpupuli/puppetboard/issues/230

If there are any connection issues between PuppetBoard and the PuppetDB
instance there wasn't any obvious evidence in log files. This additional
logging added to utils.py logs errors whenever there is an HTTPError,
ConnectionError or EmptyResponseError in get_or_abort.
2016-05-16 19:59:58 -04:00
Corey Hammerton
3833bbf0a1 puppetboard/app.py: Adding Radiator view (#232)
* puppetboard/app.py: Adding Radiator view

Part 2 of https://github.com/voxpupuli/puppetboard/issues/70

This is a refactoring of the changes in https://github.com/voxpupuli/puppetboard/pull/100.
Adds a simple Heads-Up Display of the last run statuses of managed nodes,
either environment filtered or not.

* puppetboard/app.py: Fixing environment filters and metric strings.

* The names of the population metrics have changes in PuppetDB 4.0, the initial
  commit used the metric names from PuppetDB 2.x.
* The main nodes query did not include a query string to filter on environments.
2016-05-16 19:59:40 -04:00
rob
f22ea84c68 Fix error "AttributeError: 'module' object has no attribute (#233)
'PROTOCOL_SSLv3'"

Upgrading the Requests package to 2.6.0

Running debian 8.2 (jessie) I experience the following:

```
Traceback (most recent call last):
  File "dev.py", line 11, in <module>
    from puppetboard.app import app
  File "/srv/puppetboard/puppetboard/puppetboard/app.py", line 19, in <module>
    from pypuppetdb import connect
  File "/srv/puppetboard/virtenv-puppetboard/local/lib/python2.7/site-packages/pypuppetdb/__init__.py", line 61, in <module>
    from pypuppetdb.api import BaseAPI
  File "/srv/puppetboard/virtenv-puppetboard/local/lib/python2.7/site-packages/pypuppetdb/api/__init__.py", line 7, in <module>
    import requests
  File "/srv/puppetboard/virtenv-puppetboard/local/lib/python2.7/site-packages/requests/__init__.py", line 53, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "/srv/puppetboard/virtenv-puppetboard/local/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 62, in <module>
    ssl.PROTOCOL_SSLv3: OpenSSL.SSL.SSLv3_METHOD,
AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'
```

Bumped 'requests' version as suggested here: http://stackoverflow.com/questions/28987891/patch-pyopenssl-for-sslv3-issue
2016-05-07 17:00:49 -04:00
Michael
b5ba2515e2 Semantic UI update to 2.1.8 (#211)
* Update to Semantic UI 2.1.6

Basically I tried to rebuild the old layout as closely as possible.
It is a bit more mobile friendly but still misses Semantic UIs collapsable menu:
  https://github.com/Semantic-Org/Semantic-UI/issues/157

+ ditch old tablesorter for recommended one
+ use em instead of percentage for status labels in macros

Overview:

+ sort overview by report date per default
+ slightly different colors

Facts:

+ template based approach to even out the columns in facts view
+ don't show empty containers
+ needed an additional variable in context

* get rid of unnecessary semantic src files

* more cleanup

* clean jquery-tablesort directory as well

* drop unused theme files

* remove symlinks in static/{js,css}

* semantic_update

+ bump to semantic 2.1.8
+ minor adjustments
  - default-sort class in tables
  - table type in inventory
  - fixed and wrapped table for reports

* updated screenshots
2016-04-23 20:30:20 -04:00
Matthew Gyurgyik
a7a35c1829 puppetdb 4.x metric api calls (#228) 2016-04-23 20:08:29 -04:00
corey.hammerton
c80da7192d Version bump to 0.1.3 2016-03-21 20:31:45 -04:00
corey.hammerton
c13389cc3e Version bump to 0.1.2 2016-02-15 19:57:43 -05:00
Corey Hammerton
7c44854988 Merge pull request #162 from visibilityspots/master
Examples add to the readme
2016-02-09 19:40:59 -05:00
Corey Hammerton
3844d72bcb Merge pull request #219 from corey-hammerton/issue-218
puppetboard/app: Enabling environment filtering on overview metrics
2016-02-09 19:37:42 -05:00
Corey Hammerton
43ff09fbd4 Merge pull request #217 from corey-hammerton/issue-198
puppetboard/app: Disabling CSRF protection globally.

I still think this is a bad idea but I don't see any other way.
2016-02-09 19:37:18 -05:00
corey.hammerton
0111e52096 puppetboard/app: Enabling environment filtering on overview metrics
This fixes https://github.com/voxpupuli/puppetboard/issues/218

Adding environment filters to only report then number of managed nodes
and resources that are present in the current environment. Still using
the same metrics endpoint information for all environments.
2016-02-08 21:48:49 -05:00
Corey Hammerton
beef893b6a Merge pull request #163 from raphink/colors
Use more standard colors for Puppet run states
2016-02-06 19:02:13 -05:00
Corey Hammerton
7ed551dbe9 Merge pull request #216 from roidelapluie/fix-screenshots
Fix screenshots
2016-02-06 19:00:46 -05:00
corey.hammerton
492e1057e0 puppetboard/app: Disabling CSRF protection globally.
I really did not want to resort to this but I could not find any answers
from previously asked questions on the subject. The template is properly
creating the csrf_token hidden field which is being submitted to the server,
but I could not figure out why it was not using it it.

This fixes https://github.com/voxpupuli/puppetboard/issues/198

This will not be permanent, will have to look into upgrading the flask-wtf
and WTForms packages to the latest versions.
2016-02-06 18:55:45 -05:00
Julien Pivotto
e8bc0ccbb5 Fix screenshots 2016-02-05 16:06:10 +01:00
Corey Hammerton
ddf08b9b75 Merge pull request #215 from nibalizer/rename_vp
"Rename nibalizer to voxpupuli"
2016-02-04 20:05:33 -05:00
Spencer Krum
fbe646f196 Rename nibalizer to voxpupuli 2016-02-03 06:41:37 -08:00
Corey Hammerton
65c6251bac Merge pull request #214 from corey-hammerton/issue-213
templates/index: Directly referencing config.REFRESH_RATE
2016-02-01 20:44:24 -05:00
Corey Hammerton
5874a58965 Merge pull request #212 from corey-hammerton/issue-209
puppetboard/app.py: Don't filter on environments if all are selected
2016-02-01 20:44:16 -05:00
corey.hammerton
f9edda82b4 templates/index: Directly referencing config.REFRESH_RATE
Fixes https://github.com/voxpupuli/puppetboard/issues/213

Also changing the 'if' condition from '!=' to '>' since this application
can only work with unsigned integers
2016-02-01 19:59:24 -05:00
corey.hammerton
8fa0514585 puppetboard/app.py: If all environments are selected do not filter for event counts.
Fixes https://github.com/voxpupuli/puppetboard/issues/209

The event_count queries for the reports in the reports() and reports_node()
functions were always filtering on environments, even if all environments, *,
were selected. This update removes the environment clause from the query
string if 'All Environments' are selected
2016-02-01 19:43:46 -05:00
Corey Hammerton
fd29fe4261 Merge pull request #208 from corey-hammerton/readme
README.rst: Updating documentation with new configuration settings.
2016-02-01 19:25:33 -05:00
corey.hammerton
3ebde245ed requirements.txt: Updating the required version of pypuppetdb
The standard package requirements have a dependency on version 0.2.1
of pypuppetdb, updating the developer requirements list with the same version
2016-02-01 19:23:31 -05:00
Jan Collijs
21fee5b775 Feature: added examples to the readme 2016-01-22 10:11:02 +01:00
Raphaël Pinson
8e4af7c034 Use more standard colors for Puppet run states 2016-01-21 18:20:50 +01:00
Corey Hammerton
370c514745 README.rst: Updating documentation with new configuration settings.
Adding documentation for new configuration settings that have been
added since it was last updated.
2016-01-18 20:56:07 -05:00
Corey Hammerton
de22c61056 Merge pull request #204 from corey-hammerton/pypuppetdb-0.2.1
Using new Node and Catalog fields available in pypuppetdb 0.2.1

With the latest_report_hash field available on the Node object the report_latest can be partially deprecated. Will hopefully be removed in the next major/minor release.
2016-01-18 20:03:55 -05:00
Corey Hammerton
4226fdc368 Merge pull request #203 from corey-hammerton/issue-193
templates/catalog_compare: Switching from basic tables to fixed tables
2016-01-18 20:01:04 -05:00
Corey Hammerton
43e37fdf64 Using new Node and Catalog fields available in pypuppetdb 0.2.1
Showing the Code ID field in the catalogs page. This is currently
unused in PuppetDB as of 3.2.2 but may be useful when it will be used

If available, using the latest_report_hash field of the node object
in the index and nodes templates for the link to the latest report
available for the node.

Updating the report_latest function in app.py to query the nodes
endpoint and redirecting using the latest_report_hash field if available.
If not query the reports endpoint for the node's latest report.
2015-12-28 16:07:43 -05:00
Corey Hammerton
9b8c8332ef templates/catalog_compare: Switching from basic tables to fixed tables
Fixed https://github.com/puppet-community/puppetboard/issues/193

Fixed Semantic UI tables set a fixed position on the applied tables
that do not affect the alignment with narrow browser windows. Downside
of this approach is that users will have to scroll horizontally to view
the entire catalog comparison.
2015-12-28 15:25:59 -05:00
Corey Hammerton
40bd73415d Merge pull request #145 from nibalizer/graphing_facts
"Add clientversion to graphing facts"
2015-12-19 10:12:54 -05:00
Spencer Krum
596e850189 Add clientversion to graphing facts 2015-12-17 10:14:13 -08:00
Corey Hammerton
23b95dc1d2 Merge pull request #189 from corey-hammerton/reload_envs
puppetboard: Reloading the available environments on every page load.
2015-12-14 21:28:03 -05:00
Corey Hammerton
cc9b3de2ec puppetboard/app: Loading the environments in each error_processor function
In the previous commit the environment loading was moving to each request
and that functionality change was not reflected in the error processor
functions (for 4xx and 5xx series errors)
2015-12-14 21:26:09 -05:00
Corey Hammerton
1c7363afa0 Merge pull request #191 from octomike/fix_format_index
fix: wrong index with format()
2015-12-14 21:25:38 -05:00
Spencer Krum
f5ff5b378d Merge pull request #99 from tjayl/auto-refresh
Add auto-refresh on index page
2015-12-05 12:45:25 -08:00
TJayl
177f6c234a Add the auto-refresh to the index page 2015-12-04 13:45:45 +00:00
Michael Krause
8ddec01ca0 fix: wrong index with format() 2015-11-19 14:57:09 +01:00
Corey Hammerton
26d7d43d17 puppetboard: Reloading the available environments on every page load.
Moving the global environment list from a global context to a functional
context because octomike reported that the environment list in his environment
was not being refreshed.

Adding CHANGELOG entries for 0.1.1 and this new change.
2015-11-18 18:34:01 -05:00
Corey Hammerton
f63a0cefcb Merge pull request #185 from raphink/all_envs
Allow to list all nodes again (remove environment filter)

Adding a configurable default environment setting in case some environments to not have a 'production' environment.

Adding a '*' option to remove environment filters.
2015-11-18 18:14:22 -05:00