Repository: ansible/ansible

Issue:
Relicense module_utils/api.py to BSd

##### ISSUE TYPE

 - Bug Report

##### COMPONENT NAME
lib/ansible/module_utils/api.py

##### ANSIBLE VERSION
<!--- Paste verbatim output from “ansible --version” between quotes below -->
```
devel, 2.3
```


##### SUMMARY
We want to have module_utils be BSD code but api.py has a GPLv3+ header.  If at all possible we wnat code (especially generically useful code) like this to be relicensed.




Discussion:
Need signoff from:

* Author: Toshio Kuratomi @abadger
* Author: Dag Wieers @dagwieers 
* Author: Jonathan Davila @defionscode 
* Author: Brian Coca @bcoca


@abadger I'd like to know why in this case we want this code to be BSD licensed ? Earlier I was told everything had to be GPLv3+ ?
@dagwieers true for most of the project, but module_utils was always supposed to be an exception and allow for shared code to be BSD so 3rd parties could ship modules using this code w/o dealing with licensing issues.
Consider this my consent to re-license
I consent
On Tue, Aug 1, 2017 at 2:55 PM Brian Coca <notifications@github.com> wrote:

> Consider this my consent to re-license
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/ansible/ansible/issues/27599#issuecomment-319463348>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AEcrYnalt60B_EzfIvAIqOnGX-enSbB0ks5sT3SXgaJpZM4OqIfm>
> .
>

This is code in module_utils.  Since module_utils is being used by both our, and third party modules (where the third party modules may be commercial, for instance), we want that code to be BSd licensed.

There is some info here:

https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/dev_guide/developing_modules_in_groups.rst#before-you-start-coding

I believe that information was in the long coding guideline checklist before it migrated to the developing modules in groups page.
I give permission for all my contributions to lib/ansible/module_utils/api.py to be relicensed under the BSD license.  An example of the BSD license I mean is here: https://github.com/ansible/ansible/blob/97a34cf008501088ae012f24e4712e2bc6dd6d4c/lib/ansible/module_utils/basic.py#L11
I give permission for all my contributions to lib/ansible/module_utils/api.py to be relicensed under the BSD license.

Resolving patch:
diff --git a/lib/ansible/module_utils/api.py b/lib/ansible/module_utils/api.py
--- a/lib/ansible/module_utils/api.py
+++ b/lib/ansible/module_utils/api.py
@@ -1,20 +1,29 @@
+# This code is part of Ansible, but is an independent component.
+# This particular file snippet, and this file snippet only, is BSD licensed.
+# Modules you write using this snippet, which is embedded dynamically by Ansible
+# still belong to the author of the module, and may assign their own license
+# to the complete work.
 #
 # (c) 2015 Brian Ccoa, <bcoca@ansible.com>
 #
-# This file is part of Ansible
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
 #
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+#    * Redistributions of source code must retain the above copyright
+#      notice, this list of conditions and the following disclaimer.
+#    * Redistributions in binary form must reproduce the above copyright notice,
+#      this list of conditions and the following disclaimer in the documentation
+#      and/or other materials provided with the distribution.
 #
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# 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.
 #
 """
 This module adds shared support for generic api modules
@@ -22,11 +31,6 @@
 In order to use this module, include it as part of a custom
 module as shown below.
 
-** Note: The order of the import statements does matter. **
-
-from ansible.module_utils.basic import *
-from ansible.module_utils.api import *
-
 The 'api' module provides the following common argument specs:
 
     * rate limit spec
@@ -36,7 +40,6 @@
     * retry spec
         - retries: number of attempts
         - retry_pause: delay between attempts in seconds
-
 """
 import time
 


Test patch: