Uploaded image for project: 'RHEL Conversions'
  1. RHEL Conversions
  2. RHELC-1779 C2R exits with "FileNotFoundError is not defined" after removing /etc/convert2rhel.ini
  3. RHELC-1782

C2R exists with "FileNotFoundError is not defined" after removing /etc/convert2rhel.ini - Integration tests

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Unresolved
    • Icon: Normal Normal
    • 2.3.0
    • None
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • Testable

      The parent issue RHELC-1779 has the label that triggered autocreation of this subtask to track the relative story point estimation for the integration test part of the issue.

      The parent issue description at the time of creation of this issue was:
      After running the analysis task in a CentOS7 without a /etc/convert2rhel.ini at consoledot the tasks abruptly ends with "FileNotFoundError is not defined".

      The full traceback displayed at the task is:

      convert2rhel exited with code 1.
      Output of the failed command: convert2rhel command used:
      /usr/bin/convert2rhel analyze -y --els
      Traceback (most recent call last):
        File "/usr/bin/convert2rhel", line 9, in <module>
          load_entry_point('convert2rhel==2.2.0', 'console_scripts', 'convert2rhel')()
        File "/usr/lib/python2.7/site-packages/convert2rhel/initialize.py", line 98, in run
          return main.main()
        File "/usr/lib/python2.7/site-packages/convert2rhel/main.py", line 106, in main
          cli.CLI()
        File "/usr/lib/python2.7/site-packages/convert2rhel/cli.py", line 58, in __init__
          self._process_cli_options()
        File "/usr/lib/python2.7/site-packages/convert2rhel/cli.py", line 288, in _process_cli_options
          CliConfig(parsed_opts),
        File "/usr/lib/python2.7/site-packages/convert2rhel/toolopts/__init__.py", line 143, in initialize
          [config.run() for config in config_sources]
        File "/usr/lib/python2.7/site-packages/convert2rhel/toolopts/config.py", line 99, in run
          unparsed_opts = self.options_from_config_files()
        File "/usr/lib/python2.7/site-packages/convert2rhel/toolopts/config.py", line 138, in options_from_config_files
          raise FileNotFoundError("No such file or directory: {}".format(", ".join(paths)))
      NameError: global name 'FileNotFoundError' is not defined

      How to reproduce

      The test steps are:

       1. Install subscription-manager, rhc, rhc-worker-script, insights-client
       2. Create an inhibitor in the machine by creating a custom c2r ini file
       3. Create a TOML file to update the c2r log level to 'error'.
       4. Run rhc connect with given credentials to subscribe
       the machine and register to insights
       5. Check that the host is visible as CentOS in the UI
       6. Run the pre-conversion analysis task in the machine
       7. Verify that one inhibitor was raised
       8. Verify convert2rhel-insights-tasks log have only ERROR messages
       9. Fix the inhibitor by updating the machine
       10. Run the pre-conversion analysis task
       11. Verify the analysis finished successfully
       12. Verify there aren't any ERROR messages in the convert2rhel-insights-tasks log

      The test fails on the step 11. I tried to run the test without creating the c2r ini file before, just removing it, and it also fails.

              Unassigned Unassigned
              rhel-process-autobot RHEL Jira bot
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: