File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -136,8 +136,8 @@ def _checkout(self):
136
136
host = self ._act (provider , method , checkout = True )
137
137
except exceptions .ProviderError as err :
138
138
host = err
139
+ hosts .append (host )
139
140
if host and not isinstance (host , exceptions .ProviderError ):
140
- hosts .append (host )
141
141
logger .info (f"{ host .__class__ .__name__ } : { host .hostname } " )
142
142
return hosts
143
143
@@ -147,11 +147,9 @@ def checkout(self):
147
147
:return: Host obj or list of Host objects
148
148
"""
149
149
hosts = self ._checkout ()
150
- err , to_emit = None , []
151
- for host in hosts :
152
- if not isinstance (host , exceptions .ProviderError ):
153
- to_emit .append (host .to_dict ())
154
- else :
150
+ err = None
151
+ for host in hosts [:]:
152
+ if isinstance (host , exceptions .ProviderError ):
155
153
err = host
156
154
hosts .remove (host )
157
155
helpers .emit (hosts = [host .to_dict () for host in hosts ])
You can’t perform that action at this time.
0 commit comments