Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] AttributeError: 'ProviderError' object has no attribute 'hostname' #146

Closed
jyejare opened this issue Dec 9, 2021 · 1 comment · Fixed by #181
Closed

[BUG] AttributeError: 'ProviderError' object has no attribute 'hostname' #146

jyejare opened this issue Dec 9, 2021 · 1 comment · Fixed by #181
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@jyejare
Copy link
Member

jyejare commented Dec 9, 2021

Tower has failed WF for which #145 was fixed and merged but now we see the following error with broker:

self = <broker.broker.VMBroker object at 0x7fcdca8e0370>
12:10:09  
12:10:09      @mp_decorator
12:10:09      def _checkout(self):
12:10:09          """checkout one or more VMs
12:10:09      
12:10:09          :return: List of Host objects
12:10:09          """
12:10:09          hosts = []
12:10:09          if not self._provider_actions:
12:10:09              raise self.BrokerError("Could not determine an appropriate provider")
12:10:09          for action in self._provider_actions.keys():
12:10:09              provider, method = PROVIDER_ACTIONS[action]
12:10:09              logger.info(f"Using provider ********provider.__name__} to checkout")
12:10:09              try:
12:10:09                  host = self._act(provider, method, checkout=True)
12:10:09                  logger.debug(f"host=********host}")
12:10:09              except exceptions.ProviderError as err:
12:10:09                  host = err
12:10:09              if host:
12:10:09                  hosts.append(host)
12:10:09  >               logger.info(f"********host.__class__.__name__}: ********host.hostname}")
12:10:09  E               AttributeError: 'ProviderError' object has no attribute 'hostname'
12:10:09  
12:10:09  ../../lib64/python3.8/site-packages/broker/broker.py:139: AttributeError

Please look into it !

@jyejare jyejare added bug Something isn't working help wanted Extra attention is needed labels Dec 9, 2021
@lpramuk
Copy link
Contributor

lpramuk commented Jan 19, 2023

Fixed by my #181 - to change a list which you are iterating over is really bad idea (removing ProviderErrors from hosts list)
As a result ProviderError is not removed from hosts list and later is treated as a regular host

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants