From 677b85abfb2558207956a199eaaceb91af07c076 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 9 Nov 2016 08:20:02 -0500 Subject: Azure: No longer rely on walinux agent. Cloud-init has for some time relied on walinuxagent to do some bits of work necessary for instance initialization. That reliance has not been needed for a while, but we have still defaulted to it. This change uses the "builtin" path that Daniel Watkins added some time ago by default. Also, Adjust tests that assumed the non-__builtin__ Azure agent_command. LP: #1538522 --- cloudinit/sources/DataSourceAzure.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cloudinit/sources/DataSourceAzure.py') diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py index 22f9004a..af5d43b0 100644 --- a/cloudinit/sources/DataSourceAzure.py +++ b/cloudinit/sources/DataSourceAzure.py @@ -36,6 +36,7 @@ LOG = logging.getLogger(__name__) DS_NAME = 'Azure' DEFAULT_METADATA = {"instance-id": "iid-AZURE-NODE"} AGENT_START = ['service', 'walinuxagent', 'start'] +AGENT_START_BUILTIN = "__builtin__" BOUNCE_COMMAND = [ 'sh', '-xc', "i=$interface; x=0; ifdown $i || x=$?; ifup $i || x=$?; exit $x" @@ -45,7 +46,7 @@ BOUNCE_COMMAND = [ RESOURCE_DISK_PATH = '/dev/disk/cloud/azure_resource' BUILTIN_DS_CONFIG = { - 'agent_command': AGENT_START, + 'agent_command': AGENT_START_BUILTIN, 'data_dir': "/var/lib/waagent", 'set_hostname': True, 'hostname_bounce': { @@ -230,7 +231,7 @@ class DataSourceAzureNet(sources.DataSource): # the directory to be protected. write_files(ddir, files, dirmode=0o700) - if self.ds_cfg['agent_command'] == '__builtin__': + if self.ds_cfg['agent_command'] == AGENT_START_BUILTIN: metadata_func = partial(get_metadata_from_fabric, fallback_lease_file=self. dhclient_lease_file) -- cgit v1.2.3