[BUG] salt-cloud keep_tmp setting in provider/profile configuration is ignored
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description
keep_tmp: True argument in provider/profile conf files is ignored, tmp folder is not removed from minion
(it works from cli passing the option as an argument: salt-cloud --keep-tmp)
Looks like it's getting keep_tmp: False from opts dict and is not using whatever is set in provider/profile
salt/cloud/test1/deploying {
"event": "executing deploy script",
"kwargs": {
"keep_tmp": false,
"vm_": {
"keep_tmp": true,
**Workaroud: set keep_tmp: True in master config /etc/salt/master.d/**
Or hardcode it in /usr/lib/python3.6/site-packages/salt/utils/cloud.py
deploy_kwargs = {
"vm_": vm_,
"keep_tmp": True, # it was set to opts["keep_tmp"]
I printed out the opts dict from utils/cloud.py to verify
opts:
"providers": {
"my-ec2": {
"ec2": {
"profiles": {
"aws-minions-linux-micro": {
"keep_tmp": true,
}
}
}
}
},
"profiles": {
"aws-minions-linux-micro": {
"keep_tmp": true,
}
},
"keep_tmp": false,
Setup
Salt: 3001.1
Steps to Reproduce the behavior
Set keep_tmp: True in profile and/or provider conf
deploy a new instance: salt-cloud -p profile instance_name
Once deployed, check the tmp folder /tmp/.saltcloud* has not been preserved.
Repeat process setting up keep_tmp: True in /etc/salt/master.d/keep_tmp.conf, this way it gets set in the opts dict
The /tmp/.saltcloud* will be preserved this time.
Expected behavior
Use keep_tmp from provider/profile configurations, not from opts dict
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in salt/utils/cloud.py at the deploy_kwargs construction shown in the report, then reproduce with salt-cloud -p profile instance_name using keep_tmp: True in the provider or profile configuration. Confirm that the resulting deployment preserves /tmp/.saltcloud* without requiring the setting in /etc/salt/master.d/.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100