Skip to content

sources/azure: unpack ret tuple in crawl_metadata()#1194

Merged
TheRealFalcon merged 1 commit into
canonical:mainfrom
cjp256:azure-unpack-ret
Jan 20, 2022
Merged

sources/azure: unpack ret tuple in crawl_metadata()#1194
TheRealFalcon merged 1 commit into
canonical:mainfrom
cjp256:azure-unpack-ret

Conversation

@cjp256
Copy link
Copy Markdown
Contributor

@cjp256 cjp256 commented Jan 18, 2022

load_azure_ds_dir() always returns a tuple. Instead of saving this
tuple as ret, expand it immediately as md, userdata_raw, cfg, files.

This allows for more fine-grained passing of data before getting
expanded later.

  • Update _should_reprovision methods to use cfg instead of tuple.

  • Update _should_reprovision methods to remove the ovf_md guard.
    This should be a safe refactor as the OVF is not required, and the
    config is initialized to an empty dict. In practice, a mount failure
    would have initalized ret anyways if the OVF was not found. If a
    mount failure wasn't seen and ret was None, this guard could be
    causing other failures by ignoring the PPS state that should be
    available from IMDS metadata.

Signed-off-by: Chris Patterson cpatterson@microsoft.com

Copy link
Copy Markdown
Contributor

@anhvoms anhvoms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

load_azure_ds_dir() always returns a tuple.  Instead of saving this
tuple as ret, expand it immediately as md, userdata_raw, cfg, files.

This allows for more fine-grained passing of data before getting
expanded later.

- Update _should_reprovision methods to use cfg instead of tuple.

- Update _should_reprovision methods to remove the ovf_md guard.
 This should be a safe refactor as the OVF is not required, and the
 config is initialized to an empty dict.  In practice, a mount failure
 would have initialized ret anyways if the OVF was not found. If a
 mount failure wasn't seen and ret was None, this guard could be
 causing other failures by ignoring the PPS state that should be
 available from IMDS metadata.

Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
@cjp256
Copy link
Copy Markdown
Contributor Author

cjp256 commented Jan 18, 2022

*rebased

Copy link
Copy Markdown
Contributor

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@TheRealFalcon TheRealFalcon merged commit 6c8770f into canonical:main Jan 20, 2022
@cjp256 cjp256 deleted the azure-unpack-ret branch April 25, 2022 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants