

def bdm_update_or_create_at_top(self, ctxt, bdm, create=None):
    "Create or update a block device mapping in API cells.  If\n        create is True, only try to create.  If create is None, try to\n        update but fall back to create.  If create is False, only attempt\n        to update.  This maps to nova-conductor's behavior.\n        "
    if self.client.can_send_version('1.28'):
        version = '1.28'
    else:
        version = '1.10'
        bdm = objects_base.obj_to_primitive(bdm)
    cctxt = self.client.prepare(version=version)
    try:
        cctxt.cast(ctxt, 'bdm_update_or_create_at_top', bdm=bdm, create=create)
    except Exception:
        LOG.exception(_LE('Failed to notify cells of BDM update/create.'))

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/cells/rpcapi.py CellsAPI.bdm_update_or_create_at_top/original