If the /var/lib/rpm directory exists on the system (this happens if
the "rpm" package is installed), the call to smart.initPlugins() in
landscape/package/facade.py makes the reporter crash with:
Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 328, in _runCallbacks
self.result = callback(self.result, *args, **kw)
File "./landscape/package/reporter.py", line 52, in <lambda>
result.addCallback(lambda x: self.request_unknown_hashes())
File "./landscape/package/reporter.py", line 278, in request_unknown_hashes
self.ensure_channels_reloaded()
File "./landscape/package/taskhandler.py", line 30, in ensure_channels_reloaded
self._facade.reload_channels()
File "./landscape/package/facade.py", line 94, in reload_channels
ctrl = self._get_ctrl()
File "./landscape/package/facade.py", line 73, in _get_ctrl
smart.initPlugins()
File "/usr/lib/python2.6/dist-packages/smart/__init__.py", line 185, in initPlugins
__import__("smart.plugins."+entry[:-3])
File "/usr/lib/python2.6/dist-packages/smart/plugins/detectsys.py", line 66, in <module>
detectRPMSystem()
File "/usr/lib/python2.6/dist-packages/smart/plugins/detectsys.py", line 34, in detectRPMSystem
"name": "RPM System"
File "/usr/lib/python2.6/dist-packages/smart/sysconfig.py", line 226, in set
self.assertWritable()
File "/usr/lib/python2.6/dist-packages/smart/sysconfig.py", line 66, in assertWritable
raise Error, _("Configuration is in readonly mode.")
Error: Configuration is in readonly mode.
Looking at the smart code shows that the problem is in plugins/detectsys.py:
def detectRPMSystem():
dir = os.path.join(sysconf.get("rpm-root", "/"), "var/lib/rpm")
if os.path.isdir(dir):
for alias in sysconf.keys("channels"):
if sysconf.get(("channels", alias, "type")) == "rpm-sys": break
else: sysconf.set("channels.rpm-sys", { "type": "rpm-sys", "name": "RPM System" })
because of the sysconf.set call in the else: branch.
affects landscape-client
importance medium
milestone 1.3.2
If the /var/lib/rpm directory exists on the system (this happens if package/ facade. py makes the reporter crash with:
the "rpm" package is installed), the call to smart.initPlugins() in
landscape/
Traceback (most recent call last): python2. 6/dist- packages/ twisted/ internet/ defer.py" , line 328, in _runCallbacks self.result, *args, **kw) package/ reporter. py", line 52, in <lambda> addCallback( lambda x: self.request_ unknown_ hashes( )) package/ reporter. py", line 278, in request_ unknown_ hashes ensure_ channels_ reloaded( ) package/ taskhandler. py", line 30, in ensure_ channels_ reloaded _facade. reload_ channels( ) package/ facade. py", line 94, in reload_channels package/ facade. py", line 73, in _get_ctrl initPlugins( ) python2. 6/dist- packages/ smart/_ _init__ .py", line 185, in initPlugins _("smart. plugins. "+entry[ :-3]) python2. 6/dist- packages/ smart/plugins/ detectsys. py", line 66, in <module> stem() python2. 6/dist- packages/ smart/plugins/ detectsys. py", line 34, in detectRPMSystem python2. 6/dist- packages/ smart/sysconfig .py", line 226, in set assertWritable( ) python2. 6/dist- packages/ smart/sysconfig .py", line 66, in assertWritable
File "/usr/lib/
self.result = callback(
File "./landscape/
result.
File "./landscape/
self.
File "./landscape/
self.
File "./landscape/
ctrl = self._get_ctrl()
File "./landscape/
smart.
File "/usr/lib/
__import_
File "/usr/lib/
detectRPMSy
File "/usr/lib/
"name": "RPM System"
File "/usr/lib/
self.
File "/usr/lib/
raise Error, _("Configuration is in readonly mode.")
Error: Configuration is in readonly mode.
Looking at the smart code shows that the problem is in plugins/ detectsys. py:
def detectRPMSystem(): join(sysconf. get("rpm- root", "/"), "var/lib/rpm") keys("channels" ): get(("channels" , alias, "type")) == "rpm-sys":
break
sysconf. set("channels. rpm-sys" , {
"type": "rpm-sys",
"name": "RPM System"
})
dir = os.path.
if os.path.isdir(dir):
for alias in sysconf.
if sysconf.
else:
because of the sysconf.set call in the else: branch.
affects landscape-client
importance medium
milestone 1.3.2