google-code-export / yabi

Automatically exported from code.google.com/p/yabi
0 stars 1 forks source link

Build fails with Use output filename on Output File argument #174

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a tool as attached broken_dd.json. The "of" argument is an output 
file that has "use_output_filename__switch" set to "of" 
2. Design a simple Workflow, that has a fileselector selecting 1 file and a dd 
job with "if" set to the file selected by the fileselector and for of type in a 
filename ex. outfile
3. Run the Workflow designed in step 2.

What is the expected output? What do you see instead?

If the way the "of" argument is set up is incorrectly then we should get an 
error message saying that, if it's setup is correct then this is a bug and it 
has to be fixed.

Currently, the Workflow.build() fails with message at the bottom of this report.

The SwitchFilename has been created without a template function, so it will be 
None later on when __str__() is called:

Please look in yabiengine/commandlinetemplate.py currently line 502:

if tp.output_file:
  if tp.use_output_filename:
    # this means output filename has to be named after the filename associated with the switch this parameter is pointing to
    if tp.extension_param:
      value = SwitchFilename(default=value, template=make_fname, source_switch=tp.use_output_filename.switch,  extension=tp.extension_param.extension() )
    else:
      value = SwitchFilename(default=value, source_switch=tp.use_output_filename.switch)

Traceback:

[2012-03-16 05:10:49,993: ERROR/MainProcess] Task 
yabiadmin.yabiengine.tasks.build[96612014-edbb-446e-9b68-1ab522353c36] raised 
exception: TypeError("'NoneType' object is not callable",)
Traceback (most recent call last):
  File "/home/tszabo/Work/yabi/yabiadmin/yabiadmin/virt_yabiadmin/local/lib/python2.7/site-packages/celery/execute/trace.py", line 153, in trace_task
    R = retval = task(*args, **kwargs)
  File "/home/tszabo/Work/yabi/yabiadmin/yabiadmin/yabiengine/tasks.py", line 42, in build
    eworkflow.build()
  File "/home/tszabo/Work/yabi/yabiadmin/yabiadmin/virt_yabiadmin/local/lib/python2.7/site-packages/django/db/transaction.py", line 217, in inner
    res = func(*args, **kwargs)
  File "/home/tszabo/Work/yabi/yabiadmin/yabiadmin/yabiengine/enginemodels.py", line 112, in build
    job.add_job(job_dict)
  File "/home/tszabo/Work/yabi/yabiadmin/yabiadmin/yabiengine/enginemodels.py", line 315, in add_job
    self.command = str(template)                    # text description of command
  File "/home/tszabo/Work/yabi/yabiadmin/yabiadmin/yabiengine/commandlinetemplate.py", line 364, in __str__
    return "%s (%s)"%(str(self.command),str(self.arguments))
  File "/home/tszabo/Work/yabi/yabiadmin/yabiadmin/yabiengine/commandlinetemplate.py", line 159, in __repr__
    return str(self)
  File "/home/tszabo/Work/yabi/yabiadmin/yabiadmin/yabiengine/commandlinetemplate.py", line 156, in __str__
    return "<Switch:%s Value:%s>"%(self.flag, self.value)
  File "/home/tszabo/Work/yabi/yabiadmin/yabiadmin/yabiengine/commandlinetemplate.py", line 112, in __str__
    return quote_argument(self.template(self.filename, self.extension))
TypeError: 'NoneType' object is not callable

Original issue reported on code.google.com by szab...@gmail.com on 15 Mar 2012 at 9:56

GoogleCodeExporter commented 9 years ago

Original comment by szab...@gmail.com on 16 Mar 2012 at 1:48

Attachments:

GoogleCodeExporter commented 9 years ago
Use Output Filename is designed so if you have a tool such that you would pick 
"if" in this instance
so then when your output file comes out it would be named by yabi based on the 
file supplied at the if parameter.

To solve this:
Make the admin field that provides options for Output Filename not include 
itself (ie of would not include of in the list)
Add further explanation to UI

Also the __str__ code has to be reviewed and fixed: This is probably the same 
bug as http://code.google.com/p/yabi/issues/detail?id=138&q=Nonetype

Original comment by szab...@gmail.com on 16 Mar 2012 at 2:18

GoogleCodeExporter commented 9 years ago
Issue 138 has been merged into this issue.

Original comment by amacgregor on 16 Mar 2012 at 2:47

GoogleCodeExporter commented 9 years ago

Original comment by szab...@gmail.com on 16 Mar 2012 at 2:52

GoogleCodeExporter commented 9 years ago
Fixed in bb534657e85f on branch tszabo.

Original comment by szab...@gmail.com on 16 Mar 2012 at 7:43