From 797ea880d982e0f25b5c18f3689da0a994658c05 Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Thu, 12 Apr 2012 13:33:27 -0700 Subject: [PATCH] Install cloudinit specific files that are loaded into the mime userdata Partially fixes Issue #48 Signed-off-by: Steven Dake --- MANIFEST.in | 2 ++ heat/cloudinit/config | 9 +++++++++ heat/cloudinit/part-handler.py | 14 ++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 heat/cloudinit/config create mode 100644 heat/cloudinit/part-handler.py diff --git a/MANIFEST.in b/MANIFEST.in index 1b20be51..1f41d535 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -16,6 +16,8 @@ include heat/jeos/F17-x86_64-cfntools-jeos.tdl include heat/cfntools/cfn-init include heat/cfntools/cfn-hup include heat/cfntools/cfn-signal +include heat/cloudinit/config +include heat/cloudinit/part-handler.py include heat/db/sqlalchemy/migrate_repo/migrate.cfg graft etc graft docs diff --git a/heat/cloudinit/config b/heat/cloudinit/config new file mode 100644 index 00000000..494f9d83 --- /dev/null +++ b/heat/cloudinit/config @@ -0,0 +1,9 @@ +#cloud-config +cloud_config_modules: + - locale + - scripts_user + - set_hostname + - ssh + - timezone + - update_etc_hosts + - update_hostname diff --git a/heat/cloudinit/part-handler.py b/heat/cloudinit/part-handler.py new file mode 100644 index 00000000..6dfc89b2 --- /dev/null +++ b/heat/cloudinit/part-handler.py @@ -0,0 +1,14 @@ +#part-handler +def list_types(): + return(["text/x-cfninitdata"]) + +def handle_part(data,ctype,filename,payload): + if ctype == "__begin__": + return + if ctype == "__end__": + return + + if ctype == 'text/x-cfninitdata': + f = open('/var/lib/cloud/data/%s' % filename, 'w') + f.write(payload) + f.close() -- 2.45.2