diff options
| -rw-r--r-- | bitbake/lib/toaster/contrib/tts/urlcheck.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/contrib/tts/urlcheck.py b/bitbake/lib/toaster/contrib/tts/urlcheck.py index 8514de8956..0820f82e2a 100644 --- a/bitbake/lib/toaster/contrib/tts/urlcheck.py +++ b/bitbake/lib/toaster/contrib/tts/urlcheck.py | |||
| @@ -2,11 +2,12 @@ from __future__ import print_function | |||
| 2 | import sys | 2 | import sys |
| 3 | 3 | ||
| 4 | import httplib2 | 4 | import httplib2 |
| 5 | |||
| 6 | import config | 5 | import config |
| 7 | import urllist | 6 | import urllist |
| 8 | 7 | ||
| 9 | 8 | ||
| 9 | config.logger.info("Testing %s with %s", config.TOASTER_BASEURL, config.W3C_VALIDATOR) | ||
| 10 | |||
| 10 | def validate_html5(url): | 11 | def validate_html5(url): |
| 11 | http_client = httplib2.Http(None) | 12 | http_client = httplib2.Http(None) |
| 12 | status = "Failed" | 13 | status = "Failed" |
| @@ -23,6 +24,12 @@ def validate_html5(url): | |||
| 23 | status = resp['x-w3c-validator-status'] | 24 | status = resp['x-w3c-validator-status'] |
| 24 | errors = int(resp['x-w3c-validator-errors']) | 25 | errors = int(resp['x-w3c-validator-errors']) |
| 25 | warnings = int(resp['x-w3c-validator-warnings']) | 26 | warnings = int(resp['x-w3c-validator-warnings']) |
| 27 | |||
| 28 | if status == 'Invalid': | ||
| 29 | config.logger.warn("Failed %s is %s\terrors %s warnings %s (check at %s)", url, status, errors, warnings, urlrequest) | ||
| 30 | else: | ||
| 31 | config.logger.debug("OK! %s", url) | ||
| 32 | |||
| 26 | except Exception as exc: | 33 | except Exception as exc: |
| 27 | config.logger.warn("Failed validation call: %s", exc) | 34 | config.logger.warn("Failed validation call: %s", exc) |
| 28 | return (status, errors, warnings) | 35 | return (status, errors, warnings) |
