Bug 675359
Summary: | "Modified" attribute may not exist when diffing files | ||
---|---|---|---|
Product: | [Community] Spacewalk | Reporter: | Zach Carlson <zcarlson> |
Component: | Server | Assignee: | Michael Mráka <mmraka> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Red Hat Satellite QA List <satqe-list> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 1.3 | CC: | slukasik, zcarlson |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | spacewalk-backend-1.4.4-1 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-04-26 09:11:06 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 674675 |
Description
Zach Carlson
2011-02-05 04:15:36 UTC
(In reply to comment #0) > Description of problem: > > When a spacewalk client is reporting the result of a scheduled diff back to the > spacewalk server, the 'row' variable (presumably derived from what the client > reports but possibly from the server's data) may not always have the 'modified' > key set; this would cause an error every time the client tries to rhn_check > (which would subsequently fail and keep retrying until the task is unscheduled, > causing lots of messages). > > Version-Release number of selected component (if applicable): > > 1.3 > > How reproducible: > > Always that I saw. > > Steps to Reproduce: > 1. Schedule a diff between a machine's config file and the config file on a > configuration channel managed by the spacewalk server. > 2. Wait for the diff to be executed (or run rhn_check on the spacewalk client) > 3. Receive messages about a KeyError exception being raised. > > Actual results: > The diff is reported properly to the server without issue. > > Expected results: > The server doesn't accept the report but leaves the task scheduled. > > Additional info: > > Exception Handler Information > Traceback (most recent call last): > File "/usr/lib/python2.4/site-packages/spacewalk/server/apacheRequest.py", > line 118, in call_function > response = apply(func, params) > File "/usr/share/rhn/server/handlers/xmlrpc/queue.py", line 326, in get > ret = self.__getV2(action) > File "/usr/share/rhn/server/handlers/xmlrpc/queue.py", line 84, in __getV2 > result = method(self.server_id, action['id'], dry_run) > File > "/usr/lib/python2.4/site-packages/spacewalk/server/action/configfiles.py", line > 111, in diff > return _get_files(server_id, action_id) > File > "/usr/lib/python2.4/site-packages/spacewalk/server/action/configfiles.py", line > 168, in _get_files > files.append(format_file_results(row, server=server)) > File > "/usr/lib/python2.4/site-packages/spacewalk/server/configFilesHandler.py", line > 535, in format_file_results > if row.has_key('modified'): > KeyError: 'modified' > > row = <type 'dict'> {'config_channel': 'deniro-base', 'username': 'root', > 'checksum': '1d12c5ff935de2ce12031e4a67bd3552', 'delim_start': '{|', > 'delim_end': '|}', 'symlink': None, 'label': 'file', 'groupname': 'root', > 'file_contents': <cx_Oracle.LOB object at 0x2b87d54e2bd0>, 'filemode': 644, > 'checksum_type': 'md5', 'path': '/etc/rsyslog.conf', 'selinux_ctx': None, > 'is_binary': 'N', 'revision': 2} > > I was able to fix it by modifying the file > /usr/lib/python2.4/site-packages/spacewalk/server/configFilesHandler.py at line > 535, just as indicated in the traceback, to read as follows: > > if row.has_key('modified'): > if row['modified']: > m_date = xmlrpclib.DateTime(str(row['modified'])) > else: > m_date = '' > else: > m_date = '' > > (previously it read: > > if row['modified']: > m_date = xmlrpclib.DateTime(str(row['modified'])) > else: > m_date = '' > > ) > > Sorry I didn't get an actual diff. > > Please let me know if you require any further information. (oh, I also had to restart spacewalk after I made that change, in case it wasn't clear) Fixed by commit 71504cda14cd9d6c9f81434dbed7871d3842dad2 675359 - modified attribute is not always present Fixed package spacewalk-backend-1.4.4-1 Mass moving to ON_QA before release of Spacewalk 1.4 Spacewalk 1.4 has been released |