Revision eeaa5f6c
b/lib/cli.py | ||
---|---|---|
3739 | 3739 |
for key, val in specs.items(): # {min: .. ,max: .., std: ..} |
3740 | 3740 |
ipolicy_out[key][name] = val |
3741 | 3741 |
|
3742 |
# no filldict for non-dicts |
|
3743 |
if not group_ipolicy and fill_all: |
|
3744 |
if ipolicy_disk_templates is None: |
|
3745 |
ipolicy_disk_templates = constants.DISK_TEMPLATES |
|
3746 |
if ipolicy_vcpu_ratio is None: |
|
3747 |
ipolicy_vcpu_ratio = \ |
|
3748 |
constants.IPOLICY_DEFAULTS[constants.IPOLICY_VCPU_RATIO] |
|
3749 |
if ipolicy_spindle_ratio is None: |
|
3750 |
ipolicy_spindle_ratio = \ |
|
3751 |
constants.IPOLICY_DEFAULTS[constants.IPOLICY_SPINDLE_RATIO] |
|
3752 | 3742 |
if ipolicy_disk_templates is not None: |
3753 | 3743 |
ipolicy_out[constants.IPOLICY_DTS] = list(ipolicy_disk_templates) |
3754 | 3744 |
if ipolicy_vcpu_ratio is not None: |
... | ... | |
3758 | 3748 |
|
3759 | 3749 |
assert not (frozenset(ipolicy_out.keys()) - constants.IPOLICY_ALL_KEYS) |
3760 | 3750 |
|
3751 |
if not group_ipolicy and fill_all: |
|
3752 |
ipolicy_out = objects.FillIPolicy(constants.IPOLICY_DEFAULTS, ipolicy_out) |
|
3753 |
|
|
3761 | 3754 |
return ipolicy_out |
3762 | 3755 |
|
3763 | 3756 |
|
b/lib/client/gnt_cluster.py | ||
---|---|---|
1 | 1 |
# |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2006, 2007, 2010, 2011, 2012 Google Inc. |
|
4 |
# Copyright (C) 2006, 2007, 2010, 2011, 2012, 2013 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
144 | 144 |
utils.ForceDictType(diskparams[templ], constants.DISK_DT_TYPES) |
145 | 145 |
|
146 | 146 |
# prepare ipolicy dict |
147 |
ipolicy_raw = CreateIPolicyFromOpts(
|
|
147 |
ipolicy = CreateIPolicyFromOpts( |
|
148 | 148 |
ispecs_mem_size=opts.ispecs_mem_size, |
149 | 149 |
ispecs_cpu_count=opts.ispecs_cpu_count, |
150 | 150 |
ispecs_disk_count=opts.ispecs_disk_count, |
... | ... | |
154 | 154 |
ipolicy_vcpu_ratio=opts.ipolicy_vcpu_ratio, |
155 | 155 |
ipolicy_spindle_ratio=opts.ipolicy_spindle_ratio, |
156 | 156 |
fill_all=True) |
157 |
ipolicy = objects.FillIPolicy(constants.IPOLICY_DEFAULTS, ipolicy_raw) |
|
158 | 157 |
|
159 | 158 |
if opts.candidate_pool_size is None: |
160 | 159 |
opts.candidate_pool_size = constants.MASTER_POOL_SIZE_DEFAULT |
Also available in: Unified diff