diff options
| author | Daniel Manrique <roadmr@ubuntu.com> | 2014-09-09 12:02:53 -0400 |
|---|---|---|
| committer | Daniel Manrique <roadmr@ubuntu.com> | 2014-09-09 12:02:53 -0400 |
| commit | 557ad718e234dd3cdcab579437fccd0d1ebbedaa (patch) | |
| tree | b283df777f0fae71a1d62842fd8ac39b62c9e46a | |
| parent | 313c0432fbbbab8d6d12da2b8b31a3d348f5f930 (diff) | |
providers:checkbox: make hdd_parking more resilient to hdapsd absence
| -rwxr-xr-x | bin/hdd_parking | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/hdd_parking b/bin/hdd_parking index ead27c0..18151b4 100755 --- a/bin/hdd_parking +++ b/bin/hdd_parking @@ -43,8 +43,12 @@ from subprocess import Popen, PIPE TIMEOUT = 15.0 def hdaps_test(run_time): - hdapsd = Popen(['/usr/sbin/hdapsd'], stdout=PIPE, stderr=PIPE, + try: + hdapsd = Popen(['/usr/sbin/hdapsd'], stdout=PIPE, stderr=PIPE, universal_newlines=True) + except OSError as err: + print("Unable to start hdapsd: {}".format(err)) + return 1 time.sleep(float(run_time)) hdapsd.terminate() # Look for parking message in hdapsd output. |
