| Index: client/common_lib/sys_power.py
|
| diff --git a/client/common_lib/sys_power.py b/client/common_lib/sys_power.py
|
| index 3ddcfee237b217f93dfc04e85c0bd6a497f0222d..56bce4c9dbf780e531aca8544457e073bf7bfc64 100644
|
| --- a/client/common_lib/sys_power.py
|
| +++ b/client/common_lib/sys_power.py
|
| @@ -1,5 +1,16 @@
|
| +#!/usr/bin/python
|
| +
|
| +# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
|
| +# Use of this source code is governed by a BSD-style license that can be
|
| +# found in the LICENSE file.
|
| +
|
| +"""Provides utility methods for controlling powerd in ChromiumOS.
|
| +"""
|
| +
|
| import os
|
| +from autotest_lib.client.common_lib import utils
|
|
|
| +SUSPEND_CMD='/usr/bin/powerd_suspend'
|
|
|
| def set_state(state):
|
| """
|
| @@ -12,8 +23,8 @@ def suspend_to_ram():
|
| """
|
| Suspend the system to RAM (S3)
|
| """
|
| - if os.path.exists('/usr/bin/powerd_suspend'):
|
| - os.system('/usr/bin/powerd_suspend')
|
| + if os.path.exists(SUSPEND_CMD):
|
| + utils.system(SUSPEND_CMD)
|
| else:
|
| set_power_state('mem')
|
|
|
|
|