power_Standby: Use utils.args_to_dict() to parse arg

BUG=b:78032715
TEST=power_Standby still work fine with args

Change-Id: Ib1e432444fd47debc28ae982f0f632f2b5962e12
Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1345590
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Todd Broch <tbroch@chromium.org>
diff --git a/client/site_tests/power_Standby/control b/client/site_tests/power_Standby/control
index 215f45d..424aebc 100644
--- a/client/site_tests/power_Standby/control
+++ b/client/site_tests/power_Standby/control
@@ -30,21 +30,14 @@
   test_hours > sample_hours
 """
 
-opts = {}
-sample_hours = 1.0
-test_hours = 12.0
+SAMPLE_HOURS = 1.0
+TEST_HOURS = 12.0
 max_milliwatts_standby = 500.0
 
-for arg in args:
-    match = re.search("^(\w+)=(.+)", arg)
-    if match:
-        opts[match.group(1)] = match.group(2)
+args_dict = utils.args_to_dict(args)
 
-if 'test_hours' in opts:
-    test_hours = float(opts['test_hours'])
-
-if 'sample_hours' in opts:
-    sample_hours = float(opts['sample_hours'])
+sample_hours = float(args_dict.get('sample_hours'), SAMPLE_HOURS)
+test_hours = float(args_dict.get('test_hours'), TEST_HOURS)
 
 job.run_test('power_Standby', sample_hours=sample_hours, test_hours=test_hours,
              max_milliwatts_standby=max_milliwatts_standby)