Skip to content

Commit

Permalink
check for vm_password before setting prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Russ Marshall committed Jul 18, 2017
1 parent dbcf0ad commit 2588bf7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions library/ovftool.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

import atexit
import ssl
import urllib

import requests
import urllib
from ansible.module_utils.basic import *
from pyVmomi import vim
from pyVim import connect
from pyVmomi import vim


def connect_to_api(vchost, vc_user, vc_pwd):
Expand Down Expand Up @@ -112,7 +112,8 @@ def main():
if module.params['props']:
for key in module.params['props'].keys():
command_tokens.append('--prop:{}={}'.format(key, module.params['props'][key]))
if 'vm_password_key' in module.params and 'vm_password' in module.params:
if 'vm_password_key' in module.params and module.params['vm_password_key'] and 'vm_password' in module.params and \
module.params['vm_password']:
command_tokens.append('--prop:{}={}'.format(module.params['vm_password_key'], module.params['vm_password']))
if 'deployment_option' in module.params:
command_tokens.append('--deploymentOption={}'.format(module.params['deployment_option']))
Expand Down

0 comments on commit 2588bf7

Please sign in to comment.