Sync common utils from Oslo

Sync several common utils from oslo,
and adjust test_images.py to account for a change in fileutils.py

Change-Id: I418c9e691a95e2978ddbd91b22a174752edcb052
sync common.local from oslo

Change-Id: Idd4b78d8dd0f87dc04bcf9d3ac5f633240ccfc93
Merge "Sync common utils from Oslo"
Merge "sync common.local from oslo"