EC2: fixed AttributeError when metadata is not found

Change-Id: I91e0141bd89cd18596ccae2ea213f641ba4d7f74
Closes-Bug: 1324091
Merge "EC2: fixed AttributeError when metadata is not found"