Discussion:
mock ec2 instances
JayP
2012-11-14 18:44:53 UTC
Permalink
Is there a way to mock ec2 instances so when I run this it doesn't fail
saying it can't find the instance?

x = Fog::AWS[:elb].load_balancers.get("elb-name")
x.register_instances(["i-123abc"])

Thanks,
Jay
geemus (Wesley Beary)
2012-11-14 19:35:03 UTC
Permalink
I'm not sure about the elb portion of the mocks, but the general pattern in
fog would be to create a new instance via mocked ec2 and then refer to that.

Make sense?
Post by JayP
Is there a way to mock ec2 instances so when I run this it doesn't fail
saying it can't find the instance?
x = Fog::AWS[:elb].load_balancers.get("elb-name")
x.register_instances(["i-123abc"])
Thanks,
Jay
JayP
2012-11-14 21:18:09 UTC
Permalink
Ah, I think I was having trouble finding that piece of code in fog, found
it under lib/fog/ibm Thanks!
Post by geemus (Wesley Beary)
I'm not sure about the elb portion of the mocks, but the general pattern
in fog would be to create a new instance via mocked ec2 and then refer to
that.
Make sense?
Post by JayP
Is there a way to mock ec2 instances so when I run this it doesn't fail
saying it can't find the instance?
x = Fog::AWS[:elb].load_balancers.get("elb-name")
x.register_instances(["i-123abc"])
Thanks,
Jay
Loading...