|
|
|
|
|
|
|
|
|
|
|
check_unit(option,
opt,
value)
OptParsers custom converter for units. |
source code
|
|
dict
|
|
tuple
|
|
|
|
|
|
|
|
list of dictionary
|
|
|
|
|
check_list(option,
opt,
value)
Custom parser for comma-separated lists. |
source code
|
|
|
check_maybefloat(option,
opt,
value)
Custom parser for float numbers which might be also defaults. |
source code
|
|
|
_PriorityOptionCb(option,
_,
value,
parser)
Callback for processing --priority option. |
source code
|
|
|
_ParseArgs(binary,
argv,
commands,
aliases,
env_override)
Parser for the command line arguments. |
source code
|
|
|
|
|
|
|
SplitNodeOption(value)
Splits the value of a --node option. |
source code
|
|
list
|
|
|
|
|
|
|
|
|
SendJob(ops,
cl=None)
Function to submit an opcode without waiting for the results. |
source code
|
|
|
|
|
FormatLogMessage(log_type,
log_msg)
Formats a job message according to its type. |
source code
|
|
|
PollJob(job_id,
cl=None,
feedback_fn=None,
reporter=None)
Function to poll for the result of a job. |
source code
|
|
|
SubmitOpCode(op,
cl=None,
feedback_fn=None,
opts=None,
reporter=None)
Legacy function to submit an opcode. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
GenericMain(commands,
override=None,
aliases=None,
env_override=frozenset())
Generic main function for all the gnt-* commands. |
source code
|
|
|
ParseNicOption(optvalue)
Parses the value of the --net option(s). |
source code
|
|
|
|
int
|
|
|
|
|
GenerateTable(headers,
fields,
separator,
data,
numfields=None,
unitfields=None,
units=None)
Prints a table with headers and different fields. |
source code
|
|
|
_FormatBool(value)
Formats a boolean value as a string. |
source code
|
|
tuple; (callable, bool)
|
|
|
|
|
|
|
|
|
|
|
GenericList(resource,
fields,
names,
unit,
separator,
header,
cl=None,
format_override=None,
verbose=False,
force_filter=False,
namefield=None,
qfilter=None,
isnumeric=False)
Generic implementation for listing all items of a resource. |
source code
|
|
list
|
|
|
|
|
_GetColFormatString(width,
align_right)
Returns the format string for a field. |
source code
|
|
|
|
string
|
|
|
|
|
GetOnlineNodes(nodes,
cl=None,
nowarn=False,
secondary_ips=False,
filter_master=False,
nodegroup=None)
Returns the names of online nodes. |
source code
|
|
|
|
|
|
|
|
dict
|
|
|
|
list of pairs
|
|
|
|
|
|
boolean
|
|
|
_MaybeParseUnit(elements)
Parses and returns an array of potential values with units. |
source code
|
|
|
_InitISpecsFromSplitOpts(ipolicy,
ispecs_mem_size,
ispecs_cpu_count,
ispecs_disk_count,
ispecs_disk_size,
ispecs_nic_count,
group_ipolicy,
fill_all) |
source code
|
|
|
|
|
|
|
_GetISpecsInAllowedValues(minmax_ispecs,
allowed_values) |
source code
|
|
|
_InitISpecsFromFullOpts(ipolicy_out,
minmax_ispecs,
std_ispecs,
group_ipolicy,
allowed_values) |
source code
|
|
|
CreateIPolicyFromOpts(ispecs_mem_size=None,
ispecs_cpu_count=None,
ispecs_disk_count=None,
ispecs_disk_size=None,
ispecs_nic_count=None,
minmax_ispecs=None,
std_ispecs=None,
ipolicy_disk_templates=None,
ipolicy_vcpu_ratio=None,
ipolicy_spindle_ratio=None,
group_ipolicy=False,
allowed_values=None,
fill_all=False)
Creation of instance policy based on command line options. |
source code
|
|
|
|
|
|
|
NO_PREFIX = "no_"
|
|
UN_PREFIX = "-"
|
|
_PRIORITY_NAMES = [("low", constants.OP_PRIO_LOW), ("normal", ...
Priorities (sorted)
|
|
_PRIONAME_TO_VALUE = dict(_PRIORITY_NAMES)
Priority dictionary for easier lookup
|
|
_CHOOSE_BATCH = 25
Maximum batch size for ChooseJob
|
|
TISPECS_GROUP_TYPES = {constants.ISPECS_MIN: constants.VTYPE_I...
|
|
TISPECS_CLUSTER_TYPES = {constants.ISPECS_MIN: constants.VTYPE...
|
|
_QFT_NAMES = {constants.QFT_UNKNOWN: "Unknown", constants.QFT_...
User-friendly names for query2 field types
|
|
ARGS_NONE = []
|
|
ARGS_MANY_INSTANCES = [ArgInstance()]
|
|
ARGS_MANY_NETWORKS = [ArgNetwork()]
|
|
ARGS_MANY_NODES = [ArgNode()]
|
|
ARGS_MANY_GROUPS = [ArgGroup()]
|
|
ARGS_ONE_INSTANCE = [ArgInstance(min= 1, max= 1)]
|
|
ARGS_ONE_NETWORK = [ArgNetwork(min= 1, max= 1)]
|
|
ARGS_ONE_NODE = [ArgNode(min= 1, max= 1)]
|
|
ARGS_ONE_GROUP = [ArgGroup(min= 1, max= 1)]
|
|
ARGS_ONE_OS = [ArgOs(min= 1, max= 1)]
|
|
OPT_COMPL_ALL = compat.UniqueFrozenset([OPT_COMPL_MANY_NODES, ...
|
|
_YORNO = "yes|no"
|
|
DEBUG_OPT = cli_option("-d", "--debug", default= 0, action= "c...
|
|
NOHDR_OPT = cli_option("--no-headers", default= False, action=...
|
|
SEP_OPT = cli_option("--separator", default= None, action= "st...
|
|
USEUNITS_OPT = cli_option("--units", default= None, dest= "uni...
|
|
FIELDS_OPT = cli_option("-o", "--output", dest= "output", acti...
|
|
FORCE_OPT = cli_option("-f", "--force", dest= "force", action=...
|
|
CONFIRM_OPT = cli_option("--yes", dest= "confirm", action= "st...
|
|
IGNORE_OFFLINE_OPT = cli_option("--ignore-offline", dest= "ign...
|
|
TAG_ADD_OPT = cli_option("--tags", dest= "tags", default= None...
|
|
TAG_SRC_OPT = cli_option("--from", dest= "tags_source", defaul...
|
|
SUBMIT_OPT = cli_option("--submit", dest= "submit_only", defau...
|
|
SYNC_OPT = cli_option("--sync", dest= "do_locking", default= F...
|
|
DRY_RUN_OPT = cli_option("--dry-run", default= False, action= ...
|
|
VERBOSE_OPT = cli_option("-v", "--verbose", default= False, ac...
|
|
DEBUG_SIMERR_OPT = cli_option("--debug-simulate-errors", defau...
|
|
NWSYNC_OPT = cli_option("--no-wait-for-sync", dest= "wait_for_...
|
|
WFSYNC_OPT = cli_option("--wait-for-sync", dest= "wait_for_syn...
|
|
ONLINE_INST_OPT = cli_option("--online", dest= "online_inst", ...
|
|
OFFLINE_INST_OPT = cli_option("--offline", dest= "offline_inst...
|
|
DISK_TEMPLATE_OPT = cli_option("-t", "--disk-template", dest= ...
|
|
NONICS_OPT = cli_option("--no-nics", default= False, action= "...
|
|
FILESTORE_DIR_OPT = cli_option("--file-storage-dir", dest= "fi...
|
|
FILESTORE_DRIVER_OPT = cli_option("--file-driver", dest= "file...
|
|
IALLOCATOR_OPT = cli_option("-I", "--iallocator", metavar= "<N...
|
|
DEFAULT_IALLOCATOR_OPT = cli_option("-I", "--default-iallocato...
|
|
OS_OPT = cli_option("-o", "--os-type", dest= "os", help= "What...
|
|
OSPARAMS_OPT = cli_option("-O", "--os-parameters", dest= "ospa...
|
|
FORCE_VARIANT_OPT = cli_option("--force-variant", dest= "force...
|
|
NO_INSTALL_OPT = cli_option("--no-install", dest= "no_install"...
|
|
NORUNTIME_CHGS_OPT = cli_option("--no-runtime-changes", dest= ...
|
|
BACKEND_OPT = cli_option("-B", "--backend-parameters", dest= "...
|
|
HVOPTS_OPT = cli_option("-H", "--hypervisor-parameters", type=...
|
|
DISK_PARAMS_OPT = cli_option("-D", "--disk-parameters", dest= ...
|
|
SPECS_MEM_SIZE_OPT = cli_option("--specs-mem-size", dest= "isp...
|
|
SPECS_CPU_COUNT_OPT = cli_option("--specs-cpu-count", dest= "i...
|
|
SPECS_DISK_COUNT_OPT = cli_option("--specs-disk-count", dest= ...
|
|
SPECS_DISK_SIZE_OPT = cli_option("--specs-disk-size", dest= "i...
|
|
SPECS_NIC_COUNT_OPT = cli_option("--specs-nic-count", dest= "i...
|
|
IPOLICY_BOUNDS_SPECS_STR = "--ipolicy-bounds-specs"
|
|
IPOLICY_BOUNDS_SPECS_OPT = cli_option(IPOLICY_BOUNDS_SPECS_STR...
|
|
IPOLICY_STD_SPECS_STR = "--ipolicy-std-specs"
|
|
IPOLICY_STD_SPECS_OPT = cli_option(IPOLICY_STD_SPECS_STR, dest...
|
|
IPOLICY_DISK_TEMPLATES = cli_option("--ipolicy-disk-templates"...
|
|
IPOLICY_VCPU_RATIO = cli_option("--ipolicy-vcpu-ratio", dest= ...
|
|
IPOLICY_SPINDLE_RATIO = cli_option("--ipolicy-spindle-ratio", ...
|
|
HYPERVISOR_OPT = cli_option("-H", "--hypervisor-parameters", d...
|
|
HVLIST_OPT = cli_option("-H", "--hypervisor-parameters", dest=...
|
|
NOIPCHECK_OPT = cli_option("--no-ip-check", dest= "ip_check", ...
|
|
NONAMECHECK_OPT = cli_option("--no-name-check", dest= "name_ch...
|
|
NET_OPT = cli_option("--net", help= "NIC parameters", default=...
|
|
DISK_OPT = cli_option("--disk", help= "Disk parameters", defau...
|
|
DISKIDX_OPT = cli_option("--disks", dest= "disks", default= No...
|
|
OS_SIZE_OPT = cli_option("-s", "--os-size", dest= "sd_size", h...
|
|
IGNORE_CONSIST_OPT = cli_option("--ignore-consistency", dest= ...
|
|
ALLOW_FAILOVER_OPT = cli_option("--allow-failover", dest= "all...
|
|
NONLIVE_OPT = cli_option("--non-live", dest= "live", default= ...
|
|
MIGRATION_MODE_OPT = cli_option("--migration-mode", dest= "mig...
|
|
NODE_PLACEMENT_OPT = cli_option("-n", "--node", dest= "node", ...
|
|
NODE_LIST_OPT = cli_option("-n", "--node", dest= "nodes", defa...
|
|
NODEGROUP_OPT_NAME = "--node-group"
|
|
NODEGROUP_OPT = cli_option("-g", NODEGROUP_OPT_NAME, dest= "no...
|
|
SINGLE_NODE_OPT = cli_option("-n", "--node", dest= "node", hel...
|
|
NOSTART_OPT = cli_option("--no-start", dest= "start", default=...
|
|
SHOWCMD_OPT = cli_option("--show-cmd", dest= "show_command", a...
|
|
CLEANUP_OPT = cli_option("--cleanup", dest= "cleanup", default...
|
|
STATIC_OPT = cli_option("-s", "--static", dest= "static", acti...
|
|
ALL_OPT = cli_option("--all", dest= "show_all", default= False...
|
|
SELECT_OS_OPT = cli_option("--select-os", dest= "select_os", a...
|
|
IGNORE_FAILURES_OPT = cli_option("--ignore-failures", dest= "i...
|
|
IGNORE_REMOVE_FAILURES_OPT = cli_option("--ignore-remove-failu...
|
|
REMOVE_INSTANCE_OPT = cli_option("--remove-instance", dest= "r...
|
|
DST_NODE_OPT = cli_option("-n", "--target-node", dest= "dst_no...
|
|
NEW_SECONDARY_OPT = cli_option("-n", "--new-secondary", dest= ...
|
|
NEW_PRIMARY_OPT = cli_option("--new-primary", dest= "new_prima...
|
|
ON_PRIMARY_OPT = cli_option("-p", "--on-primary", dest= "on_pr...
|
|
ON_SECONDARY_OPT = cli_option("-s", "--on-secondary", dest= "o...
|
|
AUTO_PROMOTE_OPT = cli_option("--auto-promote", dest= "auto_pr...
|
|
AUTO_REPLACE_OPT = cli_option("-a", "--auto", dest= "auto", de...
|
|
IGNORE_SIZE_OPT = cli_option("--ignore-size", dest= "ignore_si...
|
|
SRC_NODE_OPT = cli_option("--src-node", dest= "src_node", help...
|
|
SRC_DIR_OPT = cli_option("--src-dir", dest= "src_dir", help= "...
|
|
SECONDARY_IP_OPT = cli_option("-s", "--secondary-ip", dest= "s...
|
|
READD_OPT = cli_option("--readd", dest= "readd", default= Fals...
|
|
NOSSH_KEYCHECK_OPT = cli_option("--no-ssh-key-check", dest= "s...
|
|
NODE_FORCE_JOIN_OPT = cli_option("--force-join", dest= "force_...
|
|
MC_OPT = cli_option("-C", "--master-candidate", dest= "master_...
|
|
OFFLINE_OPT = cli_option("-O", "--offline", dest= "offline", m...
|
|
DRAINED_OPT = cli_option("-D", "--drained", dest= "drained", m...
|
|
CAPAB_MASTER_OPT = cli_option("--master-capable", dest= "maste...
|
|
CAPAB_VM_OPT = cli_option("--vm-capable", dest= "vm_capable", ...
|
|
ALLOCATABLE_OPT = cli_option("--allocatable", dest= "allocatab...
|
|
NOLVM_STORAGE_OPT = cli_option("--no-lvm-storage", dest= "lvm_...
|
|
ENABLED_HV_OPT = cli_option("--enabled-hypervisors", dest= "en...
|
|
ENABLED_DISK_TEMPLATES_OPT = cli_option("--enabled-disk-templa...
|
|
NIC_PARAMS_OPT = cli_option("-N", "--nic-parameters", dest= "n...
|
|
CP_SIZE_OPT = cli_option("-C", "--candidate-pool-size", defaul...
|
|
VG_NAME_OPT = cli_option("--vg-name", dest= "vg_name", help= (...
|
|
YES_DOIT_OPT = cli_option("--yes-do-it", "--ya-rly", dest= "ye...
|
|
NOVOTING_OPT = cli_option("--no-voting", dest= "no_voting", he...
|
|
MAC_PREFIX_OPT = cli_option("-m", "--mac-prefix", dest= "mac_p...
|
|
MASTER_NETDEV_OPT = cli_option("--master-netdev", dest= "maste...
|
|
MASTER_NETMASK_OPT = cli_option("--master-netmask", dest= "mas...
|
|
USE_EXTERNAL_MIP_SCRIPT = cli_option("--use-external-mip-scrip...
|
|
GLOBAL_FILEDIR_OPT = cli_option("--file-storage-dir", dest= "f...
|
|
GLOBAL_SHARED_FILEDIR_OPT = cli_option("--shared-file-storage-...
|
|
NOMODIFY_ETCHOSTS_OPT = cli_option("--no-etc-hosts", dest= "mo...
|
|
MODIFY_ETCHOSTS_OPT = cli_option("--modify-etc-hosts", dest= "...
|
|
NOMODIFY_SSH_SETUP_OPT = cli_option("--no-ssh-init", dest= "mo...
|
|
ERROR_CODES_OPT = cli_option("--error-codes", dest= "error_cod...
|
|
NONPLUS1_OPT = cli_option("--no-nplus1-mem", dest= "skip_nplus...
|
|
REBOOT_TYPE_OPT = cli_option("-t", "--type", dest= "reboot_typ...
|
|
IGNORE_SECONDARIES_OPT = cli_option("--ignore-secondaries", de...
|
|
NOSHUTDOWN_OPT = cli_option("--noshutdown", dest= "shutdown", ...
|
|
TIMEOUT_OPT = cli_option("--timeout", dest= "timeout", type= "...
|
|
SHUTDOWN_TIMEOUT_OPT = cli_option("--shutdown-timeout", dest= ...
|
|
INTERVAL_OPT = cli_option("--interval", dest= "interval", type...
|
|
EARLY_RELEASE_OPT = cli_option("--early-release", dest= "early...
|
|
NEW_CLUSTER_CERT_OPT = cli_option("--new-cluster-certificate",...
|
|
RAPI_CERT_OPT = cli_option("--rapi-certificate", dest= "rapi_c...
|
|
NEW_RAPI_CERT_OPT = cli_option("--new-rapi-certificate", dest=...
|
|
SPICE_CERT_OPT = cli_option("--spice-certificate", dest= "spic...
|
|
SPICE_CACERT_OPT = cli_option("--spice-ca-certificate", dest= ...
|
|
NEW_SPICE_CERT_OPT = cli_option("--new-spice-certificate", des...
|
|
NEW_CONFD_HMAC_KEY_OPT = cli_option("--new-confd-hmac-key", de...
|
|
CLUSTER_DOMAIN_SECRET_OPT = cli_option("--cluster-domain-secre...
|
|
NEW_CLUSTER_DOMAIN_SECRET_OPT = cli_option("--new-cluster-doma...
|
|
USE_REPL_NET_OPT = cli_option("--use-replication-network", des...
|
|
MAINTAIN_NODE_HEALTH_OPT = cli_option("--maintain-node-health"...
|
|
IDENTIFY_DEFAULTS_OPT = cli_option("--identify-defaults", dest...
|
|
UIDPOOL_OPT = cli_option("--uid-pool", default= None, action= ...
|
|
ADD_UIDS_OPT = cli_option("--add-uids", default= None, action=...
|
|
REMOVE_UIDS_OPT = cli_option("--remove-uids", default= None, a...
|
|
RESERVED_LVS_OPT = cli_option("--reserved-lvs", default= None,...
|
|
ROMAN_OPT = cli_option("--roman", dest= "roman_integers", defa...
|
|
DRBD_HELPER_OPT = cli_option("--drbd-usermode-helper", dest= "...
|
|
NODRBD_STORAGE_OPT = cli_option("--no-drbd-storage", dest= "dr...
|
|
PRIMARY_IP_VERSION_OPT = cli_option("--primary-ip-version", de...
|
|
SHOW_MACHINE_OPT = cli_option("-M", "--show-machine-names", de...
|
|
FAILURE_ONLY_OPT = cli_option("--failure-only", default= False...
|
|
REASON_OPT = cli_option("--reason", default= None, help= "The ...
|
|
PRIORITY_OPT = cli_option("--priority", default= None, dest= "...
|
|
HID_OS_OPT = cli_option("--hidden", dest= "hidden", type= "boo...
|
|
BLK_OS_OPT = cli_option("--blacklisted", dest= "blacklisted", ...
|
|
PREALLOC_WIPE_DISKS_OPT = cli_option("--prealloc-wipe-disks", ...
|
|
NODE_PARAMS_OPT = cli_option("--node-parameters", dest= "ndpar...
|
|
ALLOC_POLICY_OPT = cli_option("--alloc-policy", dest= "alloc_p...
|
|
NODE_POWERED_OPT = cli_option("--node-powered", default= None,...
|
|
OOB_TIMEOUT_OPT = cli_option("--oob-timeout", dest= "oob_timeo...
|
|
POWER_DELAY_OPT = cli_option("--power-delay", dest= "power_del...
|
|
FORCE_FILTER_OPT = cli_option("-F", "--filter", dest= "force_f...
|
|
NO_REMEMBER_OPT = cli_option("--no-remember", dest= "no_rememb...
|
|
PRIMARY_ONLY_OPT = cli_option("-p", "--primary-only", default=...
|
|
SECONDARY_ONLY_OPT = cli_option("-s", "--secondary-only", defa...
|
|
STARTUP_PAUSED_OPT = cli_option("--paused", dest= "startup_pau...
|
|
TO_GROUP_OPT = cli_option("--to", dest= "to", metavar= "<group...
|
|
IGNORE_ERRORS_OPT = cli_option("-I", "--ignore-errors", defaul...
|
|
DISK_STATE_OPT = cli_option("--disk-state", default= [], dest=...
|
|
HV_STATE_OPT = cli_option("--hypervisor-state", default= [], d...
|
|
IGNORE_IPOLICY_OPT = cli_option("--ignore-ipolicy", dest= "ign...
|
|
RUNTIME_MEM_OPT = cli_option("-m", "--runtime-memory", dest= "...
|
|
ABSOLUTE_OPT = cli_option("--absolute", dest= "absolute", acti...
|
|
NETWORK_OPT = cli_option("--network", action= "store", default...
|
|
GATEWAY_OPT = cli_option("--gateway", action= "store", default...
|
|
ADD_RESERVED_IPS_OPT = cli_option("--add-reserved-ips", action...
|
|
REMOVE_RESERVED_IPS_OPT = cli_option("--remove-reserved-ips", ...
|
|
NETWORK6_OPT = cli_option("--network6", action= "store", defau...
|
|
GATEWAY6_OPT = cli_option("--gateway6", action= "store", defau...
|
|
NOCONFLICTSCHECK_OPT = cli_option("--no-conflicts-check", dest...
|
|
INCLUDEDEFAULTS_OPT = cli_option("--include-defaults", dest= "...
|
|
COMMON_OPTS = [DEBUG_OPT, REASON_OPT]
Options provided by all commands
|
|
COMMON_CREATE_OPTS = [BACKEND_OPT, DISK_OPT, DISK_TEMPLATE_OPT...
|
|
INSTANCE_POLICY_OPTS = [IPOLICY_BOUNDS_SPECS_OPT, IPOLICY_DISK...
|
|
SPLIT_ISPECS_OPTS = [SPECS_CPU_COUNT_OPT, SPECS_DISK_COUNT_OPT...
|
|
_DEFAULT_FORMAT_QUERY = {constants.QFT_TEXT:(str, False), cons...
Default formatting for query results; (callback, align right)
|