Fix for race condition where 'captured' Windows Azure instances identify

as the previous instance (LP: #1269626).
This commit is contained in:
Ben Howard 2014-01-15 17:18:32 -07:00
parent 1f0eab4c8c
commit f29d70e4e7

View File

@ -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)