From 457b9998d760150efb17658f9a0fd4816417577e Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Sat, 16 Jun 2012 13:11:22 -0700 Subject: Pass in the datasource as a option, instead of the lower level instance id. This allows for others to use datasource functions if they desire to instead of being restricted. +1 for future use ;) --- cloudinit/handlers/boot_hook.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cloudinit/handlers/boot_hook.py') 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 [ -- cgit v1.2.3