Revision 28a45bfc lib/rapi/rlib2.py

b/lib/rapi/rlib2.py
156 156
_WFJC_TIMEOUT = 10
157 157

  
158 158

  
159
# FIXME: For compatibility we update the beparams/memory field. Needs to be
160
#        removed in Ganeti 2.7
161
def _UpdateBeparams(inst):
162
  """Updates the beparams dict of inst to support the memory field.
163

  
164
  @param inst: Inst dict
165
  @return: Updated inst dict
166

  
167
  """
168
  beparams = inst["beparams"]
169
  beparams[constants.BE_MEMORY] = beparams[constants.BE_MAXMEM]
170

  
171
  return inst
172

  
173

  
159 174
class R_root(baserlib.ResourceBase):
160 175
  """/ resource.
161 176

  
......
763 778
    use_locking = self.useLocking()
764 779
    if self.useBulk():
765 780
      bulkdata = client.QueryInstances([], I_FIELDS, use_locking)
766
      return baserlib.MapBulkFields(bulkdata, I_FIELDS)
781
      return map(_UpdateBeparams, baserlib.MapBulkFields(bulkdata, I_FIELDS))
767 782
    else:
768 783
      instancesdata = client.QueryInstances([], ["name"], use_locking)
769 784
      instanceslist = [row[0] for row in instancesdata]
......
816 831
                                            fields=I_FIELDS,
817 832
                                            use_locking=self.useLocking())
818 833

  
819
    return baserlib.MapFields(I_FIELDS, result[0])
834
    return _UpdateBeparams(baserlib.MapFields(I_FIELDS, result[0]))
820 835

  
821 836
  def GetDeleteOpInput(self):
822 837
    """Delete an instance.

Also available in: Unified diff