Package report/repo parser integration

 - parser able to filter package versions using keywords
 - warning message on missing tag
 - on the fly versions lookup (excluding '*.hotfix')
 - updated versions compare routine
 - lexical compare uses numbers, not ordinal values
 - updated release version detection
 - final report lists pkg section/app if no description given
 - final report shows repo info for detected release version

Fixes:
 - shorter alternate entrpoints: mcp-pkg, mcp-net, cmp-reclass
 - flake8 syntax
 - proper mirantis/non-mirantis versions getting
 - exit on unexpected arguments
 - salt-master class now gets linux codename by default and architecture

Change-Id: I0a2daadca8a1acaecafc8680226dc00d20cc24ce
Related-PROD: PROD-28199
diff --git a/cfg_checker/reports/reporter.py b/cfg_checker/reports/reporter.py
index 08015cf..04c9034 100644
--- a/cfg_checker/reports/reporter.py
+++ b/cfg_checker/reports/reporter.py
@@ -30,7 +30,7 @@
         return sorted(
             td.keys(),
             key=lambda k: (
-                td[k]['desc']['component'],
+                td[k]['desc']['section'],
                 td[k]['desc']['app'],
                 k
             )
@@ -78,6 +78,28 @@
     return const.all_statuses[sts]
 
 
+def make_repo_info(repos):
+    _text = ""
+    for r in repos:
+        # tag
+        _text += r['tag'] + ": "
+        # repo header
+        _text += " ".join([
+            r['subset'],
+            r['release'],
+            r['ubuntu-release'],
+            r['type'],
+            r['arch']
+        ]) + ", "
+        # maintainer w/o email
+        _m = r['maintainer'][:r['maintainer'].find('<')-1]
+        _m_ascii = _m.encode('ascii', errors="xmlcharrefreplace")
+        _text += _m_ascii
+        # newline
+        _text += "<br />"
+    return _text
+
+
 @six.add_metaclass(abc.ABCMeta)
 class _Base(object):
     def __init__(self):
@@ -126,6 +148,7 @@
         self.jinja2_env.filters['make_status_class'] = make_status_class
         self.jinja2_env.filters['make_action_label'] = make_action_label
         self.jinja2_env.filters['make_action_class'] = make_action_class
+        self.jinja2_env.filters['make_repo_info'] = make_repo_info
 
         # render!
         logger_cli.info("-> Using template: {}".format(self.tmpl))