ansible-community / molecule-goss

Molecule Goss Verifier
https://github.com/ansible-community/molecule-plugins
MIT License
12 stars 11 forks source link

AttributeError: 'Logger' object has no attribute 'success' #8

Closed dakky closed 3 years ago

dakky commented 3 years ago

When the goss tests are successful, I get the following error:

Friday 27 November 2020  22:12:19 +0100 (0:00:00.102)       0:00:14.638 *******
===============================================================================
Copy Goss tests to remote ----------------------------------------------- 3.23s
Gathering Facts --------------------------------------------------------- 2.93s
Download and install Goss ----------------------------------------------- 2.00s
Register test files ----------------------------------------------------- 1.87s
Create Molecule directory for test files -------------------------------- 1.82s
Execute Goss tests ------------------------------------------------------ 1.69s
Find Goss tests on localhost -------------------------------------------- 0.46s
Display details about the Goss results ---------------------------------- 0.28s
debug ------------------------------------------------------------------- 0.24s
Fail when tests fail ---------------------------------------------------- 0.10s
Playbook run took 0 days, 0 hours, 0 minutes, 14 seconds
Traceback (most recent call last):
  File "/Users/username/.pyenv/versions/3.9.0/bin/molecule", line 8, in <module>
    sys.exit(main())
  File "/Users/username/.pyenv/versions/3.9.0/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/username/.pyenv/versions/3.9.0/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/username/.pyenv/versions/3.9.0/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/username/.pyenv/versions/3.9.0/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/username/.pyenv/versions/3.9.0/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/username/.pyenv/versions/3.9.0/lib/python3.9/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/username/.pyenv/versions/3.9.0/lib/python3.9/site-packages/molecule/command/verify.py", line 92, in verify
    base.execute_cmdline_scenarios(scenario_name, args, command_args)
  File "/Users/username/.pyenv/versions/3.9.0/lib/python3.9/site-packages/molecule/command/base.py", line 112, in execute_cmdline_scenarios
    execute_scenario(scenario)
  File "/Users/username/.pyenv/versions/3.9.0/lib/python3.9/site-packages/molecule/command/base.py", line 154, in execute_scenario
    execute_subcommand(scenario.config, action)
  File "/Users/username/.pyenv/versions/3.9.0/lib/python3.9/site-packages/molecule/command/base.py", line 143, in execute_subcommand
    return command(config).execute()
  File "/Users/username/.pyenv/versions/3.9.0/lib/python3.9/site-packages/molecule/logger.py", line 187, in wrapper
    rt = func(*args, **kwargs)
  File "/Users/username/.pyenv/versions/3.9.0/lib/python3.9/site-packages/molecule/command/verify.py", line 73, in execute
    self._config.verifier.execute()
  File "/Users/username/.pyenv/versions/3.9.0/lib/python3.9/site-packages/molecule_goss/goss.py", line 140, in execute
    LOG.success(msg)
AttributeError: 'Logger' object has no attribute 'success'

Environment:

pip | grep molecule
molecule          3.2.0
molecule-docker   0.2.4
molecule-goss     1.0
python --version
Python 3.9.0
abtreece commented 3 years ago

@dakky I believe that is due to this change in Molecule...

https://github.com/ansible-community/molecule/pull/2978

This plugin will need to be updated in order to accommodate. The only quick "fix" right now is using a molecule version prior to that commit.

dakky commented 3 years ago

my PR https://github.com/ansible-community/molecule-goss/pull/9 fixes it the same way the other plugins have done after the molecule change ;-)