Fix testrail reporter

1. Pin 'testrail' PyPI package to version 0.3.8 to avoid such error:

    File "/home/jenkins/fuel-devops30/local/lib/python2.7/site-packages/testrail/helper.py", line 83, in <dictcomp>
      return dict({match[1]: match[0] for match in matches if match})
  TypeError: '_sre.SRE_Match' object has no attribute '__getitem__'

2. Fix empty plan errors like:

    File "tcp-qa/tcp_tests/report.py", line 91, in get_runs
      for e in plan.entries:
  AttributeError: 'NoneType' object has no attribute 'entries'

Change-Id: I670c5bd5789287c7d7fa612e7944d954e4b3808b
diff --git a/tcp_tests/report.py b/tcp_tests/report.py
index 46f5995..f08c933 100644
--- a/tcp_tests/report.py
+++ b/tcp_tests/report.py
@@ -88,12 +88,15 @@
     LOG.info("Get runs from plan - {}".format(plan_name))
     ret = []
     plan = t_client.plan(plan_name)
-    for e in plan.entries:
-        for r in e.runs:
-            LOG.info("Run {} #{}".format(r.name, r.id))
-            if run_name is not None and r.name != run_name:
-                continue
-            ret.append(r)
+    if plan:
+        for e in plan.entries:
+            for r in e.runs:
+                LOG.info("Run {} #{}".format(r.name, r.id))
+                if run_name is not None and r.name != run_name:
+                    continue
+                ret.append(r)
+    else:
+        LOG.warning("Plan {} is empty".format(plan_name))
     return ret
 
 
diff --git a/tcp_tests/requirements.txt b/tcp_tests/requirements.txt
index d419b33..f508205 100644
--- a/tcp_tests/requirements.txt
+++ b/tcp_tests/requirements.txt
@@ -13,7 +13,7 @@
 junit-xml
 jinja2>=2.1
 jira
-testrail
+testrail<=0.3.8
 functools32
 python-k8sclient==0.4.0
 salt-pepper<=0.5.3