From 76d5d79c0ec119cf5e87e71578125081c40c291d Mon Sep 17 00:00:00 2001 From: Soren Hansen Date: Tue, 25 Aug 2009 14:46:16 +0200 Subject: Added script handling to appliance config handling. Added test cases for this. --- ec2-run-user-data.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ec2-run-user-data.py') diff --git a/ec2-run-user-data.py b/ec2-run-user-data.py index 784a1b3f..2917b2fe 100755 --- a/ec2-run-user-data.py +++ b/ec2-run-user-data.py @@ -107,6 +107,21 @@ class ApplianceConfig(object): remove_package(pkg) else: install_package(pkg) + elif node.tagName == 'script': + script = '' + for subnode in node.childNodes: + # If someone went through the trouble of wrapping it in CDATA, + # it's probably the script we want to run.. + if subnode.nodeType == root.CDATA_SECTION_NODE: + script = subnode.nodeValue + # ..however, fall back to whatever TEXT_NODE stuff is between + # the