Merge lp:~sankaraditya/cloud-init/topic-stanguturi-vmware-support into lp:~cloud-init-dev/cloud-init/trunk
| Status: | Merged |
|---|---|
| Merged at revision: | 1166 |
| Proposed branch: | lp:~sankaraditya/cloud-init/topic-stanguturi-vmware-support |
| Merge into: | lp:~cloud-init-dev/cloud-init/trunk |
| Diff against target: |
1300 lines (+1168/-3) 15 files modified
cloudinit/sources/DataSourceOVF.py (+76/-3) cloudinit/sources/helpers/vmware/__init__.py (+13/-0) cloudinit/sources/helpers/vmware/imc/__init__.py (+13/-0) cloudinit/sources/helpers/vmware/imc/boot_proto.py (+25/-0) cloudinit/sources/helpers/vmware/imc/config.py (+95/-0) cloudinit/sources/helpers/vmware/imc/config_file.py (+129/-0) cloudinit/sources/helpers/vmware/imc/config_namespace.py (+25/-0) cloudinit/sources/helpers/vmware/imc/config_nic.py (+247/-0) cloudinit/sources/helpers/vmware/imc/config_source.py (+23/-0) cloudinit/sources/helpers/vmware/imc/ipv4_mode.py (+45/-0) cloudinit/sources/helpers/vmware/imc/nic.py (+147/-0) cloudinit/sources/helpers/vmware/imc/nic_base.py (+154/-0) tests/data/vmware/cust-dhcp-2nic.cfg (+34/-0) tests/data/vmware/cust-static-2nic.cfg (+39/-0) tests/unittests/test_vmware_config_file.py (+103/-0) |
| To merge this branch: | bzr merge lp:~sankaraditya/cloud-init/topic-stanguturi-vmware-support |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Dan Watkins | Approve on 2016-02-22 | ||
| Scott Moser | 2015-11-19 | Pending | |
|
Review via email:
|
|||
Description of the Change
Add Image Customization Parser for VMware vSphere Hypervisor Support.
This is the first changeset submitted as a part of project to
add cloud-init support for VMware vSphere Hypervisor. This changeset
contains _only_ the changes for a simple python parser for a
Image Customization Specification file pushed by VMware vSphere
hypervisor into the guest VMs. In a later changeset, will be submitting
another patch to actually detect the underlying VMware vSphere hypervisor
and do the necessary customization.
| Dan Watkins (daniel-thewatkins) wrote : | # |
Hi Sankar,
On 21/12/15 21:20, Sankar Tanguturi wrote:
> Thanks a lot for your valuable inputs. Is there any python coding style guide that is followed by all cloudinit developers? I can follow that guide and make necessary changes.
Generally, we follow PEP-8[0], which is the generally accepted style
guide for Python code. I would suggest using the pep8 checker[1] to
check if your code meets the requirements. As with all linters, you
don't necessarily need to fix 100% of the problems it raises, but fixing
most of them should get you there. :)
Dan
[0] https:/
[1] https:/
- 1158. By Sankar Tanguturi <stanguturi@stanguturi-rhel> on 2016-01-05
-
Fixed all the styling nits.
Used proper naming convention for the methods.
Added proper documentation.
Checked pep8 and flake8 output and no issues were reported.
| Sankar Tanguturi (sankaraditya) wrote : | # |
Updated the branch with the new code. Waiting for review comments.
Thanks a lot for the help.
| Dan Watkins (daniel-thewatkins) wrote : | # |
Hi Sankar,
Do you have any examples/
In the meantime, I'll do a high-level review to get a handle on everything hangs together.
Thanks,
Dan
| Dan Watkins (daniel-thewatkins) wrote : | # |
OK, here are some more implementation comments. I'll do another pass once I have some specification documentation to compare against. :)
| Sankar Tanguturi (sankaraditya) wrote : | # |
Thanks Daniel. I have updated the code with your review comments. Will update the diff.
| Sankar Tanguturi (sankaraditya) wrote : | # |
Hi,
Thanks a lot for the review comments.
I will update the diff in few minutes. I am attaching an example for the 'customization specification' file (cust.cfg). Can you please check it out.
Thanks
SAT
_______
From: <email address hidden> <email address hidden> on behalf of Dan Watkins <email address hidden>
Sent: Tuesday, January 19, 2016 3:16 AM
To: Sankar Tanguturi
Subject: Re: [Merge] lp:~sankaraditya/cloud-init/topic-stanguturi-vmware-support into lp:cloud-init
Hi Sankar,
Do you have any examples/
In the meantime, I'll do a high-level review to get a handle on everything hangs together.
Thanks,
Dan
--
https:/
You are the owner of lp:~sankaraditya/cloud-init/topic-stanguturi-vmware-support.
- 1159. By Sankar Tanguturi <stanguturi@stanguturi-rhel> on 2016-01-20
-
Fixed all the review comments from Daniel.
Added a new file i.e. nic_base.py which will be used a base calls for all
NIC related configuration.
Modified some code in nic.py.
| Sankar Tanguturi (sankaraditya) wrote : | # |
I couldn't add the 'customization specification' file. I have updated the diff and am pasting the content of a sample 'customization specification' file. Please check it out.
""" cust.cfg file"""
[NETWORK]
NETWORKING = yes
BOOTPROTO = dhcp
HOSTNAME = CENTOS510OSPX64
DOMAINNAME = google.com
[NIC-CONFIG]
NICS = NIC1
[NIC1]
MACADDR = 00:50:56:a7:00:5e
ONBOOT = yes
IPv4_MODE = BACKWARDS_
BOOTPROTO = dhcp
GATEWAY = 192.4.5.6
# This is a comment
-abc = def
[DNS]
DNSFROMDHCP=no
SUFFIX|1 = vmware.com
NAMESERVER|1 = 10.20.20.1
[DATETIME]
TIMEZONE = Africa/Abidjan
UTC = yes
"""
| Scott Moser (smoser) wrote : | # |
Sankar,
Thanks for your patience and for your work.
A few minor things:
a.) any information on this format (where it came from, where else it is used... would be good, links to doc would be great)
b.) there is one comment inline.
The next thing is a request.
What you're providing us here is a way to seed networking configuration into cloud-init.
We have other work coming where cloud-init will be able to do this itself so that the user/host/
So, the request is that
1.) you would in the future when we have that help to port any network-
2.) you can help with that network-
The last request is just for unit tests.
I realize that this is mostly infrastructure but would be good to have unit tests on it.
Thanks.
| Sankar Tanguturi (sankaraditya) wrote : | # |
Thanks a lot for the review comments.
> a.) any information on this format (where it came from, where else it is used... would be good, links to doc would be great)
I don't have any official documentation to share.
If there is any Guest Customization on a VMware VM, then a specific customization file is pushed inside the guest after the VM comes up. It is usually used only the guest customization and nowhere else. After this patch, I am going to publish another patch which will have all the code to extract, parse and apply the customization.
> b.) there is one comment inline.
Replied to the comment.
> 1.) you would in the future when we have that help to port any network-
> 2.) you can help with that network-
Sure.
> The last request is just for unit tests.
Can you please let me know in which directory I should include the unit tests?
| Sankar Tanguturi (sankaraditya) wrote : | # |
> canLog depends on the key starting with a '-' or having '|-' ?
This is our way to deliver additional "metadata" with the key. "-" means "confidential". This is a legacy format.
- 1160. By Sankar Tanguturi <stanguturi@stanguturi-rhel> on 2016-02-09
-
- Added new Unittests for VMware support.
| Sankar Tanguturi (sankaraditya) wrote : | # |
Thanks for the review. Added new unittests.
- 1161. By Sankar Tanguturi <stanguturi@stanguturi-rhel> on 2016-02-10
-
- Added the code to configure the NICs.
- Added the code to detect VMware Virtual Platform and apply the
customization based on the 'Customization Specification File' Pushed
into the guest VM.
| Sankar Tanguturi (sankaraditya) wrote : | # |
Thanks for the review comments. Will publish the new diff soon.
- 1162. By Sankar Tanguturi <stanguturi@stanguturi-rhel> on 2016-02-17
-
- Used proper 4 space indentations for config_nic.py and nic.py
- Implemented the 'search_file' function using 'os.walk()'
- Fixed few variable names.
- Removed size() function in config_file.py
- Updated the test_config_file.py to use len() instead of .size()
| Sankar Tanguturi (sankaraditya) wrote : | # |
Published the new diff addressing all review comments from Dan Watkins.
Thanks.
| Dan Watkins (daniel-thewatkins) wrote : | # |
A few more notes. Sorry that we're iterating so much on this!
(For future reference; more, smaller merge proposals are much easier and quicker to review :)
| Sankar Tanguturi (sankaraditya) wrote : | # |
Thanks for the comments. Will update the new diff in few minutes.
- 1163. By Sankar Tanguturi <stanguturi@stanguturi-rhel> on 2016-02-19
-
- Removed dmi_data function.
- Fixed few variable names.
- Used util.subp methods for process related manipulations.
| Dan Watkins (daniel-thewatkins) wrote : | # |
I'm pretty much happy with this. Thanks for all your work on it!
(I'll wait for smoser to approve before merging :)


Hi Sankar,
Thanks for submitting this change!
I have a few high-level stylistic comments; it would be good if you could address these so it's easier for us to undertake a more in-depth code review:
- there is a decent chunk of commented code in here; this should be removed method_ names instead of camelCasedMetho dNames
- the cloud-init code-base (and Python best practice in general) uses underscored_
- the documentation for methods and functions should be in a docstring within the code block, not a comment above it
- additionally, I would suggest that you don't need to document when a callable takes no arguments, throws nothing or returns None; these are reasonable default assumptions
Thanks,
Dan