Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1708)

Unified Diff: chrome/browser/policy/test/policy_testserver.py

Issue 1140333002: Added log messages for cases of failure of open files in policy_testserver.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed cloud_policy_client.cc from the CL Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/test/policy_testserver.py
diff --git a/chrome/browser/policy/test/policy_testserver.py b/chrome/browser/policy/test/policy_testserver.py
index 185296c137febd111c283f96cdcedbff81f97045..c8e1342f7fc46baa593060adb8e0e8357c6e85a5 100644
--- a/chrome/browser/policy/test/policy_testserver.py
+++ b/chrome/browser/policy/test/policy_testserver.py
@@ -79,6 +79,7 @@ except ImportError:
try:
import json
except ImportError:
+ logging.error('Could not import json')
Mattias Nissler (ping if slow) 2015/05/18 13:29:17 I think it's meanwhile fine to just import json un
json = None
import asn1der
@@ -91,12 +92,14 @@ import cloud_policy_pb2 as cp
try:
import chrome_extension_policy_pb2 as ep
except ImportError:
+ logging.error('Could not import chrome_extension_policy_pb2')
Mattias Nissler (ping if slow) 2015/05/18 13:29:17 This will add log spew I guess. A better way of do
ep = None
# Device policy is only available on Chrome OS builds.
try:
import chrome_device_policy_pb2 as dp
except ImportError:
+ logging.error('Could not import chrome_device_policy_pb2')
dp = None
# ASN.1 object identifier for PKCS#1/RSA.
@@ -986,12 +989,12 @@ class PolicyTestServer(testserver_base.BrokenPipeHandlerMixIn,
"""
policy = {}
if json is None:
- print 'No JSON module, cannot parse policy information'
+ logging.error('No JSON module, cannot parse policy information')
else :
try:
policy = json.loads(open(self.policy_path).read(), strict=False)
except IOError:
- print 'Failed to load policy from %s' % self.policy_path
+ logging.error('Failed to load policies from %s' % self.policy_path)
return policy
def RegisterDevice(self, device_id, machine_id, type):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698