Fix unresolved import in vmware module_utils (#25288)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2017-06-30 19:58:08 +05:30 committed by jctanner
parent 5c374cd1ae
commit f0a5854e39
2 changed files with 9 additions and 9 deletions

View file

@ -17,8 +17,10 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>. # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from ansible.module_utils.urls import fetch_url
from ansible.module_utils.six import iteritems from ansible.module_utils.six import iteritems
import atexit import atexit
import os
import ssl import ssl
import time import time
@ -139,6 +141,7 @@ def find_datacenter_by_name(content, datacenter_name):
return None return None
def find_datastore_by_name(content, datastore_name): def find_datastore_by_name(content, datastore_name):
datastores = get_all_objs(content, [vim.Datastore]) datastores = get_all_objs(content, [vim.Datastore])
@ -381,8 +384,7 @@ def get_all_objs(content, vimtype, folder=None, recurse=True):
return obj return obj
def fetch_file_from_guest(content, vm, username, password, src, dest): def fetch_file_from_guest(module, content, vm, username, password, src, dest):
""" Use VMWare's filemanager api to fetch a file over http """ """ Use VMWare's filemanager api to fetch a file over http """
result = {'failed': False} result = {'failed': False}
@ -406,7 +408,7 @@ def fetch_file_from_guest(content, vm, username, password, src, dest):
result['url'] = fti.url result['url'] = fti.url
# Use module_utils to fetch the remote url returned from the api # Use module_utils to fetch the remote url returned from the api
rsp, info = fetch_url(self.module, fti.url, use_proxy=False, rsp, info = fetch_url(module, fti.url, use_proxy=False,
force=True, last_mod_time=None, force=True, last_mod_time=None,
timeout=10, headers=None) timeout=10, headers=None)
@ -430,8 +432,7 @@ def fetch_file_from_guest(content, vm, username, password, src, dest):
return result return result
def push_file_to_guest(content, vm, username, password, src, dest, overwrite=True): def push_file_to_guest(module, content, vm, username, password, src, dest, overwrite=True):
""" Use VMWare's filemanager api to fetch a file over http """ """ Use VMWare's filemanager api to fetch a file over http """
result = {'failed': False} result = {'failed': False}
@ -467,7 +468,7 @@ def push_file_to_guest(content, vm, username, password, src, dest, overwrite=Tru
filesize, overwrite) filesize, overwrite)
# PUT the filedata to the url ... # PUT the filedata to the url ...
rsp, info = fetch_url(self.module, url, method="put", data=fdata, rsp, info = fetch_url(module, url, method="put", data=fdata,
use_proxy=False, force=True, last_mod_time=None, use_proxy=False, force=True, last_mod_time=None,
timeout=10, headers=None) timeout=10, headers=None)

View file

@ -2,7 +2,6 @@ hacking/conf2yaml.py
lib/ansible/cli/config.py lib/ansible/cli/config.py
lib/ansible/config/data.py lib/ansible/config/data.py
lib/ansible/config/manager.py lib/ansible/config/manager.py
lib/ansible/module_utils/vmware.py
lib/ansible/modules/cloud/amazon/_ec2_ami_search.py lib/ansible/modules/cloud/amazon/_ec2_ami_search.py
lib/ansible/modules/cloud/amazon/_ec2_remote_facts.py lib/ansible/modules/cloud/amazon/_ec2_remote_facts.py
lib/ansible/modules/cloud/amazon/_ec2_vpc.py lib/ansible/modules/cloud/amazon/_ec2_vpc.py