def manage_mode(mode):
    if mode is None:
        return None
    ret = str(mode).lstrip('0').zfill(4)
    if ret[0] != '0':
        return '0{0}'.format(ret)
    return ret
Copy a VDI and return the new VDIs reference.
dataset/ETHPy150Open saltstack/salt/salt/client/ssh/wrapper/config.py/manage_mode--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/xenapi/vm_utils.py/_safe_copy_vdi