This is really three separate commands rolled into one. Split the logic up more to simplify it somewhat. Change-Id: Ief3c3c413f791dda076f90e5ec76a033d3a9e12b Signed-off-by: Stephen Finucane <stephenfin@redhat.com>