in azurelinuxagent/ga/exthandlers.py [0:0]
def get_status_file_path(self, extension=None):
"""
We should technically only fetch the sequence number from GoalState and not rely on the filesystem at all,
But there are certain scenarios where we need to fetch the latest sequence number from the filesystem
(For example when we need to report the status for extensions of previous GS if the current GS is Unsupported).
Always prioritizing sequence number from extensions but falling back to filesystem
:param extension: Extension for which the sequence number is required
:return: Sequence number for the extension, Status file path or -1, None
"""
path = None
seq_no = None
if extension is not None and extension.sequenceNumber is not None:
try:
seq_no = int(extension.sequenceNumber)
except ValueError:
logger.error('Sequence number [{0}] does not appear to be valid'.format(extension.sequenceNumber))
if seq_no is None:
# If we're unable to fetch Sequence number from Extension for any reason,
# try fetching it from the last modified Settings file.
seq_no = self._get_last_modified_seq_no_from_config_files(extension)
if seq_no is not None and seq_no > -1:
if self.should_perform_multi_config_op(extension) and extension is not None and extension.name is not None:
path = os.path.join(self.get_status_dir(), "{0}.{1}.status".format(extension.name, seq_no))
elif not self.supports_multi_config:
path = os.path.join(self.get_status_dir(), "{0}.status").format(seq_no)
return seq_no if seq_no is not None else -1, path