Skip to content

Commit

Permalink
added messages
Browse files Browse the repository at this point in the history
  • Loading branch information
narrieta committed May 24, 2023
1 parent 988e402 commit 7b9b742
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions azurelinuxagent/daemon/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ def sleep_if_disabled(self):
agent_disabled_file_path = conf.get_disable_agent_file_path()
if os.path.exists(agent_disabled_file_path):
import threading
logger.warn("Disabling the guest agent by sleeping forever; "
"to re-enable, remove {0} and restart"
.format(agent_disabled_file_path))
logger.warn("Disabling the guest agent by sleeping forever; to re-enable, remove {0} and restart".format(agent_disabled_file_path))
logger.warn("To enable VM extensions, also ensure that the VM's osProfile.allowExtensionOperations property is set to true.")
self.running = False
disable_event = threading.Event()
disable_event.wait()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ def run(self):
#
# Validate that the agent is not reporting status.
#
log.info("Verifying that the Agent status is 'Not Ready' (i.e. it is not reporting status).")
vm: VirtualMachineClient = VirtualMachineClient(self._context.vm)
instance_view: VirtualMachineInstanceView = vm.get_instance_view()
log.info("Instance view of VM Agent:\n%s", instance_view.vm_agent.serialize())
assert_that(instance_view.vm_agent.statuses).described_as("The VM agent should have exactly 1 status").is_length(1)
assert_that(instance_view.vm_agent.statuses[0].code).described_as("The VM Agent should not be available").is_equal_to('ProvisioningState/Unavailable')
assert_that(instance_view.vm_agent.statuses[0].display_status).described_as("The VM Agent should not ready").is_equal_to('Not Ready')
log.info("The Agent status is 'Not Ready'")

#
# Validate that extensions cannot be executed.
Expand Down

0 comments on commit 7b9b742

Please sign in to comment.