summaryrefslogtreecommitdiff
path: root/cloudinit/sources/helpers/vmware/imc/nic.py
diff options
context:
space:
mode:
authorSankar Tanguturi <stanguturi@stanguturi-rhel>2016-02-09 17:54:07 -0800
committerSankar Tanguturi <stanguturi@stanguturi-rhel>2016-02-09 17:54:07 -0800
commit39f668e5db8d09c46eee3a5df73a69f8d85ba489 (patch)
tree98812b43a9fa3d4b712f56ab2ddd4a9068361398 /cloudinit/sources/helpers/vmware/imc/nic.py
parent9ba841efc4263fcd1ec8eb266a3afa83b525ba49 (diff)
downloadvyos-cloud-init-39f668e5db8d09c46eee3a5df73a69f8d85ba489.tar.gz
vyos-cloud-init-39f668e5db8d09c46eee3a5df73a69f8d85ba489.zip
- 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.
Diffstat (limited to 'cloudinit/sources/helpers/vmware/imc/nic.py')
-rw-r--r--cloudinit/sources/helpers/vmware/imc/nic.py28
1 files changed, 22 insertions, 6 deletions
diff --git a/cloudinit/sources/helpers/vmware/imc/nic.py b/cloudinit/sources/helpers/vmware/imc/nic.py
index a7594874..6628a3ec 100644
--- a/cloudinit/sources/helpers/vmware/imc/nic.py
+++ b/cloudinit/sources/helpers/vmware/imc/nic.py
@@ -47,21 +47,37 @@ class Nic(NicBase):
@property
def primary(self):
- value = self._get('PRIMARY').lower()
- return value == 'yes' or value == 'true'
+ value = self._get('PRIMARY')
+ if value:
+ value = value.lower()
+ return value == 'yes' or value == 'true'
+ else:
+ return False
@property
def onboot(self):
- value = self._get('ONBOOT').lower()
- return value == 'yes' or value == 'true'
+ value = self._get('ONBOOT')
+ if value:
+ value = value.lower()
+ return value == 'yes' or value == 'true'
+ else:
+ return False
@property
def bootProto(self):
- return self._get('BOOTPROTO').lower()
+ value = self._get('BOOTPROTO')
+ if value:
+ return value.lower()
+ else:
+ return ""
@property
def ipv4_mode(self):
- return self._get('IPv4_MODE').lower()
+ value = self._get('IPv4_MODE')
+ if value:
+ return value.lower()
+ else:
+ return ""
@property
def staticIpv4(self):