[autotest] Extract get_control_file_path method

BUG=chromium:672348
TEST=None

Change-Id: Idb2b8d34f59972c55149c558aabb468985467d40
Reviewed-on: https://chromium-review.googlesource.com/453272
Commit-Ready: Allen Li <ayatane@chromium.org>
Tested-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
diff --git a/server/cros/dynamic_suite/control_file_getter.py b/server/cros/dynamic_suite/control_file_getter.py
index f4bed55..0aad2ef 100644
--- a/server/cros/dynamic_suite/control_file_getter.py
+++ b/server/cros/dynamic_suite/control_file_getter.py
@@ -110,16 +110,16 @@
         pass
 
 
-    def get_control_file_contents_by_name(self, test_name):
+    def get_control_file_path(self, test_name):
         """
-        Given the name of a control file, return its contents.
+        Given the name of a control file, return its path.
 
         Searches through previously-compiled list in |self._files| for a
         test named |test_name| and returns the contents of the control file
         for that test if it is found.
 
         @param test_name: the name of the test whose control file is desired.
-        @return the contents of the control file specified by the name.
+        @return control file path
         @throws ControlFileNotFound if the file cannot be retrieved.
         """
         if not self._files and not self.get_control_file_list():
@@ -134,7 +134,23 @@
             raise error.ControlFileNotFound('No control file for ' + test_name)
         if len(candidates) > 1:
             raise error.ControlFileNotFound(test_name + ' is not unique.')
-        return self.get_control_file_contents(candidates[0])
+        return candidates[0]
+
+
+    def get_control_file_contents_by_name(self, test_name):
+        """
+        Given the name of a control file, return its contents.
+
+        Searches through previously-compiled list in |self._files| for a
+        test named |test_name| and returns the contents of the control file
+        for that test if it is found.
+
+        @param test_name: the name of the test whose control file is desired.
+        @return the contents of the control file specified by the name.
+        @throws ControlFileNotFound if the file cannot be retrieved.
+        """
+        path = self.get_control_file_path(test_name)
+        return self.get_control_file_contents(path)
 
 
 class FileSystemGetter(CacheingAndFilteringControlFileGetter):