From 062256ada323c80ec5ffe0d9656ef4cde4e394ff Mon Sep 17 00:00:00 2001 From: Chris Henry Date: Sun, 18 Jan 2015 15:53:59 -0500 Subject: [PATCH 1/5] Use the current time when launching an instance. --- moto/ec2/models.py | 1 + moto/ec2/responses/instances.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/moto/ec2/models.py b/moto/ec2/models.py index e9246a6bf..574621001 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -299,6 +299,7 @@ class Instance(BotoInstance, TaggedEC2Resource): self.subnet_id = kwargs.get("subnet_id") self.key_name = kwargs.get("key_name") self.source_dest_check = "true" + self.launch_time = datetime.now().strftime('%y-%m-%dT%H:%M:%S%z') self.block_device_mapping = BlockDeviceMapping() self.block_device_mapping['/dev/sda1'] = BlockDeviceType(volume_id=random_volume_id()) diff --git a/moto/ec2/responses/instances.py b/moto/ec2/responses/instances.py index 7922f9d99..49b385a58 100644 --- a/moto/ec2/responses/instances.py +++ b/moto/ec2/responses/instances.py @@ -325,7 +325,7 @@ EC2_DESCRIBE_INSTANCES = """ Date: Sun, 18 Jan 2015 16:20:59 -0500 Subject: [PATCH 3/5] Change timestamp format to ISO 8601, as per http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html --- moto/ec2/responses/instances.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moto/ec2/responses/instances.py b/moto/ec2/responses/instances.py index 49b385a58..62456bc87 100644 --- a/moto/ec2/responses/instances.py +++ b/moto/ec2/responses/instances.py @@ -204,7 +204,7 @@ EC2_RUN_INSTANCES = """ Date: Sun, 18 Jan 2015 16:37:56 -0500 Subject: [PATCH 5/5] Fix merge conflict, --- moto/ec2/models.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/moto/ec2/models.py b/moto/ec2/models.py index edd56f898..8fdb7444b 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -299,11 +299,8 @@ class Instance(BotoInstance, TaggedEC2Resource): self.subnet_id = kwargs.get("subnet_id") self.key_name = kwargs.get("key_name") self.source_dest_check = "true" -<<<<<<< HEAD self.launch_time = datetime.now().isoformat() -======= self.private_ip_address = kwargs.get('private_ip_address') ->>>>>>> c22ea3014b8d2068696ef246e90bd9ec8ec90b91 self.block_device_mapping = BlockDeviceMapping() self.block_device_mapping['/dev/sda1'] = BlockDeviceType(volume_id=random_volume_id())