diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2007-10-26 17:33:44 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2007-10-26 17:33:44 -0400 |
commit | 9060cccfbfa77fbc8592f07e4641514d7a740a1f (patch) | |
tree | 10b0420e6a8ab82087b2898fd96cf5764162bd75 /func/minion/modules/virt.py | |
parent | d7f4a0ebebe416084ec726d38f485246aa88e886 (diff) | |
download | func-9060cccfbfa77fbc8592f07e4641514d7a740a1f.tar.gz func-9060cccfbfa77fbc8592f07e4641514d7a740a1f.tar.xz func-9060cccfbfa77fbc8592f07e4641514d7a740a1f.zip |
Adds the filetracker module, originally developed by fordship, with some tweaks. "func spec call filetracker track filename" can be
used to track a file, and "func spec call filetracker untrack filename" removes it. Then it shows up with lots of data using
"func spec call filetracker inventory". Addition can also specify for the contents of data in the said files to be noted in inventory.
Additionally, the inventory function can be told to return data structures instead of an easily-diffable list, and
the checksums can be enabled/disabled.
Diffstat (limited to 'func/minion/modules/virt.py')
-rwxr-xr-x | func/minion/modules/virt.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/func/minion/modules/virt.py b/func/minion/modules/virt.py index 7dc5697..3e7fc2d 100755 --- a/func/minion/modules/virt.py +++ b/func/minion/modules/virt.py @@ -22,7 +22,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # other modules import os import sub_process -import libvirt +# import libvirt # our modules import codes @@ -42,6 +42,13 @@ class FuncLibvirtConnection(object): def __init__(self): + self.loaded = False + + try: + import libvirt + self.loaded = True + except: + return cmd = sub_process.Popen("uname -r", shell=True, stdout=sub_process.PIPE) output = cmd.communicate()[0] @@ -147,6 +154,8 @@ class Virt(func_module.FuncModule): def get_conn(self): self.conn = FuncLibvirtConnection() + if not self.conn.loaded: + return False return self.conn def info(self): |