Revision 66af5ec5
b/lib/cli.py | ||
---|---|---|
81 | 81 |
"DST_NODE_OPT", |
82 | 82 |
"EARLY_RELEASE_OPT", |
83 | 83 |
"ENABLED_HV_OPT", |
84 |
# FIXME: disable storage types once disk templates are fully implemented. |
|
84 | 85 |
"ENABLED_STORAGE_TYPES_OPT", |
86 |
"ENABLED_DISK_TEMPLATES_OPT", |
|
85 | 87 |
"ERROR_CODES_OPT", |
86 | 88 |
"FAILURE_ONLY_OPT", |
87 | 89 |
"FIELDS_OPT", |
... | ... | |
1165 | 1167 |
help="Comma-separated list of hypervisors", |
1166 | 1168 |
type="string", default=None) |
1167 | 1169 |
|
1170 |
# FIXME: Remove once enabled disk templates are fully implemented. |
|
1168 | 1171 |
ENABLED_STORAGE_TYPES_OPT = cli_option("--enabled-storage-types", |
1169 | 1172 |
dest="enabled_storage_types", |
1170 | 1173 |
help="Comma-separated list of " |
1171 | 1174 |
"storage methods", |
1172 | 1175 |
type="string", default=None) |
1173 | 1176 |
|
1177 |
ENABLED_DISK_TEMPLATES_OPT = cli_option("--enabled-disk-templates", |
|
1178 |
dest="enabled_disk_templates", |
|
1179 |
help="Comma-separated list of " |
|
1180 |
"disk templates", |
|
1181 |
type="string", default=None) |
|
1182 |
|
|
1174 | 1183 |
NIC_PARAMS_OPT = cli_option("-N", "--nic-parameters", dest="nicparams", |
1175 | 1184 |
type="keyval", default={}, |
1176 | 1185 |
help="NIC parameters") |
b/lib/client/gnt_cluster.py | ||
---|---|---|
193 | 193 |
|
194 | 194 |
hv_state = dict(opts.hv_state) |
195 | 195 |
|
196 |
# FIXME: remove enabled_storage_types when enabled_disk_templates are |
|
197 |
# fully implemented. |
|
198 |
enabled_storage_types = opts.enabled_storage_types |
|
199 |
if enabled_storage_types is not None: |
|
200 |
enabled_storage_types = enabled_storage_types.split(",") |
|
201 |
else: |
|
202 |
enabled_storage_types = list(constants.DEFAULT_ENABLED_STORAGE_TYPES) |
|
203 |
|
|
204 | 196 |
enabled_disk_templates = opts.enabled_disk_templates |
205 | 197 |
if enabled_disk_templates: |
206 | 198 |
enabled_disk_templates = enabled_disk_templates.split(",") |
... | ... | |
972 | 964 |
opts.use_external_mip_script is not None or |
973 | 965 |
opts.prealloc_wipe_disks is not None or |
974 | 966 |
opts.hv_state or |
967 |
# FIXME: Remove 'enabled_storage_types' once 'enabled_disk_templates' |
|
968 |
# are fully implemented. |
|
975 | 969 |
opts.enabled_storage_types or |
970 |
opts.enabled_disk_templates or |
|
976 | 971 |
opts.disk_state or |
977 | 972 |
opts.ispecs_mem_size or |
978 | 973 |
opts.ispecs_cpu_count or |
... | ... | |
1005 | 1000 |
if hvlist is not None: |
1006 | 1001 |
hvlist = hvlist.split(",") |
1007 | 1002 |
|
1003 |
# FIXME: Remove once 'enabled_disk_templates' are fully implemented. |
|
1008 | 1004 |
enabled_storage_types = opts.enabled_storage_types |
1009 | 1005 |
if enabled_storage_types is not None: |
1010 | 1006 |
enabled_storage_types = enabled_storage_types.split(",") |
1011 | 1007 |
|
1008 |
enabled_disk_templates = opts.enabled_disk_templates |
|
1009 |
if enabled_disk_templates: |
|
1010 |
enabled_disk_templates = enabled_disk_templates.split(",") |
|
1011 |
|
|
1012 | 1012 |
# a list of (name, dict) we can pass directly to dict() (or []) |
1013 | 1013 |
hvparams = dict(opts.hvparams) |
1014 | 1014 |
for hv_params in hvparams.values(): |
... | ... | |
1100 | 1100 |
use_external_mip_script=ext_ip_script, |
1101 | 1101 |
hv_state=hv_state, |
1102 | 1102 |
disk_state=disk_state, |
1103 |
# FIXME: remove once 'enabled_disk_templates' are fully implemented. |
|
1103 | 1104 |
enabled_storage_types=enabled_storage_types, |
1105 |
enabled_disk_templates=enabled_disk_templates, |
|
1104 | 1106 |
) |
1105 | 1107 |
SubmitOrSend(op, opts) |
1106 | 1108 |
return 0 |
... | ... | |
1584 | 1586 |
DRBD_HELPER_OPT, NODRBD_STORAGE_OPT, DEFAULT_IALLOCATOR_OPT, |
1585 | 1587 |
RESERVED_LVS_OPT, DRY_RUN_OPT, PRIORITY_OPT, PREALLOC_WIPE_DISKS_OPT, |
1586 | 1588 |
NODE_PARAMS_OPT, USE_EXTERNAL_MIP_SCRIPT, DISK_PARAMS_OPT, HV_STATE_OPT, |
1587 |
DISK_STATE_OPT, SUBMIT_OPT, ENABLED_STORAGE_TYPES_OPT] + |
|
1589 |
DISK_STATE_OPT, SUBMIT_OPT, ENABLED_STORAGE_TYPES_OPT, |
|
1590 |
ENABLED_DISK_TEMPLATES_OPT] + |
|
1588 | 1591 |
INSTANCE_POLICY_OPTS, |
1589 | 1592 |
"[opts...]", |
1590 | 1593 |
"Alters the parameters of the cluster"), |
b/lib/cmdlib.py | ||
---|---|---|
4498 | 4498 |
if self.op.enabled_hypervisors is not None: |
4499 | 4499 |
self.cluster.hvparams = self.new_hvparams |
4500 | 4500 |
self.cluster.enabled_hypervisors = self.op.enabled_hypervisors |
4501 |
# FIXME: remove once 'enabled_disk_templates' is fully implemented. |
|
4501 | 4502 |
if self.op.enabled_storage_types is not None: |
4502 | 4503 |
self.cluster.enabled_storage_types = \ |
4503 | 4504 |
list(set(self.op.enabled_storage_types)) |
4505 |
if self.op.enabled_disk_templates: |
|
4506 |
self.cluster.enabled_disk_templates = \ |
|
4507 |
list(set(self.op.enabled_disk_templates)) |
|
4504 | 4508 |
if self.op.beparams: |
4505 | 4509 |
self.cluster.beparams[constants.PP_DEFAULT] = self.new_beparams |
4506 | 4510 |
if self.op.nicparams: |
b/lib/opcodes.py | ||
---|---|---|
954 | 954 |
" ``%s`` or ``%s``" % (constants.DDM_ADD, constants.DDM_REMOVE)), |
955 | 955 |
("use_external_mip_script", None, ht.TMaybeBool, |
956 | 956 |
"Whether to use an external master IP address setup script"), |
957 |
# FIXME: remove once enabled disk templates are fully implemented. |
|
957 | 958 |
("enabled_storage_types", None, |
958 | 959 |
ht.TMaybe(ht.TAnd(ht.TListOf(ht.TElemOf(constants.VALID_STORAGE_TYPES)), |
959 | 960 |
ht.TTrue)), |
960 | 961 |
"List of enabled storage types"), |
962 |
("enabled_disk_templates", None, |
|
963 |
ht.TMaybe(ht.TAnd(ht.TListOf(ht.TElemOf(constants.DISK_TEMPLATES)), |
|
964 |
ht.TTrue)), |
|
965 |
"List of enabled disk templates"), |
|
961 | 966 |
] |
962 | 967 |
OP_RESULT = ht.TNone |
963 | 968 |
|
b/src/Ganeti/OpCodes.hs | ||
---|---|---|
175 | 175 |
, pHiddenOs |
176 | 176 |
, pBlacklistedOs |
177 | 177 |
, pUseExternalMipScript |
178 |
-- FIXME: Remove once enabled disk templates are fully implemented. |
|
178 | 179 |
, pEnabledStorageTypes |
180 |
, pEnabledDiskTemplates |
|
179 | 181 |
]) |
180 | 182 |
, ("OpClusterRedistConf", []) |
181 | 183 |
, ("OpClusterActivateMasterIp", []) |
b/src/Ganeti/OpParams.hs | ||
---|---|---|
237 | 237 |
, pDependencies |
238 | 238 |
, pComment |
239 | 239 |
, pReason |
240 |
-- FIXME: Remove once enabled disk templates are fully implemented |
|
240 | 241 |
, pEnabledStorageTypes |
242 |
, pEnabledDiskTemplates |
|
241 | 243 |
, dOldQuery |
242 | 244 |
, dOldQueryNoLocking |
243 | 245 |
) where |
... | ... | |
760 | 762 |
simpleField "enabled_hypervisors" [t| NonEmpty Hypervisor |] |
761 | 763 |
|
762 | 764 |
-- | List of enabled storage methods. |
765 |
-- FIXME: Remove once enabled disk templates are fully implemented. |
|
763 | 766 |
pEnabledStorageTypes :: Field |
764 | 767 |
pEnabledStorageTypes = |
765 | 768 |
optionalField $ |
766 | 769 |
simpleField "enabled_storage_types" [t| NonEmpty StorageType |] |
767 | 770 |
|
771 |
-- | List of enabled disk templates. |
|
772 |
pEnabledDiskTemplates :: Field |
|
773 |
pEnabledDiskTemplates = |
|
774 |
optionalField $ |
|
775 |
simpleField "enabled_disk_templates" [t| NonEmpty DiskTemplate |] |
|
776 |
|
|
768 | 777 |
-- | Selected hypervisor for an instance. |
769 | 778 |
pHypervisor :: Field |
770 | 779 |
pHypervisor = |
b/test/hs/Test/Ganeti/OpCodes.hs | ||
---|---|---|
163 | 163 |
arbitrary <*> arbitrary <*> arbitrary <*> |
164 | 164 |
emptyMUD <*> emptyMUD <*> arbitrary <*> |
165 | 165 |
arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> |
166 |
arbitrary <*> arbitrary <*> arbitrary <*> arbitrary |
|
166 |
arbitrary <*> arbitrary <*> arbitrary <*> arbitrary <*> |
|
167 |
arbitrary |
|
167 | 168 |
"OP_CLUSTER_REDIST_CONF" -> pure OpCodes.OpClusterRedistConf |
168 | 169 |
"OP_CLUSTER_ACTIVATE_MASTER_IP" -> |
169 | 170 |
pure OpCodes.OpClusterActivateMasterIp |
Also available in: Unified diff