summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-09-26 17:29:53 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-09-26 17:29:53 -0400
commitc0d4b8c9a66c642fef93fd4508f8dbee1c338fa7 (patch)
treee507257d5d6ddcc1e32fbd86c40438a1ce4db093 /modules
parentc6935aeff23ccd02d4f236dedf86f108c4df853b (diff)
downloadthird_party-func-c0d4b8c9a66c642fef93fd4508f8dbee1c338fa7.tar.gz
third_party-func-c0d4b8c9a66c642fef93fd4508f8dbee1c338fa7.tar.xz
third_party-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.
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/hardware.py10
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