cfgupgrade: Refactor code
cfgupgrade: Refactor code

All the upgrading code is now in one function. No functionality has been
changed.

Signed-off-by: Bernardo Dal Seno <dcdd79c5479cb9d1329ec01d126f02cb045aa103@google.com>
Reviewed-by: Helga Velroyen <2d0126b1ec6f9ec5cbec4a7012aa14faeaef10f5@google.com>

yiannist/ganeti,andir/ganeti,mbakke/ganeti,andir/ganeti,andir/ganeti,ganeti/ganeti,onponomarev/ganeti,apyrgio/ganeti,ganeti/ganeti,grnet/snf-ganeti,yiannist/ganeti,ganeti-github-testing/ganeti-test-1,bitemyapp/ganeti,leshchevds/ganeti,yiannist/ganeti,dimara/ganeti,bitemyapp/ganeti,mbakke/ganeti,mbakke/ganeti,apyrgio/snf-ganeti,grnet/snf-ganeti,leshchevds/ganeti,leshchevds/ganeti,onponomarev/ganeti,dimara/ganeti,apyrgio/snf-ganeti,ganeti/ganeti,apyrgio/ganeti,ganeti-github-testing/ganeti-test-1