~maas-committers/maas/trunk

« back to all changes in this revision

Viewing changes to src/provisioningserver/drivers/power/apc.py

  • Committer: MAAS Lander
  • Author(s): Blake Rouse
  • Date: 2016-04-13 21:57:12 UTC
  • mfrom: (4918.1.1 fix-1569873)
  • Revision ID: maas_lander-20160413215712-2l0pisulcgpxs6hi
[r=mpontillo,newell-jensen][bug=1569873][author=blake-rouse] Fix AMT driver to handle the updated decoding. Fix over use of PowerFatalError that prevents retries from occurring.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
from provisioningserver.drivers.power import (
19
19
    PowerActionError,
20
20
    PowerDriver,
21
 
    PowerFatalError,
22
21
)
23
22
from provisioningserver.utils import shell
24
23
from provisioningserver.utils.shell import select_c_utf8_locale
52
51
        stdout = stdout.decode("utf-8")
53
52
        stderr = stderr.decode("utf-8")
54
53
        if proc.returncode != 0:
55
 
            raise PowerFatalError(
 
54
            raise PowerActionError(
56
55
                "APC Power Driver external process error for command %s: %s"
57
56
                % (command, stderr))
58
57
        match = re.search("INTEGER:\s*([1-2])", stdout)
59
58
        if match is None:
60
 
            raise PowerFatalError(
 
59
            raise PowerActionError(
61
60
                "APC Power Driver unable to extract outlet power state"
62
61
                " from: %s" % stdout)
63
62
        else: