Open arizvisa opened 4 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
not stale, still being considered.
Thank you for updating this issue. It is no longer marked as stale.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
not stale, tagged as considered.
Thank you for updating this issue. It is no longer marked as stale.
Description of Issue
Is this intended behaviour? After running
salt-cloud -m
w/ a mapfile, some of the hosts failed to be deployed, but the keys are still created despite that failure.You can see this in the code under the create() method from the
Cloud
class insalt.cloud.__init__.py
where the following creates the key and then assigns it to a dict.A little bit later, it calls create. Note the error handler doesn't result in anything different happening which would imply that output would be checked by the caller, but when you look at any of the caller methods such as the "run_profile()" method, there's no error handling even attempting to remove the key.
Setup
Setup something simple that uses deploy and can be easily made to fail. You can use the saltify driver with this as your provider.
Now create some simple profile.
Now produce a mapfile for the profile pointing to a host that doesn't exist, so that way it cannot possibly succeed.
Steps to Reproduce Issue
Simply run
salt-cloud -y -m /path/to/mapfile
, let it fail, and then checksalt-key
. You'll see that the key for the host was still created despite the host not possibly succeeding, and salt-cloud emitting a failure. Even if you hit ctrl+c, before it tries to connect to the host, the key is still created which means salt-cloud is not handling errors.Versions Report
The described logic is from the master branch, but if you really need a versions-report.