def test_get_daemon_version_should_return_the_version_that_was_previously_set( self): set_daemon_version("1.2.3.4") try: self.assertEqual( FlexibleVersion("1.2.3.4"), get_daemon_version(), "The daemon version should be 1.2.3.4. Environment={0}".format( os.environ)) finally: os.environ.pop(DAEMON_VERSION_ENV_VARIABLE)
def daemon(self): """ Run agent daemon """ set_daemon_version(AGENT_VERSION) logger.set_prefix("Daemon") threading.current_thread().setName("Daemon") child_args = None \ if self.conf_file_path is None \ else "-configuration-path:{0}".format(self.conf_file_path) from azurelinuxagent.daemon import get_daemon_handler daemon_handler = get_daemon_handler() daemon_handler.run(child_args=child_args)