Bug 1395080 - Python error NoneType has no attribute output_filename
Summary: Python error NoneType has no attribute output_filename
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: rho
Version: epel7
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jesus M. Rodriguez
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1266036 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-15 05:36 UTC by Michael Gregg
Modified: 2017-11-06 15:53 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-06 15:53:30 UTC
Type: Bug


Attachments (Terms of Use)

Description Michael Gregg 2016-11-15 05:36:16 UTC
Description of problem:
Attempting to scan a /24 network with rho.
Does not write csv files to disk. 
Reports error 
"AttributeError: 'NoneType' object has no attribute 'output_filename'"

Version-Release number of selected component (if applicable):
rho-0.0.27-1.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. rho auth add --name myroot --username <username> [--file <rsa file>]
2. rho profile add --name deep1 --range "172.21.228.2 - 172.21.228.253" --auth myroot
3. rho scan --profile deep1 --report pack-scan

Actual results:
 No csv file created.

Expected results:
 To have a csv file with some data in it. 

Additional info:

Traceback (most recent call last):
  File "/usr/bin/rho", line 20, in <module>
    CLI().main()
  File "/usr/lib/python2.7/site-packages/rho/cli.py", line 97, in main
    cmd.main()
  File "/usr/lib/python2.7/site-packages/rho/clicommands.py", line 327, in main
    self._do_command()
  File "/usr/lib/python2.7/site-packages/rho/clicommands.py", line 587, in _do_c                                                                                                                                                              ommand
    reportobj.output_filename)), "w")
AttributeError: 'NoneType' object has no attribute 'output_filename'

Comment 1 Jesus M. Rodriguez 2016-11-15 14:20:15 UTC
Looking at the code this would happen if there is no pack-scan report defined in the rho config.

Can you please provide the output of 'rho report show --name pack-scan'?

I expect the output to print the fields for the report.

Comment 2 Jesus M. Rodriguez 2016-11-15 14:36:50 UTC
I was able to recreate the problem using a non-existent report.

rho scan --profile deep1 --report foobar
Config Encryption Password:
Scanning...
192.168.122.1:22 with auth myroot
192.168.122.3:22 with auth myroot
192.168.122.2:22 with auth myroot
Traceback (most recent call last):
  File "/usr/bin/rho", line 20, in <module>
    CLI().main()
  File "/usr/lib/python2.7/site-packages/rho/cli.py", line 97, in main
    cmd.main()
  File "/usr/lib/python2.7/site-packages/rho/clicommands.py", line 327, in main
    self._do_command()
  File "/usr/lib/python2.7/site-packages/rho/clicommands.py", line 587, in _do_command
    reportobj.output_filename)), "w")
AttributeError: 'NoneType' object has no attribute 'output_filename'

Comment 3 Jesus M. Rodriguez 2016-11-15 15:00:55 UTC
Proposed solution:

1) if a report is not found, print error message stating the report name and exit gracefully.

2) if the missing report is one of the default reports, then rho should automagically add it to the rho config then run the report. This happens if initconfig is not run prior to running the rho commands.

Comment 4 Jesus M. Rodriguez 2016-11-15 16:12:04 UTC
Posted a PR to address the problem: https://github.com/candlepin/rho/pull/30

Comment 5 Jesus M. Rodriguez 2017-07-26 13:39:39 UTC
*** Bug 1266036 has been marked as a duplicate of this bug. ***

Comment 6 Jesus M. Rodriguez 2017-11-06 15:53:30 UTC
This was already released.


Note You need to log in before you can comment on or make changes to this bug.