From 9d4a9dc17696d0465ae4f8b56db9c0948fcac28c Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 2 Aug 2011 17:09:43 -0400 Subject: This fixes LP: #819507, to make consume_userdata run 'always' consume_userdata should really run always, rather than once per instance. The documentation says that boothooks were on their own for per-instance but since this routine was only being called once, they would only get called once. This modifies the behavior to be: user_script: per_always cloud_config : per_always upstart_job : per_instance cloud_boothook: per_always In order to not break part handlers that are existing, and expect to only be called once per instance, this adds a 'handler_version' item in a handler that can indicate the version (currently 1 or 2). If it is 2, then the hander will be passed the frequency (per-instance or per-always) that this is being run. That way the handler can differenciate between them. This also makes 'bootcmd' run every boot. That should be changable in cloud-config though, so users who dont like the behavior can modify it. LP: #819507 --- cloudinit/CloudConfig/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cloudinit/CloudConfig/__init__.py') diff --git a/cloudinit/CloudConfig/__init__.py b/cloudinit/CloudConfig/__init__.py index 91853dfd..82f422fc 100644 --- a/cloudinit/CloudConfig/__init__.py +++ b/cloudinit/CloudConfig/__init__.py @@ -25,9 +25,9 @@ import os import subprocess import time -per_instance="once-per-instance" -per_always="always" -per_once="once" +per_instance= cloudinit.per_instance +per_always = cloudinit.per_always +per_once = cloudinit.per_once class CloudConfig(): cfgfile = None -- cgit v1.2.3