Ejemplo n.º 1
0
 def _create_in_db(context, updates):
     db_mapping = api_models.HostMapping()
     db_mapping.update(updates)
     db_mapping.save(context.session)
     # NOTE: This is done because a later access will trigger a lazy load
     # outside of the db session so it will fail. We don't lazy load
     # cell_mapping on the object later because we never need a HostMapping
     # without the CellMapping.
     db_mapping.cell_mapping
     return db_mapping
Ejemplo n.º 2
0
 def _create_in_db(context, updates):
     session = db_api.get_api_session()
     db_mapping = api_models.HostMapping()
     db_mapping.update(updates)
     db_mapping.save(session)
     return db_mapping
Ejemplo n.º 3
0
 def _create_in_db(context, updates):
     db_mapping = api_models.HostMapping()
     return _apply_updates(context, db_mapping, updates)
Ejemplo n.º 4
0
 def _create_in_db(context, updates):
     db_mapping = api_models.HostMapping()
     db_mapping.update(updates)
     db_mapping.save(context.session)
     return db_mapping