Skip to content

sources/azure: refactor _report_ready_if_needed and _poll_imds#1222

Merged
TheRealFalcon merged 2 commits into
canonical:mainfrom
cjp256:azure-poll-imds-refactor-rebase
Jan 31, 2022
Merged

sources/azure: refactor _report_ready_if_needed and _poll_imds#1222
TheRealFalcon merged 2 commits into
canonical:mainfrom
cjp256:azure-poll-imds-refactor-rebase

Conversation

@cjp256
Copy link
Copy Markdown
Contributor

@cjp256 cjp256 commented Jan 28, 2022

Refactor _report_ready_if_needed() to work for both Savable PPS
and Runnable PPS:

  • rename _report_ready_if_needed() to _report_ready_for_pps()

  • return interface name from lease to support _poll_imds() behavior
    without changing it.

  • fixes an issue where reporting ready return value was silently
    ignored for Savable PPS.

  • add explicit handling for failure to obtain DHCP lease to
    result in sources.InvalidMetaDataException.

Refactor _poll_imds():

  • use _report_ready_for_pps() for reporting ready, removing this logic
    to simplify loop logic.

  • move netlink and vnetswitch out of while loop to simplify loop logic,
    leaving only reprovision polling in loop.

  • add explicit handling for failure to obtain DHCP lease and
    retry in the next iteration.

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

Refactor _report_ready_if_needed() to work for both Savable PPS
and Runnable PPS:

- rename _report_ready_if_needed() to _report_ready_for_pps()

- return interface name from lease to support _poll_imds() behavior
  without changing it.

- fixes an issue where reporting ready return value was silently
  ignored for Savable PPS.

- add explicit handling for failure to obtain DHCP lease to
  result in sources.InvalidMetaDataException.

Refactor _poll_imds():

- use _report_ready_for_pps() for reporting ready, removing this logic
  to simplify loop logic.

- move netlink and vnetswitch out of while loop to simplify loop logic,
  leaving only reprovision polling in loop.

- add explicit handling for failure to obtain DHCP lease and
  retry in the next iteration.

Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
@cjp256 cjp256 force-pushed the azure-poll-imds-refactor-rebase branch from 3b959bb to 15faccc Compare January 28, 2022 21:56
Comment thread cloudinit/sources/DataSourceAzure.py Outdated
Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
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.

Thanks!

@TheRealFalcon TheRealFalcon merged commit 902aa44 into canonical:main Jan 31, 2022
@cjp256 cjp256 deleted the azure-poll-imds-refactor-rebase branch April 25, 2022 16:50
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