From 9f1087953784609775047fcf41ac095fc67da082 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 26 Apr 2012 14:53:33 +0200 Subject: [PATCH 1/2] Update the Charon image --- nix/options.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/options.nix b/nix/options.nix index 4b77de6a0..9beba9c67 100644 --- a/nix/options.nix +++ b/nix/options.nix @@ -406,7 +406,7 @@ in }} > $out ''; in if config.nixpkgs.system == "x86_64-linux" then - unpack "r33382-x86_64" "16irymms7vs4l3cllbpfl572269dwmlc7zficzf0r05bx7l0jsax" + unpack "0.1pre33926-33924-x86_64" "0c9857e3955bb5af273375e85c0a62a50323ccfaef0a29b5eb7f1539077c1c40" else # !!! Stupid lack of laziness # throw "Unsupported VirtualBox system type!" From e3597bcebf23826eaa3508c307291939d0692334 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 1 May 2012 18:46:18 +0200 Subject: [PATCH 2/2] Handle bogus EC2 "does not exist" errors on instance creation Fixes #17. --- charon/backends/ec2.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/charon/backends/ec2.py b/charon/backends/ec2.py index b4c1e731c..4072334a1 100644 --- a/charon/backends/ec2.py +++ b/charon/backends/ec2.py @@ -357,6 +357,17 @@ def create(self, defn, check): self.write() + # There is a short time window during which EC2 doesn't + # know the instance ID yet. So wait until it does. + while True: + try: + instance = self._get_instance_by_id(self._instance_id) + break + except boto.exception.EC2ResponseError as e: + if e.error_code != "InvalidInstanceID.NotFound": raise + self.log("EC2 instance ‘{0}’ not known yet, waiting...".format(self._instance_id)) + time.sleep(3) + # Reapply tags if they have changed. common_tags = {'CharonNetworkUUID': str(self.depl.uuid), 'CharonMachineName': self.name} tags = {'Name': "{0} [{1}]".format(self.depl.description, self.name)}