Change the force_raw_image config usage
Change the force_raw_image config usage

The force_raw_image comes from nova side as a
fix for https://bugs.launchpad.net/nova/+bug/1383465.

The reason of the flag is, after all images are forced
to be raw because of security reason
(https://bugs.launchpad.net/nova/+bug/853330), this flag
is added later so that deployer can still select using raw images or
compressed images.

Currently this flag is used in the deeper of functions like image_to_raw() or
converted_size(). For example, image_to_raw() will convert the image
to be raw format only if the force_raw_image flag is set, that means
the caller totally have no idea if the image returned is a raw image or not.

This is possibly ok for libvirt since libvirt does not care for qcow2
or raw, but it's different for ironic, since we will take different action
for qcow2/raw format. A flag in such deeper layer is not so good.

This patch changes these functions, so that the caller in image cache level
accept parameter from deploy level like iscsi_deploy or pxe, which make
decision based on the config.

Change-Id: I118c9d8edcc13d15762593c254eaf27792d6c55f
Related-Bug: #1382164

citrix-openstack-build/ironic-lib,NaohiroTamura/ironic-lib,faizan-barmawer/ironic-lib,faizan-barmawer/elytics,openstack/ironic-lib