saltstack / saltstack/salt

[DOCS] salt-cloud script() function should not be listed as required

Open
#65,323 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation Salt-Cloud severity-medium time-estimate-sprint
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
The Writing Cloud Providers documentation lists the script() function as required for libcloud-based providers and "likely to be moved into the salt.utils.cloud library in the near future, as it is very generic and can usually be copied wholesale from another module" for non-libcloud-based providers.

So according to the docs the following code should be copied to new non-libcloud-based providers:
https://github.com/saltstack/salt/blob/c2779df50c64ef7b16dea4aeaa08eb5ebad3d12b/salt/cloud/clouds/digitalocean.py#L680-L692

However, this functionality seems to be already implemented within the cloud.bootstrap() function which both provider types use so declaring the script() function is obsolete:
https://github.com/saltstack/salt/blob/c2779df50c64ef7b16dea4aeaa08eb5ebad3d12b/salt/utils/cloud.py#L446-L452

The os attribute value is copied from script beforehand:
https://github.com/saltstack/salt/blob/c2779df50c64ef7b16dea4aeaa08eb5ebad3d12b/salt/cloud/__init__.py#L1211

Suggested Fix
The script() function should not be declared as required anymore since the cloud.bootstrap() does all of the work script() is supposed to do.

Type of documentation
Salt documentation

Location or format of documentation
https://docs.saltproject.io/en/latest/topics/cloud/cloud.html

Additional context
I'm currently rewriting the proxmox cloud provider and was wondering which functions are actually needed.
I also noticed other errors in the Writing Cloud Providers documentation like it still naming the Linode cloud provider as being based on libclouds when https://github.com/saltstack/salt/commit/f7c7c09caca9cc210a9ea393c1e83a39247a375a switched it from libcloud to its own REST API 8 years ago but that should probably be a separate issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Writing Cloud Providers documentation at the linked cloud.html page and compare its required script() guidance with salt/utils/cloud.py, salt/cloud/init.py, and the cited digitalocean.py implementation. Done means the documentation no longer lists script() as required for non-libcloud-based providers, while preserving the distinction between provider types.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cloud, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.