mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-05 07:54:00 -07:00
Resolving differences in core modules post-merge
This commit is contained in:
parent
95d59b61eb
commit
8afa090417
115 changed files with 2651 additions and 17913 deletions
|
@ -16,6 +16,8 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with this software. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import time
|
||||
|
||||
try:
|
||||
from novaclient.v1_1 import client as nova_client
|
||||
try:
|
||||
|
@ -23,9 +25,9 @@ try:
|
|||
except ImportError:
|
||||
from quantumclient.quantum import client
|
||||
from keystoneclient.v2_0 import client as ksclient
|
||||
import time
|
||||
HAVE_DEPS = True
|
||||
except ImportError:
|
||||
print("failed=True msg='novaclient,keystoneclient and quantumclient (or neutronclient) are required'")
|
||||
HAVE_DEPS = False
|
||||
|
||||
ANSIBLE_METADATA = {'status': ['deprecated'],
|
||||
'supported_by': 'community',
|
||||
|
@ -89,7 +91,11 @@ options:
|
|||
required: false
|
||||
default: None
|
||||
version_added: "1.5"
|
||||
requirements: ["novaclient", "quantumclient", "neutronclient", "keystoneclient"]
|
||||
requirements:
|
||||
- "python >= 2.6"
|
||||
- "python-novaclient"
|
||||
- "python-neutronclient or python-quantumclient"
|
||||
- "python-keystoneclient"
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
|
@ -252,6 +258,9 @@ def main():
|
|||
))
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
if not HAVE_DEPS:
|
||||
module.fail_json(msg='python-novaclient, python-keystoneclient, and either python-neutronclient or python-quantumclient are required')
|
||||
|
||||
try:
|
||||
nova = nova_client.Client(module.params['login_username'], module.params['login_password'],
|
||||
module.params['login_tenant_name'], module.params['auth_url'], region_name=module.params['region_name'], service_type='compute')
|
||||
|
@ -285,5 +294,6 @@ def main():
|
|||
# this is magic, see lib/ansible/module.params['common.py
|
||||
from ansible.module_utils.basic import *
|
||||
from ansible.module_utils.openstack import *
|
||||
main()
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue