Removed redundant code in stack preview, create.

The operations performed for stack preview is a proper subset of
those performed for stack create, but the code is repeated.
Avoided the redundancy by creating a method and having it called
from preview_stack and create_stack methods.

Change-Id: I53d9f10913fcb49aa3fdb841b1fc893b8e401e4d
Closes-Bug: #1337718
Merge "Removed redundant code in stack preview, create."