saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.19k stars 5.48k forks source link

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

Open I3urny opened 1 year ago

I3urny commented 1 year ago

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.

welcome[bot] commented 1 year ago

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!