summaryrefslogtreecommitdiff
path: root/cloudinit/sources/helpers/vmware/imc/config.py
diff options
context:
space:
mode:
authorSankar Tanguturi <stanguturi@stanguturi-rhel>2016-01-19 18:24:54 -0800
committerSankar Tanguturi <stanguturi@stanguturi-rhel>2016-01-19 18:24:54 -0800
commit415c45a2b9b66603e672e8ea54cee8f40a19abd1 (patch)
treefdfa6a5e27a810448dade2a5d48871e9732c1977 /cloudinit/sources/helpers/vmware/imc/config.py
parent8d9e5bd7fcda8f56a4fe087150db1456af738335 (diff)
downloadvyos-cloud-init-415c45a2b9b66603e672e8ea54cee8f40a19abd1.tar.gz
vyos-cloud-init-415c45a2b9b66603e672e8ea54cee8f40a19abd1.zip
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.
Diffstat (limited to 'cloudinit/sources/helpers/vmware/imc/config.py')
-rw-r--r--cloudinit/sources/helpers/vmware/imc/config.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cloudinit/sources/helpers/vmware/imc/config.py b/cloudinit/sources/helpers/vmware/imc/config.py
index 7eee47a5..aebc12a0 100644
--- a/cloudinit/sources/helpers/vmware/imc/config.py
+++ b/cloudinit/sources/helpers/vmware/imc/config.py
@@ -66,7 +66,8 @@ class Config:
def name_servers(self):
"""Return the list of DNS servers."""
res = []
- for i in range(1, self._configFile.get_count(Config.DNS) + 1):
+ cnt = self._configFile.get_count_with_prefix(Config.DNS)
+ for i in range(1, cnt + 1):
key = Config.DNS + str(i)
res.append(self._configFile[key])
@@ -76,7 +77,8 @@ class Config:
def dns_suffixes(self):
"""Return the list of DNS Suffixes."""
res = []
- for i in range(1, self._configFile.get_count(Config.SUFFIX) + 1):
+ cnt = self._configFile.get_count_with_prefix(Config.SUFFIX)
+ for i in range(1, cnt + 1):
key = Config.SUFFIX + str(i)
res.append(self._configFile[key])