Bug 45228 - atJobs() trows a traceback in single-school environment
atJobs() trows a traceback in single-school environment
Status: NEW
Product: USI
Classification: Unclassified
Component: univention-support-info
unspecified
Other Linux
: P5 normal
: ---
Assigned To: USI maintainer
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-21 15:30 CEST by Christina Scheinig
Modified: 2017-08-21 15:38 CEST (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2017082121000205
Bug group (optional):
Max CVSS v3 score:
scheinig: Patch_Available+


Attachments
patch (418 bytes, patch)
2017-08-21 15:30 CEST, Christina Scheinig
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christina Scheinig univentionstaff 2017-08-21 15:30:26 CEST
Created attachment 9126 [details]
patch

root@dcs1:~/univention-support# /tmp/univention-support-info
Collecting command output: .................................................done.
Collecting files: ..............................................................................................................................................................................................................................................................................................................................................................................................................................................................done.
Searching for changed template files: done.
Collecting package lists: done. 
Collecting output transaction-file-check: done.
Traceback (most recent call last):
  File "/tmp/univention-support-info", line 1101, in <module>
    main(options.encrypt)
  File "/tmp/univention-support-info", line 1061, in main
    atJobs()
  File "/tmp/univention-support-info", line 931, in atJobs
    jobs += '\n'.join(str(job), job.command)
TypeError: join() takes exactly one argument (2 given)

=============================================================================
 917 def atJobs():
 918         '''
 919         Generate a list of at-Jobs (usefull for UCS@school)
 920         '''
 921         try:
 922                 from univention.lib import atjobs as at
 923         except ImportError, error:
 924                 error = str(error.message)
 925                 addFile('info/at-jobs' + '.ERROR', len(error), cStringIO.StringIO(error))
 926                 return
 927 
 928         jobs = ''
 929         try:
 930                 for job in at.list(extended=True):
 931                         jobs += '\n'.join(str(job))
 932         except OSError, error:
 933                 error = str(error.message)
 934                 addFile('info/at-jobs' + '.ERROR', len(error), cStringIO.StringIO(error))
 935         addFile('info/at-jobs', len(jobs), cStringIO.StringIO(jobs))
==============================================================================
Comment 1 Florian Best univentionstaff 2017-08-21 15:38:42 CEST
Comment on attachment 9126 [details]
patch

The patch is still wrong and gives a traceback.
Either:
jobs += '\n'.join([str(job), job.command])
Or even better:

jobs += '%s\n%s\n' % (job, job.command)