Index: tools/metrics/histograms/update_policies.py |
diff --git a/tools/metrics/histograms/update_policies.py b/tools/metrics/histograms/update_policies.py |
index 79f524f690b97a526fb139a90d0fd5233679b797..346dcab18b55868cfc39ac1166328f51c8f3f505 100644 |
--- a/tools/metrics/histograms/update_policies.py |
+++ b/tools/metrics/histograms/update_policies.py |
@@ -16,15 +16,14 @@ from ast import literal_eval |
from optparse import OptionParser |
from xml.dom import minidom |
-import print_style |
- |
-# Import the metrics/common module. |
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common')) |
from diff_util import PromptUserToAcceptDiff |
+import path_util |
+ |
+import print_style |
-HISTOGRAMS_PATH = 'histograms.xml' |
-POLICY_TEMPLATES_PATH = ( |
- '../../../components/policy/resources/policy_templates.json') |
+HISTOGRAMS_PATH = path_util.GetHistogramsFile() |
+POLICY_TEMPLATES_PATH = 'components/policy/resources/policy_templates.json' |
ENUM_NAME = 'EnterprisePolicies' |
class UserError(Exception): |
@@ -114,7 +113,7 @@ def main(): |
sys.stderr.write(__doc__) |
sys.exit(1) |
- with open(POLICY_TEMPLATES_PATH, 'rb') as f: |
+ with open(path_util.GetInputFile(POLICY_TEMPLATES_PATH), 'rb') as f: |
policy_templates = literal_eval(f.read()) |
with open(HISTOGRAMS_PATH, 'rb') as f: |
histograms_doc = minidom.parse(f) |