Add explanatory comments for extension rolling upgrade

This commit is contained in:
William Pearson
2017-09-13 15:56:00 -07:00
parent bc0ecc51ba
commit bc2cdf2b23
2 changed files with 6 additions and 0 deletions
+2
View File
@@ -1315,6 +1315,7 @@ class ExtensionsConfig(object):
logger.verbose("Load ExtensionsConfig.xml")
self.ext_handlers = ExtHandlerList()
self.vmagent_manifests = VMAgentManifestList()
# Default the rolling upgrade flag to False
self.rolling_upgrade = False
self.status_upload_blob = None
self.status_upload_blob_type = None
@@ -1330,6 +1331,7 @@ class ExtensionsConfig(object):
guest_agent = find(xml_doc, "GuestAgentExtension")
ru_text = findtext(guest_agent, "ExtensionRollingUpgrade")
# The value of the flag defaults to False
if ru_text and ru_text.lower() == "true":
self.rolling_upgrade = True
+4
View File
@@ -301,10 +301,14 @@ class ExtHandlersHandler(object):
state = ext_handler.properties.state
# Valid states are enabled, disabled and uninstall
if state == u"enabled":
# Return early to skip upgrading if the rolling_upgrade
# flag is True and the upgrade GUID is NOT new
if self.protocol.get_rolling_upgrade() and \
not self.is_new_guid(ext_handler):
return
elif state == u"disabled" or state == u"uninstall":
# Remove the GUID from the dictionary in this case so that
# it is upgraded upon re-enabling/re-install
self.last_guids.pop(ext_handler.name, None)
ext_handler_i.decide_version()
if not ext_handler_i.is_upgrade and self.last_etag == etag: