eucalyptus/eutester

instance.get_metadata doesn't work with credpath used with Eucaops

Closed this issue · 3 comments

Issue

In testcase instancetest.py, we use credpath. Since we require credpath, instance.metadata doesn't execute anymore. The following error is given:

Setup

tester = Eucaops( credpath="/Users/hspencer/Desktop/eutester-dev/creds/epc/euca2-admin-x509/")
.....

Error

In [97]: for instance in reservation.instances:
if re.match("internal", instance.private_dns_name.split('eucalyptus.')[-1]):
instance.get_metadata("local-ipv4")[0]

....:

AttributeError Traceback (most recent call last)
/Users/hspencer/ in ()
1 for instance in reservation.instances:
2 if re.match("internal", instance.private_dns_name.split('eucalyptus.')[-1]):
----> 3 instance.get_metadata("local-ipv4")[0]
4

/Users/hspencer/Desktop/eutester-dev/lib/python2.7/site-packages/eutester-0.0.1-py2.7.egg/eutester/euinstance.pyc in get_metadata(self, element_path)
297 def get_metadata(self, element_path):
298 """Return the lines of metadata from the element path provided"""
--> 299 if self.tester.config:
300 isManaged = re.search("managed", self.tester.get_network_mode())
301 if not isManaged:

AttributeError: 'Eucaops' object has no attribute 'config'

Hey Harold,

I checked in a fix to the issue in the testing branch can you give it a shot and let me know if it works for you? I will merge into master when you give the word. Basically i just check that I can ping the meta data service IP then try that if I cant ping I check the clc ip directly

Works like a charm man. Thanks. Do you want me to close this issue out or do you?

Thanks for the verification