コード例 #1
0
ファイル: fake_network.py プロジェクト: klmitch/nova
def _create_instances_with_cached_ips(orig_func, *args, **kwargs):
    """Kludge the above kludge so that the database doesn't get out
    of sync with the actual instance.
    """
    instances, reservation_id = orig_func(*args, **kwargs)
    fake_cache = _get_fake_cache()
    for instance in instances:
        instance['info_cache'].network_info = fake_cache
        db.instance_info_cache_update(args[1], instance['uuid'],
                                      {'network_info': fake_cache})
    return (instances, reservation_id)
コード例 #2
0
def _create_instances_with_cached_ips(orig_func, *args, **kwargs):
    """Kludge the above kludge so that the database doesn't get out
    of sync with the actual instance.
    """
    instances, reservation_id = orig_func(*args, **kwargs)
    fake_cache = _get_fake_cache()
    for instance in instances:
        instance['info_cache'].network_info = fake_cache
        db.instance_info_cache_update(args[1], instance['uuid'],
                                      {'network_info': fake_cache})
    return (instances, reservation_id)
コード例 #3
0
 def save(self, update_cells=True):
     if 'network_info' in self.obj_what_changed():
         nw_info_json = self.fields['network_info'].to_primitive(
             self, 'network_info', self.network_info)
         rv = db.instance_info_cache_update(self._context,
                                            self.instance_uuid,
                                            {'network_info': nw_info_json})
         self._from_db_object(self._context, self, rv)
     self.obj_reset_changes()
コード例 #4
0
ファイル: instance_info_cache.py プロジェクト: mahak/nova
 def save(self, update_cells=True):
     if 'network_info' in self.obj_what_changed():
         nw_info_json = self.fields['network_info'].to_primitive(
             self, 'network_info', self.network_info)
         rv = db.instance_info_cache_update(self._context,
                                            self.instance_uuid,
                                            {'network_info': nw_info_json})
         self._from_db_object(self._context, self, rv)
     self.obj_reset_changes()
コード例 #5
0
 def save(self, update_cells=True):
     if 'network_info' in self.obj_what_changed():
         if update_cells:
             stale_instance = self.obj_clone()
         nw_info_json = self.fields['network_info'].to_primitive(
             self, 'network_info', self.network_info)
         rv = db.instance_info_cache_update(self._context,
                                            self.instance_uuid,
                                            {'network_info': nw_info_json})
         self._from_db_object(self._context, self, rv)
         if update_cells:
             # Send a copy of ourselves before updates are applied so
             # that cells can tell what changed.
             self._info_cache_cells_update(self._context, stale_instance)
     self.obj_reset_changes()
コード例 #6
0
ファイル: instance_info_cache.py プロジェクト: arbrandes/nova
 def save(self, update_cells=True):
     if 'network_info' in self.obj_what_changed():
         if update_cells:
             stale_instance = self.obj_clone()
         nw_info_json = self.fields['network_info'].to_primitive(
             self, 'network_info', self.network_info)
         rv = db.instance_info_cache_update(self._context,
                                            self.instance_uuid,
                                            {'network_info': nw_info_json})
         self._from_db_object(self._context, self, rv)
         if update_cells:
             # Send a copy of ourselves before updates are applied so
             # that cells can tell what changed.
             self._info_cache_cells_update(self._context, stale_instance)
     self.obj_reset_changes()