-
Notifications
You must be signed in to change notification settings - Fork 23.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vultr: new module utils and common docs #30868
Conversation
lib/ansible/module_utils/vultr.py
Outdated
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | ||
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a short form for the BSD license now:
# (c) 2017, René Moser <mail@renemoser.net>
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New module_utils should have the standard boilerplate as well:
from __future__ import absolute_import, division, print_function
__metaclass__ = type
Once you use the __metaclass__ = type
, you no longer need to have class Foo(object):
. You can just use class Foo:
instead.
lib/ansible/module_utils/vultr.py
Outdated
) | ||
if 'VULTR_API_CONFIG' in os.environ: | ||
paths += (os.path.expanduser(os.environ['VULTR_API_CONFIG']),) | ||
if not any([os.path.exists(c) for c in paths]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note, this is not a blocker but you can use a generator expression here instead of a list comprehension. it could save on some system calls (calling os.path.exists) but I doubt that will be a noticable optimization so it's really just style.
Everything I saw boils down to style. The note about adding the boilerplate is a blocker and changing the license header to the short version is nice for consistency and reduces the over-the-wire size but everything else is trivial and doesn't need to change if you don't want to. +1 to merge when you've added the boilerplate and made whichever other of the changes you agree with. |
@abadger thx for review |
SUMMARY
shared code and docs for vultr modules. Modules will be in follow up PRs.
ISSUE TYPE
COMPONENT NAME
vultr
ANSIBLE VERSION
ADDITIONAL INFORMATION
closes #30796
/cc @bcoca