storage-setup: Move the code to write config file in a seprate function
storage-setup: Move the code to write config file in a seprate function

Just little code reorganization. No functionality change.

Signed-off-by: Vivek Goyal <61d11262d0d9873ddb5a887f48fcb04e8c5973d0@redhat.com>

thescriptbender/container-storage-setup,shishir-a412ed/docker-storage-setup