Modify

Ticket #611 (closed defect: fixed)

Opened 14 years ago

Last modified 14 years ago

bcfg2.conf filemonitor specification doesn't seem to work

Reported by: dclark Owned by: desai
Priority: minor Milestone: Bcfg2 0.9.6 Release
Component: bcfg2-client Version:
Keywords: Cc:

Description (last modified by dclark) (diff)

In bcfg2.conf [server] section, setting filemonitor = fam or filemonitor = gamin doesn't seem to work.

  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Core.py", line 32, in __init__
    self.fam = Bcfg2.Server.FileMonitor.available[filemonitor]()
KeyError: True

It looks like the issue is that somewhere filemonitor is being defined as a Boolean instead of a string.

Also once this does work the man page for bcfg2.conf should be updated to add 'pseudo' to the 'gam' and 'famin' options to filemonitor.

See also ticket:536

Attachments

Change History

comment:1 Changed 14 years ago by dclark

  • Description modified (diff)

comment:2 Changed 14 years ago by dclark

This seems to work to force filemonitor to be a string instead of a boolean.

--- Options.py.orig     2008-11-12 23:02:18.000000000 -0500
+++ Options.py  2008-11-12 23:26:40.000000000 -0500
@@ -165,6 +165,7 @@
     if c_string:
         return c_string.split(':')
     return []
+force_string = lambda x:x.replace(' ','')

 CFILE = Option('Specify configuration file', DEFAULT_CONFIG_LOCATION, cmd='-C',
                odesc='<conffile>')
@@ -186,7 +187,7 @@
 SERVER_STRUCTURES = Option('Server structure list', cf=('server', 'structures'),
                            default=['Bundler', 'Base'], cook=list_split)
 SERVER_FILEMONITOR = Option('Server file monitor', cf=('server', 'filemonitor'),
-                            default='default')
+                            default='default', cook=force_string)
 SERVER_LOCATION = Option('Server Location', cf=('components', 'bcfg2'),
                          default='https://localhost:6789', cmd='-S',
                          odesc='https://server:port')

However setting filemonitor = pseudo causes a whole cascade of errors (below includes output of some print statements for debugging)

filemonitor:  pseudo
generators:  ['SSHbase', 'Cfg', 'Pkgmgr', 'Rules', 'TCheetah', 'TGenshi']
self.fam:  <Bcfg2.Server.FileMonitor.PseudoFam object at 0xc8b290>
Unexpected instantiation failure for plugin Bundler
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Core.py", line 118, in init_plugins
    self.plugins[plugin] = plug(self, self.datastore)
  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Plugins/Bundler.py", line 17, in __init__
    Bcfg2.Server.Plugin.XMLDirectoryBacked.__init__(self, self.data, self.core.fam)
  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Plugin.py", line 157, in __init__
    fam.AddMonitor(name, self)
  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/FileMonitor.py", line 191, in AddMonitor
    handle = GaminEvent(handleID, path, 'exists')
  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/FileMonitor.py", line 96, in __init__
    action_map = {GAMCreated: 'created', GAMExists: 'exists', GAMChanged: 'changed',
NameError: global name 'GAMCreated' is not defined
Unexpected instantiation failure for plugin Base
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Core.py", line 118, in init_plugins
    self.plugins[plugin] = plug(self, self.datastore)
  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Plugins/Base.py", line 20, in __init__
    Bcfg2.Server.Plugin.XMLDirectoryBacked.__init__(self, self.data, self.core.fam)
  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Plugin.py", line 157, in __init__
    fam.AddMonitor(name, self)
  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/FileMonitor.py", line 191, in AddMonitor
    handle = GaminEvent(handleID, path, 'exists')
  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/FileMonitor.py", line 96, in __init__
    action_map = {GAMCreated: 'created', GAMExists: 'exists', GAMChanged: 'changed',
NameError: global name 'GAMCreated' is not defined
Failed to load SGenshi repository; disabling SGenshi
Failed to instantiate plugin SGenshi
Unexpected instantiation failure for plugin SSHbase
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Core.py", line 118, in init_plugins
    self.plugins[plugin] = plug(self, self.datastore)
  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Plugins/SSHbase.py", line 39, in __init__
    Bcfg2.Server.Plugin.DirectoryBacked.__init__(self, self.data, self.core.fam)
  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Plugin.py", line 157, in __init__
    fam.AddMonitor(name, self)
  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/FileMonitor.py", line 191, in AddMonitor
    handle = GaminEvent(handleID, path, 'exists')
  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/FileMonitor.py", line 96, in __init__
    action_map = {GAMCreated: 'created', GAMExists: 'exists', GAMChanged: 'changed',

[...]

comment:3 Changed 14 years ago by dclark

  • Description modified (diff)

comment:4 Changed 14 years ago by desai

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone set to Bcfg2 0.9.6 Release

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.