Revision 5ae4945a lib/cli.py
b/lib/cli.py | ||
---|---|---|
788 | 788 |
completion_suggest=OPT_COMPL_ONE_IALLOCATOR) |
789 | 789 |
|
790 | 790 |
DEFAULT_IALLOCATOR_OPT = cli_option("-I", "--default-iallocator", |
791 |
metavar="<NAME>", |
|
792 |
help="Set the default instance allocator plugin", |
|
793 |
default=None, type="string", |
|
794 |
completion_suggest=OPT_COMPL_ONE_IALLOCATOR) |
|
791 |
metavar="<NAME>", |
|
792 |
help="Set the default instance" |
|
793 |
" allocator plugin", |
|
794 |
default=None, type="string", |
|
795 |
completion_suggest=OPT_COMPL_ONE_IALLOCATOR) |
|
795 | 796 |
|
796 | 797 |
OS_OPT = cli_option("-o", "--os-type", dest="os", help="What OS to run", |
797 | 798 |
metavar="<os>", |
798 | 799 |
completion_suggest=OPT_COMPL_ONE_OS) |
799 | 800 |
|
800 | 801 |
OSPARAMS_OPT = cli_option("-O", "--os-parameters", dest="osparams", |
801 |
type="keyval", default={}, |
|
802 |
help="OS parameters") |
|
802 |
type="keyval", default={},
|
|
803 |
help="OS parameters")
|
|
803 | 804 |
|
804 | 805 |
FORCE_VARIANT_OPT = cli_option("--force-variant", dest="force_variant", |
805 | 806 |
action="store_true", default=False, |
... | ... | |
848 | 849 |
SPECS_DISK_SIZE_OPT = cli_option("--specs-disk-size", dest="ispecs_disk_size", |
849 | 850 |
type="keyval", default={}, |
850 | 851 |
help="Disk size specs: list of key=value," |
851 |
" where key is one of min, max, std" |
|
852 |
" where key is one of min, max, std"
|
|
852 | 853 |
" (in MB or using a unit)") |
853 | 854 |
|
854 | 855 |
SPECS_NIC_COUNT_OPT = cli_option("--specs-nic-count", dest="ispecs_nic_count", |
... | ... | |
857 | 858 |
" where key is one of min, max, std") |
858 | 859 |
|
859 | 860 |
IPOLICY_DISK_TEMPLATES = cli_option("--ipolicy-disk-templates", |
860 |
dest="ipolicy_disk_templates", |
|
861 |
type="list", default=None, |
|
862 |
help="Comma-separated list of" |
|
863 |
" enabled disk templates") |
|
861 |
dest="ipolicy_disk_templates",
|
|
862 |
type="list", default=None,
|
|
863 |
help="Comma-separated list of"
|
|
864 |
" enabled disk templates")
|
|
864 | 865 |
|
865 | 866 |
IPOLICY_VCPU_RATIO = cli_option("--ipolicy-vcpu-ratio", |
866 | 867 |
dest="ipolicy_vcpu_ratio", |
... | ... | |
1087 | 1088 |
" (excluded from allocation operations)")) |
1088 | 1089 |
|
1089 | 1090 |
CAPAB_MASTER_OPT = cli_option("--master-capable", dest="master_capable", |
1090 |
type="bool", default=None, metavar=_YORNO, |
|
1091 |
help="Set the master_capable flag on the node") |
|
1091 |
type="bool", default=None, metavar=_YORNO,
|
|
1092 |
help="Set the master_capable flag on the node")
|
|
1092 | 1093 |
|
1093 | 1094 |
CAPAB_VM_OPT = cli_option("--vm-capable", dest="vm_capable", |
1094 |
type="bool", default=None, metavar=_YORNO, |
|
1095 |
help="Set the vm_capable flag on the node") |
|
1095 |
type="bool", default=None, metavar=_YORNO,
|
|
1096 |
help="Set the vm_capable flag on the node")
|
|
1096 | 1097 |
|
1097 | 1098 |
ALLOCATABLE_OPT = cli_option("--allocatable", dest="allocatable", |
1098 | 1099 |
type="bool", default=None, metavar=_YORNO, |
... | ... | |
1149 | 1150 |
default=None) |
1150 | 1151 |
|
1151 | 1152 |
USE_EXTERNAL_MIP_SCRIPT = cli_option("--use-external-mip-script", |
1152 |
dest="use_external_mip_script", |
|
1153 |
help="Specify whether to run a user-provided" |
|
1154 |
" script for the master IP address turnup and" |
|
1155 |
" turndown operations", |
|
1156 |
type="bool", metavar=_YORNO, default=None) |
|
1153 |
dest="use_external_mip_script", |
|
1154 |
help="Specify whether to run a" |
|
1155 |
" user-provided script for the master" |
|
1156 |
" IP address turnup and" |
|
1157 |
" turndown operations", |
|
1158 |
type="bool", metavar=_YORNO, default=None) |
|
1157 | 1159 |
|
1158 | 1160 |
GLOBAL_FILEDIR_OPT = cli_option("--file-storage-dir", dest="file_storage_dir", |
1159 | 1161 |
help="Specify the default directory (cluster-" |
... | ... | |
1162 | 1164 |
metavar="DIR", |
1163 | 1165 |
default=constants.DEFAULT_FILE_STORAGE_DIR) |
1164 | 1166 |
|
1165 |
GLOBAL_SHARED_FILEDIR_OPT = cli_option("--shared-file-storage-dir", |
|
1166 |
dest="shared_file_storage_dir", |
|
1167 |
help="Specify the default directory (cluster-" |
|
1168 |
"wide) for storing the shared file-based" |
|
1169 |
" disks [%s]" % |
|
1170 |
constants.DEFAULT_SHARED_FILE_STORAGE_DIR, |
|
1171 |
metavar="SHAREDDIR", |
|
1172 |
default=constants.DEFAULT_SHARED_FILE_STORAGE_DIR) |
|
1167 |
GLOBAL_SHARED_FILEDIR_OPT = cli_option( |
|
1168 |
"--shared-file-storage-dir", |
|
1169 |
dest="shared_file_storage_dir", |
|
1170 |
help="Specify the default directory (cluster-wide) for storing the" |
|
1171 |
" shared file-based disks [%s]" % |
|
1172 |
constants.DEFAULT_SHARED_FILE_STORAGE_DIR, |
|
1173 |
metavar="SHAREDDIR", default=constants.DEFAULT_SHARED_FILE_STORAGE_DIR) |
|
1173 | 1174 |
|
1174 | 1175 |
NOMODIFY_ETCHOSTS_OPT = cli_option("--no-etc-hosts", dest="modify_etc_hosts", |
1175 | 1176 |
help="Don't modify /etc/hosts", |
... | ... | |
1207 | 1208 |
help="Maximum time to wait") |
1208 | 1209 |
|
1209 | 1210 |
SHUTDOWN_TIMEOUT_OPT = cli_option("--shutdown-timeout", |
1210 |
dest="shutdown_timeout", type="int", |
|
1211 |
default=constants.DEFAULT_SHUTDOWN_TIMEOUT, |
|
1212 |
help="Maximum time to wait for instance shutdown") |
|
1211 |
dest="shutdown_timeout", type="int", |
|
1212 |
default=constants.DEFAULT_SHUTDOWN_TIMEOUT, |
|
1213 |
help="Maximum time to wait for instance" |
|
1214 |
" shutdown") |
|
1213 | 1215 |
|
1214 | 1216 |
INTERVAL_OPT = cli_option("--interval", dest="interval", type="int", |
1215 | 1217 |
default=None, |
... | ... | |
1237 | 1239 |
" certificate")) |
1238 | 1240 |
|
1239 | 1241 |
SPICE_CERT_OPT = cli_option("--spice-certificate", dest="spice_cert", |
1240 |
default=None, |
|
1241 |
help="File containing new SPICE certificate") |
|
1242 |
default=None,
|
|
1243 |
help="File containing new SPICE certificate")
|
|
1242 | 1244 |
|
1243 | 1245 |
SPICE_CACERT_OPT = cli_option("--spice-ca-certificate", dest="spice_cacert", |
1244 |
default=None, |
|
1245 |
help="File containing the certificate of the CA" |
|
1246 |
" which signed the SPICE certificate")
|
|
1246 |
default=None,
|
|
1247 |
help="File containing the certificate of the CA"
|
|
1248 |
" which signed the SPICE certificate") |
|
1247 | 1249 |
|
1248 | 1250 |
NEW_SPICE_CERT_OPT = cli_option("--new-spice-certificate", |
1249 |
dest="new_spice_cert", default=None, |
|
1250 |
action="store_true", |
|
1251 |
help=("Generate a new self-signed SPICE" |
|
1252 |
" certificate")) |
|
1251 |
dest="new_spice_cert", default=None,
|
|
1252 |
action="store_true",
|
|
1253 |
help=("Generate a new self-signed SPICE"
|
|
1254 |
" certificate"))
|
|
1253 | 1255 |
|
1254 | 1256 |
NEW_CONFD_HMAC_KEY_OPT = cli_option("--new-confd-hmac-key", |
1255 | 1257 |
dest="new_confd_hmac_key", |
... | ... | |
1307 | 1309 |
" removed from the user-id pool")) |
1308 | 1310 |
|
1309 | 1311 |
RESERVED_LVS_OPT = cli_option("--reserved-lvs", default=None, |
1310 |
action="store", dest="reserved_lvs", |
|
1311 |
help=("A comma-separated list of reserved" |
|
1312 |
" logical volumes names, that will be" |
|
1313 |
" ignored by cluster verify")) |
|
1312 |
action="store", dest="reserved_lvs",
|
|
1313 |
help=("A comma-separated list of reserved"
|
|
1314 |
" logical volumes names, that will be"
|
|
1315 |
" ignored by cluster verify"))
|
|
1314 | 1316 |
|
1315 | 1317 |
ROMAN_OPT = cli_option("--roman", |
1316 | 1318 |
dest="roman_integers", default=False, |
... | ... | |
1365 | 1367 |
help="Specify if the SoR for node is powered") |
1366 | 1368 |
|
1367 | 1369 |
OOB_TIMEOUT_OPT = cli_option("--oob-timeout", dest="oob_timeout", type="int", |
1368 |
default=constants.OOB_TIMEOUT, |
|
1369 |
help="Maximum time to wait for out-of-band helper") |
|
1370 |
default=constants.OOB_TIMEOUT,
|
|
1371 |
help="Maximum time to wait for out-of-band helper")
|
|
1370 | 1372 |
|
1371 | 1373 |
POWER_DELAY_OPT = cli_option("--power-delay", dest="power_delay", type="float", |
1372 | 1374 |
default=constants.OOB_POWER_DELAY, |
... | ... | |
2143 | 2145 |
elif isinstance(err, errors.OpPrereqError): |
2144 | 2146 |
if len(err.args) == 2: |
2145 | 2147 |
obuf.write("Failure: prerequisites not met for this" |
2146 |
" operation:\nerror type: %s, error details:\n%s" % |
|
2148 |
" operation:\nerror type: %s, error details:\n%s" %
|
|
2147 | 2149 |
(err.args[1], err.args[0])) |
2148 | 2150 |
else: |
2149 | 2151 |
obuf.write("Failure: prerequisites not met for this" |
Also available in: Unified diff