summaryrefslogtreecommitdiff
path: root/cloudinit/sources
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/sources')
-rw-r--r--cloudinit/sources/DataSourceAzure.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
index 97f151d6..448915d7 100644
--- a/cloudinit/sources/DataSourceAzure.py
+++ b/cloudinit/sources/DataSourceAzure.py
@@ -93,6 +93,12 @@ class DataSourceAzureNet(sources.DataSource):
try:
if cdev.startswith("/dev/"):
ret = util.mount_cb(cdev, load_azure_ds_dir)
+
+ # If we load the OVF from a device, it means that a
+ # new ovf-env.xml has been found. (LP: #1269626)
+ if os.path.exists(ddir):
+ LOG.info("removing old agent directory %s" % ddir)
+ util.del_dir(ddir)
else:
ret = load_azure_ds_dir(cdev)