summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceOVF.py
diff options
context:
space:
mode:
authorSankar Tanguturi <stanguturi@stanguturi-rhel>2016-03-09 16:02:34 -0800
committerSankar Tanguturi <stanguturi@stanguturi-rhel>2016-03-09 16:02:34 -0800
commita6e0922a4d34ede6df000dd8fc4bb3531218d69f (patch)
tree0422066e5342e365d7ab8102857fa301c659b50c /cloudinit/sources/DataSourceOVF.py
parentef7368ef61c47fbb0bc03e6e7a5bc4571d492baf (diff)
downloadvyos-cloud-init-a6e0922a4d34ede6df000dd8fc4bb3531218d69f.tar.gz
vyos-cloud-init-a6e0922a4d34ede6df000dd8fc4bb3531218d69f.zip
- Fixed few issues with return values form util.subp()
- Added a new utility method to send a RPC for enabling NICS - Modified DataSourceOVF.py to enable nics. - Executed ./tools/run-pep8 and no issues were reported.
Diffstat (limited to 'cloudinit/sources/DataSourceOVF.py')
-rw-r--r--cloudinit/sources/DataSourceOVF.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/cloudinit/sources/DataSourceOVF.py b/cloudinit/sources/DataSourceOVF.py
index 0fbdf0b8..bc13b71a 100644
--- a/cloudinit/sources/DataSourceOVF.py
+++ b/cloudinit/sources/DataSourceOVF.py
@@ -40,8 +40,11 @@ from cloudinit.sources.helpers.vmware.imc.guestcust_state import \
GuestCustStateEnum
from cloudinit.sources.helpers.vmware.imc.guestcust_error import \
GuestCustErrorEnum
-from cloudinit.sources.helpers.vmware.imc.guestcust_util import \
- set_customization_status
+from cloudinit.sources.helpers.vmware.imc.guestcust_util import (
+ set_customization_status,
+ get_nics_to_enable,
+ enable_nics
+)
LOG = logging.getLogger(__name__)
@@ -100,10 +103,13 @@ class DataSourceOVF(sources.DataSource):
LOG.debug("Customization for VMware platform is disabled.")
if vmwareImcConfigFilePath:
+ nics = ""
try:
cf = ConfigFile(vmwareImcConfigFilePath)
conf = Config(cf)
(md, ud, cfg) = read_vmware_imc(conf)
+ dirpath = os.path.dirname(vmwareImcConfigFilePath)
+ nics = get_nics_to_enable(dirpath)
except Exception as e:
LOG.debug("Error parsing the customization Config File")
LOG.exception(e)
@@ -128,6 +134,7 @@ class DataSourceOVF(sources.DataSource):
return False
vmwarePlatformFound = True
+ enable_nics(nics)
set_customization_status(
GuestCustStateEnum.GUESTCUST_STATE_DONE,
GuestCustErrorEnum.GUESTCUST_ERROR_SUCCESS)