diff options
author | Sankar Tanguturi <stanguturi@stanguturi-rhel> | 2016-03-22 15:35:13 -0700 |
---|---|---|
committer | Sankar Tanguturi <stanguturi@stanguturi-rhel> | 2016-03-22 15:35:13 -0700 |
commit | b21c2b4326f501032e06b3f85236ced1efa0b309 (patch) | |
tree | f46a3c6c50e405fae6c67755d9fadc13309ad5a8 /cloudinit/sources/DataSourceOVF.py | |
parent | 0f187dd7035ac724912ea5c877f6bff1bea6fe57 (diff) | |
download | vyos-cloud-init-b21c2b4326f501032e06b3f85236ced1efa0b309.tar.gz vyos-cloud-init-b21c2b4326f501032e06b3f85236ced1efa0b309.zip |
Fixed few other misc issues.
Enabled NICS even in failure case.
Used util.del_dir() instead of shutil.rmtree.
Diffstat (limited to 'cloudinit/sources/DataSourceOVF.py')
-rw-r--r-- | cloudinit/sources/DataSourceOVF.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/sources/DataSourceOVF.py b/cloudinit/sources/DataSourceOVF.py index fc12cbb4..ccdd4fd0 100644 --- a/cloudinit/sources/DataSourceOVF.py +++ b/cloudinit/sources/DataSourceOVF.py @@ -24,7 +24,6 @@ from xml.dom import minidom import base64 import os -import shutil import re import time @@ -120,10 +119,10 @@ class DataSourceOVF(sources.DataSource): set_customization_status( GuestCustStateEnum.GUESTCUST_STATE_RUNNING, GuestCustEventEnum.GUESTCUST_EVENT_CUSTOMIZE_FAILED) + enable_nics(nics) return False finally: - dirPath = os.path.dirname(vmwareImcConfigFilePath) - shutil.rmtree(dirPath) + util.del_dir(os.path.dirname(vmwareImcConfigFilePath)) try: LOG.debug("Applying the Network customization") @@ -135,13 +134,14 @@ class DataSourceOVF(sources.DataSource): set_customization_status( GuestCustStateEnum.GUESTCUST_STATE_RUNNING, GuestCustEventEnum.GUESTCUST_EVENT_NETWORK_SETUP_FAILED) + enable_nics(nics) return False vmwarePlatformFound = True - enable_nics(nics) set_customization_status( GuestCustStateEnum.GUESTCUST_STATE_DONE, GuestCustErrorEnum.GUESTCUST_ERROR_SUCCESS) + enable_nics(nics) else: np = {'iso': transport_iso9660, 'vmware-guestd': transport_vmware_guestd, } |