_ExtendTags(opts, args)
if not args:
raise errors.OpPrereqError("No tags to be added")
- op = opcodes.OpAddTags(kind=kind, name=name, tags=args)
+ op = opcodes.OpTagsSet(kind=kind, name=name, tags=args)
SubmitOpCode(op, opts=opts)
_ExtendTags(opts, args)
if not args:
raise errors.OpPrereqError("No tags to be removed")
- op = opcodes.OpDelTags(kind=kind, name=name, tags=args)
+ op = opcodes.OpTagsDel(kind=kind, name=name, tags=args)
SubmitOpCode(op, opts=opts)
default=True, action="store_false",
help="Disable SSH key fingerprint checking")
-
MC_OPT = cli_option("-C", "--master-candidate", dest="master_candidate",
type="bool", default=None, metavar=_YORNO,
help="Set the master_candidate flag on the node")
OFFLINE_OPT = cli_option("-O", "--offline", dest="offline", metavar=_YORNO,
type="bool", default=None,
- help="Set the offline flag on the node")
+ help=("Set the offline flag on the node"
+ " (cluster does not communicate with offline"
+ " nodes)"))
DRAINED_OPT = cli_option("-D", "--drained", dest="drained", metavar=_YORNO,
type="bool", default=None,
- help="Set the drained flag on the node")
+ help=("Set the drained flag on the node"
+ " (excluded from allocation operations)"))
CAPAB_MASTER_OPT = cli_option("--master-capable", dest="master_capable",
type="bool", default=None, metavar=_YORNO,
help="Set the candidate pool size")
VG_NAME_OPT = cli_option("--vg-name", dest="vg_name",
- help="Enables LVM and specifies the volume group"
- " name (cluster-wide) for disk allocation [xenvg]",
+ help=("Enables LVM and specifies the volume group"
+ " name (cluster-wide) for disk allocation"
+ " [%s]" % constants.DEFAULT_VG),
metavar="VG", default=None)
YES_DOIT_OPT = cli_option("--yes-do-it", dest="yes_do_it",
# Report status
self._status_fn(status)
- if status == constants.QRFS_NORMAL:
+ if status == constants.RS_NORMAL:
return self._fn(value)
assert value is None, \
"Found value %r for abnormal status %s" % (value, status)
- if status == constants.QRFS_UNKNOWN:
+ if status == constants.RS_UNKNOWN:
return "(unknown)"
- if status == constants.QRFS_NODATA:
+ if status == constants.RS_NODATA:
return "(nodata)"
- if status == constants.QRFS_UNAVAIL:
+ if status == constants.RS_UNAVAIL:
return "(unavail)"
- if status == constants.QRFS_OFFLINE:
+ if status == constants.RS_OFFLINE:
return "(offline)"
raise NotImplementedError("Unknown status %s" % status)
if format_override is None:
format_override = {}
- stats = dict.fromkeys(constants.QRFS_ALL, 0)
+ stats = dict.fromkeys(constants.RS_ALL, 0)
def _RecordStatus(status):
if status in stats:
table = FormatTable(result.data, columns, header, separator)
# Collect statistics
- assert len(stats) == len(constants.QRFS_ALL)
+ assert len(stats) == len(constants.RS_ALL)
assert compat.all(count >= 0 for count in stats.values())
# Determine overall status. If there was no data, unknown fields must be
# detected via the field definitions.
- if (stats[constants.QRFS_UNKNOWN] or
+ if (stats[constants.RS_UNKNOWN] or
(not result.data and _GetUnknownFields(result.fields))):
status = QR_UNKNOWN
elif compat.any(count > 0 for key, count in stats.items()
- if key != constants.QRFS_NORMAL):
+ if key != constants.RS_NORMAL):
status = QR_INCOMPLETE
else:
status = QR_NORMAL