Don't deepcopy the config if the old value is not needed
Don't deepcopy the config if the old value is not needed

The _UpgradeConfig function carries out internal upgrades of the
configuration, and additionally, if requested, saves the configuration
in case it changed in this process. To compare the old and the new
version, a deep copy of the old version is kept. As deep copying large
configurations is an expensive operation, only do it, if the value is
used afterwards.

Signed-off-by: Klaus Aehlig <4ce51de36d9068cd7db2eec1151e0f3f95419008@google.com>
Reviewed-by: Lisa Velden <f95ae155456787aef400a49db463a62bbef84ead@google.com>

andir/ganeti,andir/ganeti,yiannist/ganeti,leshchevds/ganeti,yiannist/ganeti,mbakke/ganeti,mbakke/ganeti,ganeti/ganeti,yiannist/ganeti,leshchevds/ganeti,onponomarev/ganeti,mbakke/ganeti,onponomarev/ganeti,leshchevds/ganeti,ganeti/ganeti,ganeti/ganeti,andir/ganeti