Closed Raviucnp closed 5 years ago
This is fixed now, it's version compatability issue. Suiatable versions are python 2.7.12 and hponeview 5.0.0 then it will execute. Python 3 or 2.7.5 are not supporting. By Raviucnp
Use suitable versions it will work
Scenario/Intent
we are trying to create server profile from the server profile template which we retrieved from Oneview.
Environment Details
Steps to Reproduce server_profile_create.yml
oneview_server_profile_template_facts: config: "/home/ravikanth/oneview_config.json" name: BMaaS_RHEL
oneview_server_profile: config: "/home/ravikanth/oneview_config.json" data: serverProfileTemplateName: BMaaS_RHEL
Expected Result
if we run above playbook with below command we are able retrieve the template but from that server profile is not creating. ansible-playbook -i invetory.yml server_profile_create.yml -e "ansible_python_interpreter=/usr/bin/python3" -vvv
Actual Result
getting below errors.
File \"/tmp/ansible_oneview_server_profile_payload_316ny0_f/ansible_oneview_server_profile_payload.zip/ansible/module_utils/oneview.py\", line 453, in run\n File \"/tmp/ansible_oneview_server_profile_payload_316ny0_f/main.py\", line 280, in execute_module\n
File \"/tmp/ansible_oneview_server_profile_payload_316ny0_f/main.py\", line 320, in present\n
File \"/tmp/ansible_oneview_server_profile_payload_316ny0_f/main.py\", line 444, in create_profile\n File \"/tmp/ansible_oneview_server_profile_payload_316ny0_f/main.py\", line 467, in __build_new_profile_data\nAttributeError: 'dict' object has no attribute 'get_new_profile'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1
fatal: [localhost]: FAILED! => { "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/ravikanth.sakinala/.ansible/tmp/ansible-tmp-1570197938.63-93637244226739/AnsiballZ_oneview_server_profile.py\", line 114, in\n _ansiballz_main()\n File \"/home/ravikanth.sakinala/.ansible/tmp/ansible-tmp-1570197938.63-93637244226739/AnsiballZ_oneview_server_profile.py\", line 106, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/ravikanth.sakinala/.ansible/tmp/ansible-tmp-1570197938.63-93637244226739/AnsiballZ_oneview_server_profile.py\", line 49, in invoke_module\n imp.load_module('main', mod, module, MOD_DESC)\n File \"/usr/lib64/python3.6/imp.py\", line 235, in load_module\n return load_source(name, filename, file)\n File \"/usr/lib64/python3.6/imp.py\", line 170, in load_source\n module = _exec(spec, sys.modules[name])\n File \"\", line 618, in _exec\n File \"\", line 674, in exec_module\n File \"\", line 781, in get_code\n File \"\", line 741, in source_to_code\n File \"\", line 219, in _call_with_frames_removed\n File \"/tmp/ansible_oneview_server_profile_payload_0vuwg4d6/main.py\", line 18\n from future import (absolute_import, division, print_function)\n ^\nSyntaxError: from future imports must occur at the beginning of the file\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}