def _convert_permissions(permissions):
    if isinstance(permissions, (int, float)):
        return int(permissions)
    try:
        permissions = int(permissions, 8)
    except (__HOLE__, TypeError):
        LOG.warning("Fail to process permissions %s, assuming %s",
                    permissions, DEFAULT_PERMISSIONS)
        permissions = DEFAULT_PERMISSIONS

    return permissions
dataset/ETHPy150Open openstack/cloudbase-init/cloudbaseinit/plugins/common/userdataplugins/cloudconfigplugins/write_files.py/_convert_permissions