Revision 919db916 lib/client/gnt_group.py

b/lib/client/gnt_group.py
50 50

  
51 51
  """
52 52
  ipolicy = CreateIPolicyFromOpts(
53
    ispecs_mem_size=opts.ispecs_mem_size,
54
    ispecs_cpu_count=opts.ispecs_cpu_count,
55
    ispecs_disk_count=opts.ispecs_disk_count,
56
    ispecs_disk_size=opts.ispecs_disk_size,
57
    ispecs_nic_count=opts.ispecs_nic_count,
58 53
    minmax_ispecs=opts.ipolicy_bounds_specs,
59 54
    ipolicy_vcpu_ratio=opts.ipolicy_vcpu_ratio,
60 55
    ipolicy_spindle_ratio=opts.ipolicy_spindle_ratio,
......
162 157

  
163 158
  """
164 159
  allmods = [opts.ndparams, opts.alloc_policy, opts.diskparams, opts.hv_state,
165
             opts.disk_state, opts.ispecs_mem_size, opts.ispecs_cpu_count,
166
             opts.ispecs_disk_count, opts.ispecs_disk_size,
167
             opts.ispecs_nic_count, opts.ipolicy_bounds_specs,
160
             opts.disk_state, opts.ipolicy_bounds_specs,
168 161
             opts.ipolicy_vcpu_ratio, opts.ipolicy_spindle_ratio,
169 162
             opts.diskparams]
170 163
  if allmods.count(None) == len(allmods):
......
180 173

  
181 174
  diskparams = dict(opts.diskparams)
182 175

  
183
  # set the default values
184
  to_ipolicy = [
185
    opts.ispecs_mem_size,
186
    opts.ispecs_cpu_count,
187
    opts.ispecs_disk_count,
188
    opts.ispecs_disk_size,
189
    opts.ispecs_nic_count,
190
    ]
191
  for ispec in to_ipolicy:
192
    for param in ispec:
193
      if isinstance(ispec[param], basestring):
194
        if ispec[param].lower() == "default":
195
          ispec[param] = constants.VALUE_DEFAULT
196 176
  # create ipolicy object
197 177
  ipolicy = CreateIPolicyFromOpts(
198
    ispecs_mem_size=opts.ispecs_mem_size,
199
    ispecs_cpu_count=opts.ispecs_cpu_count,
200
    ispecs_disk_count=opts.ispecs_disk_count,
201
    ispecs_disk_size=opts.ispecs_disk_size,
202
    ispecs_nic_count=opts.ispecs_nic_count,
203 178
    minmax_ispecs=opts.ipolicy_bounds_specs,
204 179
    ipolicy_disk_templates=opts.ipolicy_disk_templates,
205 180
    ipolicy_vcpu_ratio=opts.ipolicy_vcpu_ratio,

Also available in: Unified diff