diff options
author | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-09-26 17:29:53 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-09-26 17:29:53 -0400 |
commit | c0d4b8c9a66c642fef93fd4508f8dbee1c338fa7 (patch) | |
tree | e507257d5d6ddcc1e32fbd86c40438a1ce4db093 | |
parent | c6935aeff23ccd02d4f236dedf86f108c4df853b (diff) | |
download | func-c0d4b8c9a66c642fef93fd4508f8dbee1c338fa7.tar.gz func-c0d4b8c9a66c642fef93fd4508f8dbee1c338fa7.tar.xz func-c0d4b8c9a66c642fef93fd4508f8dbee1c338fa7.zip |
Updated the hardware module so that it's usable if smolt isn't installed. The info() function
won't work but hal_info() still should.
-rwxr-xr-x | modules/hardware.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/hardware.py b/modules/hardware.py index 5366b78..50dd705 100755 --- a/modules/hardware.py +++ b/modules/hardware.py @@ -19,9 +19,6 @@ # other modules import sys -# hack: smolt is not installed in site-packages -sys.path.append("/usr/share/smolt/client") -import smolt # our modules import sub_process @@ -76,6 +73,13 @@ class HardwareModule(func_module.FuncModule): def hw_info(with_devices=True): + # this may fail if smolt is not installed. That's ok. hal_info will + # still work. + + # hack: smolt is not installed in site-packages + sys.path.append("/usr/share/smolt/client") + import smolt + hardware = smolt.Hardware() host = hardware.host |