Revision 9c8c69bc
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. |
|
85 |
"ENABLED_STORAGE_TYPES_OPT", |
|
86 | 84 |
"ENABLED_DISK_TEMPLATES_OPT", |
87 | 85 |
"ERROR_CODES_OPT", |
88 | 86 |
"FAILURE_ONLY_OPT", |
... | ... | |
1167 | 1165 |
help="Comma-separated list of hypervisors", |
1168 | 1166 |
type="string", default=None) |
1169 | 1167 |
|
1170 |
# FIXME: Remove once enabled disk templates are fully implemented. |
|
1171 |
ENABLED_STORAGE_TYPES_OPT = cli_option("--enabled-storage-types", |
|
1172 |
dest="enabled_storage_types", |
|
1173 |
help="Comma-separated list of " |
|
1174 |
"storage methods", |
|
1175 |
type="string", default=None) |
|
1176 |
|
|
1177 | 1168 |
ENABLED_DISK_TEMPLATES_OPT = cli_option("--enabled-disk-templates", |
1178 | 1169 |
dest="enabled_disk_templates", |
1179 | 1170 |
help="Comma-separated list of " |
b/lib/client/gnt_cluster.py | ||
---|---|---|
457 | 457 |
("OS search path", utils.CommaJoin(pathutils.OS_SEARCH_PATH)), |
458 | 458 |
("ExtStorage Providers search path", |
459 | 459 |
utils.CommaJoin(pathutils.ES_SEARCH_PATH)), |
460 |
("enabled storage types", |
|
461 |
utils.CommaJoin(result["enabled_storage_types"])), |
|
462 | 460 |
("enabled disk templates", |
463 | 461 |
utils.CommaJoin(result["enabled_disk_templates"])), |
464 | 462 |
]), |
... | ... | |
964 | 962 |
opts.use_external_mip_script is not None or |
965 | 963 |
opts.prealloc_wipe_disks is not None or |
966 | 964 |
opts.hv_state or |
967 |
# FIXME: Remove 'enabled_storage_types' once 'enabled_disk_templates' |
|
968 |
# are fully implemented. |
|
969 |
opts.enabled_storage_types or |
|
970 | 965 |
opts.enabled_disk_templates or |
971 | 966 |
opts.disk_state or |
972 | 967 |
opts.ispecs_mem_size or |
... | ... | |
1000 | 995 |
if hvlist is not None: |
1001 | 996 |
hvlist = hvlist.split(",") |
1002 | 997 |
|
1003 |
# FIXME: Remove once 'enabled_disk_templates' are fully implemented. |
|
1004 |
enabled_storage_types = opts.enabled_storage_types |
|
1005 |
if enabled_storage_types is not None: |
|
1006 |
enabled_storage_types = enabled_storage_types.split(",") |
|
1007 |
|
|
1008 | 998 |
enabled_disk_templates = opts.enabled_disk_templates |
1009 | 999 |
if enabled_disk_templates: |
1010 | 1000 |
enabled_disk_templates = enabled_disk_templates.split(",") |
... | ... | |
1100 | 1090 |
use_external_mip_script=ext_ip_script, |
1101 | 1091 |
hv_state=hv_state, |
1102 | 1092 |
disk_state=disk_state, |
1103 |
# FIXME: remove once 'enabled_disk_templates' are fully implemented. |
|
1104 |
enabled_storage_types=enabled_storage_types, |
|
1105 | 1093 |
enabled_disk_templates=enabled_disk_templates, |
1106 | 1094 |
) |
1107 | 1095 |
SubmitOrSend(op, opts) |
... | ... | |
1586 | 1574 |
DRBD_HELPER_OPT, NODRBD_STORAGE_OPT, DEFAULT_IALLOCATOR_OPT, |
1587 | 1575 |
RESERVED_LVS_OPT, DRY_RUN_OPT, PRIORITY_OPT, PREALLOC_WIPE_DISKS_OPT, |
1588 | 1576 |
NODE_PARAMS_OPT, USE_EXTERNAL_MIP_SCRIPT, DISK_PARAMS_OPT, HV_STATE_OPT, |
1589 |
DISK_STATE_OPT, SUBMIT_OPT, ENABLED_STORAGE_TYPES_OPT, |
|
1590 |
ENABLED_DISK_TEMPLATES_OPT] + |
|
1577 |
DISK_STATE_OPT, SUBMIT_OPT, ENABLED_DISK_TEMPLATES_OPT] + |
|
1591 | 1578 |
INSTANCE_POLICY_OPTS, |
1592 | 1579 |
"[opts...]", |
1593 | 1580 |
"Alters the parameters of the cluster"), |
b/lib/cmdlib.py | ||
---|---|---|
4494 | 4494 |
if self.op.enabled_hypervisors is not None: |
4495 | 4495 |
self.cluster.hvparams = self.new_hvparams |
4496 | 4496 |
self.cluster.enabled_hypervisors = self.op.enabled_hypervisors |
4497 |
# FIXME: remove once 'enabled_disk_templates' is fully implemented. |
|
4498 |
if self.op.enabled_storage_types is not None: |
|
4499 |
self.cluster.enabled_storage_types = \ |
|
4500 |
list(set(self.op.enabled_storage_types)) |
|
4501 | 4497 |
if self.op.enabled_disk_templates: |
4502 | 4498 |
self.cluster.enabled_disk_templates = \ |
4503 | 4499 |
list(set(self.op.enabled_disk_templates)) |
b/lib/constants.py | ||
---|---|---|
393 | 393 |
ST_SHARED_FILE, |
394 | 394 |
]) |
395 | 395 |
|
396 |
# Per default, only lvm is enabled. |
|
397 |
DEFAULT_ENABLED_STORAGE_TYPES = compat.UniqueFrozenset([ |
|
398 |
ST_LVM_VG, |
|
399 |
]) |
|
400 |
|
|
401 | 396 |
# Storage fields |
402 | 397 |
# first two are valid in LU context only, not passed to backend |
403 | 398 |
SF_NODE = "node" |
b/lib/objects.py | ||
---|---|---|
1541 | 1541 |
"prealloc_wipe_disks", |
1542 | 1542 |
"hv_state_static", |
1543 | 1543 |
"disk_state_static", |
1544 |
# Keeping this in temporarily to not break the build between patches of |
|
1545 |
# this series. Remove after 'enabled_disk_templates' is fully implemented. |
|
1546 |
"enabled_storage_types", |
|
1547 | 1544 |
"enabled_disk_templates", |
1548 | 1545 |
] + _TIMESTAMPS + _UUID |
1549 | 1546 |
|
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. |
|
958 |
("enabled_storage_types", None, |
|
959 |
ht.TMaybe(ht.TAnd(ht.TListOf(ht.TElemOf(constants.VALID_STORAGE_TYPES)), |
|
960 |
ht.TTrue)), |
|
961 |
"List of enabled storage types"), |
|
962 | 957 |
("enabled_disk_templates", None, |
963 | 958 |
ht.TMaybe(ht.TAnd(ht.TListOf(ht.TElemOf(constants.DISK_TEMPLATES)), |
964 | 959 |
ht.TTrue)), |
b/src/Ganeti/Objects.hs | ||
---|---|---|
706 | 706 |
, simpleField "primary_ip_family" [t| IpFamily |] |
707 | 707 |
, simpleField "prealloc_wipe_disks" [t| Bool |] |
708 | 708 |
, simpleField "ipolicy" [t| FilledIPolicy |] |
709 |
-- FIXME: Remove enabled storage types once enabled disk templates |
|
710 |
-- is fully implemented. |
|
711 |
, simpleField "enabled_storage_types" [t| [StorageType] |] |
|
712 | 709 |
, simpleField "enabled_disk_templates" [t| [DiskTemplate] |] |
713 | 710 |
] |
714 | 711 |
++ timeStampFields |
b/src/Ganeti/OpCodes.hs | ||
---|---|---|
175 | 175 |
, pHiddenOs |
176 | 176 |
, pBlacklistedOs |
177 | 177 |
, pUseExternalMipScript |
178 |
-- FIXME: Remove once enabled disk templates are fully implemented. |
|
179 |
, pEnabledStorageTypes |
|
180 | 178 |
, pEnabledDiskTemplates |
181 | 179 |
]) |
182 | 180 |
, ("OpClusterRedistConf", []) |
b/src/Ganeti/OpParams.hs | ||
---|---|---|
237 | 237 |
, pDependencies |
238 | 238 |
, pComment |
239 | 239 |
, pReason |
240 |
-- FIXME: Remove once enabled disk templates are fully implemented |
|
241 |
, pEnabledStorageTypes |
|
242 | 240 |
, pEnabledDiskTemplates |
243 | 241 |
, dOldQuery |
244 | 242 |
, dOldQueryNoLocking |
... | ... | |
761 | 759 |
optionalField $ |
762 | 760 |
simpleField "enabled_hypervisors" [t| NonEmpty Hypervisor |] |
763 | 761 |
|
764 |
-- | List of enabled storage methods. |
|
765 |
-- FIXME: Remove once enabled disk templates are fully implemented. |
|
766 |
pEnabledStorageTypes :: Field |
|
767 |
pEnabledStorageTypes = |
|
768 |
optionalField $ |
|
769 |
simpleField "enabled_storage_types" [t| NonEmpty StorageType |] |
|
770 |
|
|
771 | 762 |
-- | List of enabled disk templates. |
772 | 763 |
pEnabledDiskTemplates :: Field |
773 | 764 |
pEnabledDiskTemplates = |
b/src/Ganeti/Query/Server.hs | ||
---|---|---|
87 | 87 |
handleCall cdata QueryClusterInfo = |
88 | 88 |
let cluster = configCluster cdata |
89 | 89 |
hypervisors = clusterEnabledHypervisors cluster |
90 |
storageTypes = clusterEnabledStorageTypes cluster |
|
91 | 90 |
diskTemplates = clusterEnabledDiskTemplates cluster |
92 | 91 |
def_hv = case hypervisors of |
93 | 92 |
x:_ -> showJSON x |
... | ... | |
141 | 140 |
showJSON $ clusterPreallocWipeDisks cluster) |
142 | 141 |
, ("hidden_os", showJSON $ clusterHiddenOs cluster) |
143 | 142 |
, ("blacklisted_os", showJSON $ clusterBlacklistedOs cluster) |
144 |
-- FIXME: remove storage types once enabled disk templates are |
|
145 |
-- fully implemented. |
|
146 |
, ("enabled_storage_types", showJSON storageTypes) |
|
147 | 143 |
, ("enabled_disk_templates", showJSON diskTemplates) |
148 | 144 |
] |
149 | 145 |
|
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 <*> |
|
167 |
arbitrary |
|
166 |
arbitrary <*> arbitrary <*> arbitrary <*> arbitrary |
|
168 | 167 |
"OP_CLUSTER_REDIST_CONF" -> pure OpCodes.OpClusterRedistConf |
169 | 168 |
"OP_CLUSTER_ACTIVATE_MASTER_IP" -> |
170 | 169 |
pure OpCodes.OpClusterActivateMasterIp |
Also available in: Unified diff