diff options
-rw-r--r-- | cloudinit/handlers/boot_hook.py | 6 | ||||
-rw-r--r-- | cloudinit/stages.py | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/cloudinit/handlers/boot_hook.py b/cloudinit/handlers/boot_hook.py index 10f60b8d..fa675f09 100644 --- a/cloudinit/handlers/boot_hook.py +++ b/cloudinit/handlers/boot_hook.py @@ -32,10 +32,12 @@ LOG = logging.getLogger(__name__) class BootHookPartHandler(handlers.Handler): - def __init__(self, paths, instance_id, **_kwargs): + def __init__(self, paths, datasource, **_kwargs): handlers.Handler.__init__(self, PER_ALWAYS) self.boothook_dir = paths.get_ipath("boothooks") - self.instance_id = instance_id + self.instance_id = None + if datasource: + self.instance_id = datasource.get_instance_id() def list_types(self): return [ diff --git a/cloudinit/stages.py b/cloudinit/stages.py index 8fa9d6d3..2931830c 100644 --- a/cloudinit/stages.py +++ b/cloudinit/stages.py @@ -287,7 +287,7 @@ class Init(object): def _default_userdata_handlers(self): opts = { 'paths': self.paths, - 'instance_id': self.datasource.get_instance_id(), + 'datasource': self.datasource, } # TODO Hmmm, should we dynamically import these?? def_handlers = [ |