Repository: ansible/ansible

Issue:
Typo in vmware_guest.py size_mb disk attribute
<!---
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release, and master branch are affected too.
-->

##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug Report

##### COMPONENT NAME
<!--- Name of the module/plugin/task/feature -->
vmware_guest

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes below -->
```
ansible 2.5.0
  config file = /vagrant/ansible.cfg
  configured module search path = [u'/home/vagrant/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
```

##### CONFIGURATION
<!---
If using Ansible 2.4 or above, paste the results of "ansible-config dump --only-changed"

Otherwise, mention any settings you have changed/added/removed in ansible.cfg
(or using the ANSIBLE_* environment variables).

-->
ANSIBLE_FORCE_COLOR(/vagrant/ansible.cfg) = True
ANSIBLE_SSH_CONTROL_PATH(/vagrant/ansible.cfg) = %(directory)s/%%h-%%r
ANSIBLE_SSH_PIPELINING(/vagrant/ansible.cfg) = True
DEFAULT_HOST_LIST(/vagrant/ansible.cfg) = [u'/vagrant/environments/development']
DEFAULT_ROLES_PATH(/vagrant/ansible.cfg) = [u'/vagrant/roles/internal', u'/vagrant/roles/community']
DEFAULT_STDOUT_CALLBACK(/vagrant/ansible.cfg) = debug
HOST_KEY_CHECKING(/vagrant/ansible.cfg) = False
RETRY_FILES_ENABLED(/vagrant/ansible.cfg) = False

##### OS / ENVIRONMENT
<!---
Mention the OS you are running Ansible from, and the OS you are
managing, or say "N/A" for anything that is not platform-specific.
Also mention the specific version of what you are trying to control,
e.g. if this is a network bug the version of firmware on the network device.
-->
N/A

##### SUMMARY
<!--- Explain the problem briefly -->
[Typo; space in string on line 928](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/vmware/vmware_guest.py#L928)


##### STEPS TO REPRODUCE
<!---
For bugs, show exactly how to reproduce the problem, using a minimal test-case.
For new features, show how the feature would be used.
-->

<!--- Paste example playbooks or commands between quotes below -->
```yaml
    - name: Create vm guest from template
      vmware_guest:
        hostname: "{{ vcenter_fqdn }}"
        username: "{{ vcenter_user }}"
        password: "{{ vcenter_pass }}"
        datacenter:  "{{ datacenter }}"
        cluster: "{{ cluster }}"
        resource_pool: "{{ resource_pool }}"
        validate_certs: False
        name: "{{ guest_name }}"
        state: poweredon
        template: "{{ template }}"
        folder: "{{ folder }}"
        wait_for_ip_address: yes
        disk:
        - size_mb: 500
          datastore: datastore_01
        - size_gb: 16
          datastore: datastore_01
        annotation: |
          VM guest created by ansible on {{ ansible_date_time.iso8601 }} from {{ template }}
      register: new_guest
```

<!--- You can also paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->
```size_mb``` to be parsed correctly

##### ACTUAL RESULTS
<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->

<!--- Paste verbatim command output between quotes below -->
```
TASK [Create vm guest from template] ****************************************************************************************************************************************************************************


fatal: [localhost]: FAILED! => {
    "changed": false,
    "failed": true
}

MSG:

mb is not a supported unit for disk size. Supported units are kb, mb, gb or tb
```



Discussion:
cc @akasurde @dagwieers @dav1x @jctanner @nerzhul
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->
@bbomgardner Nice catch !!! Would you like to raise a PR for this ?

Resolving patch:
diff --git a/lib/ansible/modules/cloud/vmware/vmware_guest.py b/lib/ansible/modules/cloud/vmware/vmware_guest.py
--- a/lib/ansible/modules/cloud/vmware/vmware_guest.py
+++ b/lib/ansible/modules/cloud/vmware/vmware_guest.py
@@ -925,7 +925,7 @@ def get_configured_disk_size(self, expected_disk_spec):
                 return expected * 1024 * 1024 * 1024
             elif unit == 'gb':
                 return expected * 1024 * 1024
-            elif unit == ' mb':
+            elif unit == 'mb':
                 return expected * 1024
             elif unit == 'kb':
                 return expected


Test patch: