Add package version history tracking (WIP)

Track the install time of each package per node to enable reports
based on the historic data. This will enable ponyexpress to generate
reports like listing outdated packages.

This branch is still work in progress.

Signed-off-by: Christoph Kassen <c.kassen@telekom.de>
WIP - Package and Mirror history tracking

Still work in progress.
Add tracking of packages on apt repo servers/mirrors.
- Store every package version present on the mirror at time of check
- Compare tracked packages with mirror to find outdated versions

Signed-off-by: Christoph Kassen <c.kassen@telekom.de>
WIP - API work for outdated packages

Pushing this upstream so we can rebase other branches on top of it
and continue to work in it in parallel.

Changes include:
- updates to the module import handling
- bugfixes to make the packages list api returning data again
- unit test updates
- a simple command to prepopulate the database for testing purposes

Signed-off-by: Christoph Kassen <c.kassen@telekom.de>
bugfix: print statement for python3 in test

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
bugfix: python3 requires strings to be encoded before hashing

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
bugfix: decode byte string for python3 compatibility

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
bugfix: python3 doesnt support itervalues anymore, use values instead

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
bugfix: use continue instead of next() in python3 for loop and make try-catch inside the for loop not outside

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
Fix py3.3+ compat

cmp has been removed, replace with poor man's approach for now. Fill
refactor later

Signed-off-by: Christoph Kassen <c.kassen@telekom.de>
Merge pull request #31 from TelekomCloud/feature/version_tracking

feature: implement version tracking
remove stale comments from addNode

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
add tests for consumer mirror api (GET only)

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
abstract the response type of the get request to make it configurable

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
added tests for update mirror + refactored request json in tests

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
added test for deleting a mirror

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
id field in mirror database should be integer (which is auto-incremented, thus 1 for tests)

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
added additional fields for mirror: name and provider

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
updated patch-api for mirrors from /v1/mirrors -> /v1/mirrors/<id>

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
use the plural of mirrors when deleting an item

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>