mirror of
https://github.com/clearlinux/WALinuxAgent.git
synced 2026-09-04 12:51:35 +00:00
Add explanatory comments for extension rolling upgrade
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user