rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
try: self.callback(False) except: logging.error("Unexpected exception", exc_info=True) | self.callback(False) | def process_IN_IGNORED(self, event): # Since we monitor a single file rather than the directory it resides in, # when that file is replaced with another one (which is what happens when # utils.WriteFile, the most normal way of updating files in ganeti, is # called) we're going to receive an IN_IGNORED event from inotif... |
try: self.callback(True) except: logging.error("Unexpected exception", exc_info=True) | self.callback(True) | def process_IN_MODIFY(self, event): # This gets called when the monitored file is modified. Note that this # doesn't usually happen in Ganeti, as most of the time we're just # replacing any file with a new one, at filesystem level, rather than # actually changing it. (see utils.WriteFile) logging.debug("Received 'modif... |
instance_os = self.op.os_name | instance_os = self.op.os_type | def CheckPrereq(self): """Check prerequisites. |
vif_data.append("'%s'" % nic_str) | def _WriteConfigFile(cls, instance, block_devices): """Write the Xen config file for the instance. | |
vif_data.append("'%s'" % nic_str) | def _WriteConfigFile(cls, instance, block_devices): """Create a Xen 3.1 HVM config file. | |
raise CertificateError("SSL issue: %r" % err) | raise CertificateError("SSL issue: %s (%r)" % (err, err)) | def _SendRequest(self, method, path, query, content): """Sends an HTTP request. |
expanded_name = self.cfg.ExpandInstanceName(self.op.instance_name) if expanded_name is None: raise errors.OpPrereqError("Instance '%s' not known" % self.op.instance_name, errors.ECODE_NOENT) self.needed_locks[locking.LEVEL_INSTANCE] = expanded_name self.op.instance_name = expanded_name | self.op.instance_name = _ExpandInstanceName(self.cfg, self.op.instance_name) self.needed_locks[locking.LEVEL_INSTANCE] = self.op.instance_name | def _ExpandAndLockInstance(self): """Helper function to expand and lock an instance. |
node = lu.cfg.ExpandNodeName(name) if node is None: raise errors.OpPrereqError("No such node name '%s'" % name, errors.ECODE_NOENT) | node = _ExpandNodeName(lu.cfg, name) | def _GetWantedNodes(lu, nodes): """Returns list of checked and expanded node names. @type lu: L{LogicalUnit} @param lu: the logical unit on whose behalf we execute @type nodes: list @param nodes: list of node names or None for all nodes @rtype: list @return: the list of nodes, sorted @raise errors.OpProgrammerError: i... |
wanted = [] for name in instances: instance = lu.cfg.ExpandInstanceName(name) if instance is None: raise errors.OpPrereqError("No such instance name '%s'" % name, errors.ECODE_NOENT) wanted.append(instance) | wanted = [_ExpandInstanceName(lu.cfg, name) for name in instances] | def _GetWantedInstances(lu, instances): """Returns list of checked and expanded instance names. @type lu: L{LogicalUnit} @param lu: the logical unit on whose behalf we execute @type instances: list @param instances: list of instance names or None for all instances @rtype: list @return: the list of instances, sorted @r... |
full_name = self.cfg.ExpandInstanceName(name) if full_name is None: raise errors.OpPrereqError("Instance '%s' not known" % name, errors.ECODE_NOENT) | full_name = _ExpandInstanceName(self.cfg, name) | def ExpandNames(self): if not isinstance(self.op.instances, list): raise errors.OpPrereqError("Invalid argument type 'instances'", errors.ECODE_INVAL) |
node = self.cfg.GetNodeInfo(self.cfg.ExpandNodeName(self.op.node_name)) if node is None: raise errors.OpPrereqError("Node '%s' is unknown." % self.op.node_name, errors.ECODE_NOENT) | self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name) node = self.cfg.GetNodeInfo(self.op.node_name) assert node is not None | def CheckPrereq(self): """Check prerequisites. |
node_name = self.cfg.ExpandNodeName(self.op.node_name) if node_name is None: raise errors.OpPrereqError("Invalid node name '%s'" % self.op.node_name, errors.ECODE_NOENT) self.op.node_name = node_name | self.opnode_name = _ExpandNodeName(self.cfg, self.op.node_name) | def CheckArguments(self): node_name = self.cfg.ExpandNodeName(self.op.node_name) if node_name is None: raise errors.OpPrereqError("Invalid node name '%s'" % self.op.node_name, errors.ECODE_NOENT) |
node_name = self.cfg.ExpandNodeName(self.op.node_name) if node_name is None: raise errors.OpPrereqError("Invalid node name '%s'" % self.op.node_name, errors.ECODE_INVAL) self.op.node_name = node_name | self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name) | def CheckArguments(self): node_name = self.cfg.ExpandNodeName(self.op.node_name) if node_name is None: raise errors.OpPrereqError("Invalid node name '%s'" % self.op.node_name, errors.ECODE_INVAL) self.op.node_name = node_name _CheckBooleanOpField(self.op, 'master_candidate') _CheckBooleanOpField(self.op, 'offline') _Ch... |
node_name = self.cfg.ExpandNodeName(self.op.node_name) if node_name is None: raise errors.OpPrereqError("Invalid node name '%s'" % self.op.node_name, errors.ECODE_NOENT) self.op.node_name = node_name if node_name == self.cfg.GetMasterNode() and not self.op.force: | self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name) if self.op.node_name == self.cfg.GetMasterNode() and not self.op.force: | def CheckArguments(self): node_name = self.cfg.ExpandNodeName(self.op.node_name) if node_name is None: raise errors.OpPrereqError("Invalid node name '%s'" % self.op.node_name, errors.ECODE_NOENT) self.op.node_name = node_name if node_name == self.cfg.GetMasterNode() and not self.op.force: raise errors.OpPrereqError("Th... |
pnode = self.cfg.GetNodeInfo( self.cfg.ExpandNodeName(instance.primary_node)) if pnode is None: raise errors.OpPrereqError("Primary node '%s' is unknown" % self.op.pnode, errors.ECODE_NOENT) result = self.rpc.call_os_get(pnode.name, self.op.os_type) | pnode = _ExpandNodeName(self.cfg, instance.primary_node) result = self.rpc.call_os_get(pnode, self.op.os_type) | def CheckPrereq(self): """Check prerequisites. |
(self.op.os_type, pnode.name), | (self.op.os_type, pnode), | def CheckPrereq(self): """Check prerequisites. |
instance = self.cfg.GetInstanceInfo( self.cfg.ExpandInstanceName(self.op.instance_name)) if instance is None: raise errors.OpPrereqError("Instance '%s' not known" % self.op.instance_name, errors.ECODE_NOENT) | self.op.instance_name = _ExpandInstanceName(self.cfg, self.op.instance_name) instance = self.cfg.GetInstanceInfo(self.op.instance_name) assert instance is not None | def CheckPrereq(self): """Check prerequisites. |
target_node = self.cfg.ExpandNodeName(self.op.target_node) if target_node is None: raise errors.OpPrereqError("Node '%s' not known" % self.op.target_node, errors.ECODE_NOENT) | target_node = _ExpandNodeName(self.cfg, self.op.target_node) | def ExpandNames(self): self._ExpandAndLockInstance() target_node = self.cfg.ExpandNodeName(self.op.target_node) if target_node is None: raise errors.OpPrereqError("Node '%s' not known" % self.op.target_node, errors.ECODE_NOENT) self.op.target_node = target_node self.needed_locks[locking.LEVEL_NODE] = [target_node] self... |
self.op.node_name = self.cfg.ExpandNodeName(self.op.node_name) if self.op.node_name is None: raise errors.OpPrereqError("Node '%s' not known" % self.op.node_name, errors.ECODE_NOENT) | self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name) | def ExpandNames(self): self.op.node_name = self.cfg.ExpandNodeName(self.op.node_name) if self.op.node_name is None: raise errors.OpPrereqError("Node '%s' not known" % self.op.node_name, errors.ECODE_NOENT) |
instance = self.cfg.GetInstanceInfo( self.cfg.ExpandInstanceName(self.instance_name)) if instance is None: raise errors.OpPrereqError("Instance '%s' not known" % self.instance_name, errors.ECODE_NOENT) | instance_name = _ExpandInstanceName(self.lu.cfg, self.instance_name) instance = self.cfg.GetInstanceInfo(instance_name) assert instance is not None | def CheckPrereq(self): """Check prerequisites. |
def _ExpandNode(self, node): """Expands and checks one node name. """ node_full = self.cfg.ExpandNodeName(node) if node_full is None: raise errors.OpPrereqError("Unknown node %s" % node, errors.ECODE_NOENT) return node_full | def _ExpandNode(self, node): """Expands and checks one node name. | |
self.op.pnode = self._ExpandNode(self.op.pnode) | self.op.pnode = _ExpandNodeName(self.cfg, self.op.pnode) | def ExpandNames(self): """ExpandNames for CreateInstance. |
self.op.snode = self._ExpandNode(self.op.snode) | self.op.snode = _ExpandNodeName(self.cfg, self.op.snode) | def ExpandNames(self): """ExpandNames for CreateInstance. |
self.op.src_node = src_node = self._ExpandNode(src_node) | self.op.src_node = src_node = _ExpandNodeName(self.cfg, src_node) | def ExpandNames(self): """ExpandNames for CreateInstance. |
remote_node = self.cfg.ExpandNodeName(self.op.remote_node) if remote_node is None: raise errors.OpPrereqError("Node '%s' not known" % self.op.remote_node, errors.ECODE_NOENT) | remote_node = _ExpandNodeName(self.cfg, self.op.remote_node) | def ExpandNames(self): self._ExpandAndLockInstance() |
remote_node = self.cfg.ExpandNodeName(self.op.remote_node) if remote_node is None: raise errors.OpPrereqError("Node '%s' not known" % self.op.remote_node, errors.ECODE_NOENT) self.op.remote_node = remote_node | self.op.remote_node = _ExpandNodeName(self.cfg, self.op.remote_node) | def ExpandNames(self): self.op.node_name = self.cfg.ExpandNodeName(self.op.node_name) if self.op.node_name is None: raise errors.OpPrereqError("Node '%s' not known" % self.op.node_name, errors.ECODE_NOENT) |
self.needed_locks[locking.LEVEL_NODE] = [remote_node] | self.needed_locks[locking.LEVEL_NODE] = [self.op.remote_node] | def ExpandNames(self): self.op.node_name = self.cfg.ExpandNodeName(self.op.node_name) if self.op.node_name is None: raise errors.OpPrereqError("Node '%s' not known" % self.op.node_name, errors.ECODE_NOENT) |
node_name = self.cfg.ExpandNodeName(self.op.node_name) if node_name is None: raise errors.OpPrereqError("Invalid node name '%s'" % self.op.node_name, errors.ECODE_NOENT) self.op.node_name = node_name | self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name) | def CheckArguments(self): node_name = self.cfg.ExpandNodeName(self.op.node_name) if node_name is None: raise errors.OpPrereqError("Invalid node name '%s'" % self.op.node_name, errors.ECODE_NOENT) |
full_name = self.cfg.ExpandInstanceName(name) if full_name is None: raise errors.OpPrereqError("Instance '%s' not known" % name, errors.ECODE_NOENT) | full_name = _ExpandInstanceName(self.cfg, name) | def ExpandNames(self): self.needed_locks = {} self.share_locks = dict.fromkeys(locking.LEVELS, 1) |
self.dst_node = self.cfg.GetNodeInfo( self.cfg.ExpandNodeName(self.op.target_node)) if self.dst_node is None: raise errors.OpPrereqError("Wrong node name %s" % self.op.target_node, errors.ECODE_NOENT) | self.op.target_node = _ExpandNodeName(self.cfg, self.op.target_node) self.dst_node = self.cfg.GetNodeInfo(self.op.target_node) assert self.dst_node is not None | def CheckPrereq(self): """Check prerequisites. |
name = self.cfg.ExpandNodeName(self.op.name) if name is None: raise errors.OpPrereqError("Invalid node name (%s)" % (self.op.name,), errors.ECODE_NOENT) self.op.name = name self.needed_locks[locking.LEVEL_NODE] = name | self.op.name = _ExpandNodeName(self.cfg, self.op.name) self.needed_locks[locking.LEVEL_NODE] = self.op.name | def ExpandNames(self): self.needed_locks = {} if self.op.kind == constants.TAG_NODE: name = self.cfg.ExpandNodeName(self.op.name) if name is None: raise errors.OpPrereqError("Invalid node name (%s)" % (self.op.name,), errors.ECODE_NOENT) self.op.name = name self.needed_locks[locking.LEVEL_NODE] = name elif self.op.kind... |
name = self.cfg.ExpandInstanceName(self.op.name) if name is None: raise errors.OpPrereqError("Invalid instance name (%s)" % (self.op.name,), errors.ECODE_NOENT) self.op.name = name self.needed_locks[locking.LEVEL_INSTANCE] = name | self.op.name = _ExpandInstanceName(self.cfg, self.op.name) self.needed_locks[locking.LEVEL_INSTANCE] = self.op.name | def ExpandNames(self): self.needed_locks = {} if self.op.kind == constants.TAG_NODE: name = self.cfg.ExpandNodeName(self.op.name) if name is None: raise errors.OpPrereqError("Invalid node name (%s)" % (self.op.name,), errors.ECODE_NOENT) self.op.name = name self.needed_locks[locking.LEVEL_NODE] = name elif self.op.kind... |
fname = self.cfg.ExpandInstanceName(self.op.name) if fname is None: raise errors.OpPrereqError("Instance '%s' not found for relocation" % self.op.name, errors.ECODE_NOENT) | fname = _ExpandInstanceName(self.cfg, self.op.name) | def CheckPrereq(self): """Check prerequisites. |
return None | def _TryReadUidFile(cls, uid_file): """Try to read a uid file | |
return None return uid | return None | def _TryReadUidFile(cls, uid_file): """Try to read a uid file |
uuid=utils.NewUUID(), | def InitCluster(cluster_name, mac_prefix, master_netdev, file_storage_dir, candidate_pool_size, secondary_ip=None, vg_name=None, beparams=None, nicparams=None, hvparams=None, enabled_hypervisors=None, modify_etc_hosts=True, modify_ssh_setup=True, maintain_node_health=False, drbd_helper=None, uid_pool=None, default_iall... | |
default_nodegroup = objects.NodeGroup( uuid=uuid_generator.Generate([], utils.NewUUID, _INITCONF_ECID), name="default", members=[master_node_config.name], ) nodegroups = { default_nodegroup.uuid: default_nodegroup, } | def InitConfig(version, cluster_config, master_node_config, cfg_file=constants.CLUSTER_CONF_FILE): """Create the initial cluster configuration. It will contain the current node, which will also be the master node, and no instances. @type version: int @param version: configuration version @type cluster_config: L{objec... | |
The file will be written to L{constants.RUN_GANETI_DIR}I{/name.pid} @type name: str @param name: the daemon name to use @param pid: if passed, will be used instead of getpid() @raise errors.GenericError: if the pid file already exists and | @type pidfile: sting @param pidfile: the path to the file to be written @raise errors.LockError: if the pid file already exists and | def WritePidFile(pidfile): """Write the current process pidfile. The file will be written to L{constants.RUN_GANETI_DIR}I{/name.pid} @type name: str @param name: the daemon name to use @param pid: if passed, will be used instead of getpid() @raise errors.GenericError: if the pid file already exists and points to a li... |
raise errors.OpPrereqError("Either all disks have are adoped or none is", | raise errors.OpPrereqError("Either all disks are adopted or none is", | def CheckArguments(self): """Check arguments. |
def ExpandNames(self): """ExpandNames for CreateInstance. Figure out the right locks for instance creation. """ self.needed_locks = {} | def ExpandNames(self): """ExpandNames for CreateInstance. | |
if self.op.name_check: hostname1 = utils.GetHostInfo(self.op.instance_name) self.op.instance_name = instance_name = hostname1.name self.check_ip = hostname1.ip else: instance_name = self.op.instance_name self.check_ip = None | instance_name = self.op.instance_name | def ExpandNames(self): """ExpandNames for CreateInstance. |
nic_ip = hostname1.ip | nic_ip = self.hostname1.ip | def ExpandNames(self): """ExpandNames for CreateInstance. |
if (self.op.file_driver and not self.op.file_driver in constants.FILE_DRIVER): raise errors.OpPrereqError("Invalid file driver name '%s'" % self.op.file_driver, errors.ECODE_INVAL) if self.op.file_storage_dir and os.path.isabs(self.op.file_storage_dir): raise errors.OpPrereqError("File storage directory path not absol... | def ExpandNames(self): """ExpandNames for CreateInstance. | |
self.op.force_variant = True if self.op.no_install: self.LogInfo("No-installation mode has no effect during import") else: if getattr(self.op, "os_type", None) is None: raise errors.OpPrereqError("No guest OS specified", errors.ECODE_INVAL) self.op.force_variant = getattr(self.op, "force_variant", False) | def ExpandNames(self): """ExpandNames for CreateInstance. | |
logging.debug("Deferring task %r, new priority %s", defer.priority) | logging.debug("Deferring task %r, new priority %s", args, defer.priority) | def run(self): """Main thread function. |
@type beparam: dict @param beparam: the dict to fill | @type beparams: dict @param beparams: the dict to fill | def SimpleFillBE(self, beparams): """Fill a given beparams dict with cluster defaults. |
@type nicparam: dict @param nicparam: the dict to fill | @type nicparams: dict @param nicparams: the dict to fill | def SimpleFillNIC(self, nicparams): """Fill a given nicparams dict with cluster defaults. |
def OSCoreEnv(inst_os, os_params, debug=0): | def OSCoreEnv(os_name, inst_os, os_params, debug=0): | def OSCoreEnv(inst_os, os_params, debug=0): """Calculate the basic environment for an os script. @type inst_os: L{objects.OS} @param inst_os: operating system for which the environment is being built @type os_params: dict @param os_params: the OS parameters @type debug: integer @param debug: debug level (0 or 1, for O... |
variant = inst_os.name.split('+', 1)[1] | variant = os_name.split('+', 1)[1] | def OSCoreEnv(inst_os, os_params, debug=0): """Calculate the basic environment for an os script. @type inst_os: L{objects.OS} @param inst_os: operating system for which the environment is being built @type os_params: dict @param os_params: the OS parameters @type debug: integer @param debug: debug level (0 or 1, for O... |
result = OSCoreEnv(inst_os, instance.osparams, debug=debug) | result = OSCoreEnv(instance.os, inst_os, instance.osparams, debug=debug) | def OSEnvironment(instance, inst_os, debug=0): """Calculate the environment for an os script. @type instance: L{objects.Instance} @param instance: target instance for the os script run @type inst_os: L{objects.OS} @param inst_os: operating system for which the environment is being built @type debug: integer @param deb... |
validate_env = OSCoreEnv(tbv, osparams) | validate_env = OSCoreEnv(osname, tbv, osparams) | def ValidateOS(required, osname, checks, osparams): """Validate the given OS' parameters. @type required: boolean @param required: whether absence of the OS should translate into failure or not @type osname: string @param osname: the OS to be validated @type checks: list @param checks: list of the checks to run (curre... |
return utils.ReadFile("%s/man/%s.sgml" % | return utils.ReadFile("%s/man/%s.rst" % | def _ReadManFile(name): return utils.ReadFile("%s/man/%s.sgml" % (testutils.GetSourceDir(), name)) |
pattern = "<cmdsynopsis>\s*<command>%s</command>" % re.escape(cmd) if not re.findall(pattern, mantext, re.S): | pattern = r"^(\| )?\*\*%s\*\*" % re.escape(cmd) if not re.findall(pattern, mantext, re.DOTALL | re.MULTILINE): | def _CheckManpage(self, script, mantext, commands): missing = [] |
shutil.rmtree(finaldestdir, True) | shutil.rmtree(finaldestdir, ignore_errors=True) | def FinalizeExport(instance, snap_disks): """Write out the export configuration information. @type instance: L{objects.Instance} @param instance: the instance which we export, used for saving configuration @type snap_disks: list of L{objects.Disk} @param snap_disks: list of snapshot block devices, which will be used t... |
if (not os.path.commonprefix([file_storage_dir, base_file_storage_dir]) == | if (os.path.commonprefix([file_storage_dir, base_file_storage_dir]) != | def _TransformFileStorageDir(file_storage_dir): """Checks whether given file_storage_dir is valid. Checks wheter the given file_storage_dir is within the cluster-wide default file_storage_dir stored in SimpleStore. Only paths under that directory are allowed. @type file_storage_dir: str @param file_storage_dir: the p... |
feedback_fn("OS %s already in %s, ignoring", val, desc) | feedback_fn("OS %s already in %s, ignoring" % (val, desc)) | def helper_os(aname, mods, desc): desc += " OS list" lst = getattr(self.cluster, aname) for key, val in mods: if key == constants.DDM_ADD: if val in lst: feedback_fn("OS %s already in %s, ignoring", val, desc) else: lst.append(val) elif key == constants.DDM_REMOVE: if val in lst: lst.remove(val) else: feedback_fn("OS %... |
feedback_fn("OS %s not found in %s, ignoring", val, desc) | feedback_fn("OS %s not found in %s, ignoring" % (val, desc)) | def helper_os(aname, mods, desc): desc += " OS list" lst = getattr(self.cluster, aname) for key, val in mods: if key == constants.DDM_ADD: if val in lst: feedback_fn("OS %s already in %s, ignoring", val, desc) else: lst.append(val) elif key == constants.DDM_REMOVE: if val in lst: lst.remove(val) else: feedback_fn("OS %... |
def ExpandNames(self): | def CheckArguments(self): | def ExpandNames(self): if not isinstance(self.op.instances, list): raise errors.OpPrereqError("Invalid argument type 'instances'", errors.ECODE_INVAL) |
def ExpandNames(self): | def CheckArguments(self): | def ExpandNames(self): if self.op.names: raise errors.OpPrereqError("Selective OS query not supported", errors.ECODE_INVAL) |
def ExpandNames(self): | def CheckArguments(self): | def ExpandNames(self): _CheckOutputFields(static=self._FIELDS_STATIC, dynamic=self._FIELDS_DYNAMIC, selected=self.op.output_fields) |
def ExpandNames(self): self.needed_locks = {} | def CheckArguments(self): | def ExpandNames(self): self.needed_locks = {} |
if self.op.reboot_type not in [constants.INSTANCE_REBOOT_SOFT, constants.INSTANCE_REBOOT_HARD, constants.INSTANCE_REBOOT_FULL]: raise errors.ParameterError("reboot type not in [%s, %s, %s]" % (constants.INSTANCE_REBOOT_SOFT, constants.INSTANCE_REBOOT_HARD, constants.INSTANCE_REBOOT_FULL)) | def ExpandNames(self): if self.op.reboot_type not in [constants.INSTANCE_REBOOT_SOFT, constants.INSTANCE_REBOOT_HARD, constants.INSTANCE_REBOOT_FULL]: raise errors.ParameterError("reboot type not in [%s, %s, %s]" % (constants.INSTANCE_REBOOT_SOFT, constants.INSTANCE_REBOOT_HARD, constants.INSTANCE_REBOOT_FULL)) self._E... | |
if not isinstance(self.op.instances, list): raise errors.OpPrereqError("Invalid argument type 'instances'", errors.ECODE_INVAL) | def ExpandNames(self): self.needed_locks = {} self.share_locks = dict.fromkeys(locking.LEVELS, 1) | |
for status, result, name in self.jobs: | for _, status, result, name in self.jobs: | def WaitOrShow(self, wait): """Wait for job results or only print the job IDs. |
def _GetUpdatedParams(old_params, update_dict): | def _GetUpdatedParams(old_params, update_dict, use_default=True, use_none=False): | def _GetUpdatedParams(old_params, update_dict): """Return the new version of a parameter dictionary. @type old_params: dict @param old_params: old parameters @type update_dict: dict @param update_dict: dict containing new parameter values, or constants.VALUE_DEFAULT to reset the parameter to its default value @rtype: ... |
if val == constants.VALUE_DEFAULT: | if ((use_default and val == constants.VALUE_DEFAULT) or (use_none and val is None)): | def _GetUpdatedParams(old_params, update_dict): """Return the new version of a parameter dictionary. @type old_params: dict @param old_params: old parameters @type update_dict: dict @param update_dict: dict containing new parameter values, or constants.VALUE_DEFAULT to reset the parameter to its default value @rtype: ... |
self._temporary_ids.DropECReservations(ec_id) self._temporary_macs.DropECReservations(ec_id) self._temporary_secrets.DropECReservations(ec_id) | for rm in self._all_rms: rm.DropECReservations(ec_id) | def DropECReservations(self, ec_id): """Drop per-execution-context reservations |
request_version) | data_version) | def POST(self): """Create an instance. |
self._next = max(self._limit, self._next * self._factor) | self._next = min(self._limit, self._next * self._factor) | def __call__(self): """Returns current delay and calculates the next one. |
not_marked = True for op in self.ops: if op.status in constants.OPS_FINALIZED: assert not_marked, "Finalized opcodes found after non-finalized ones" continue op.status = status op.result = result not_marked = False | try: not_marked = True for op in self.ops: if op.status in constants.OPS_FINALIZED: assert not_marked, "Finalized opcodes found after non-finalized ones" continue op.status = status op.result = result not_marked = False finally: self.queue.UpdateJobUnlocked(self) | def MarkUnfinishedOps(self, status, result): """Mark unfinished opcodes with a given status and result. |
queue.CancelJobUnlocked(job) | job.MarkUnfinishedOps(constants.OP_STATUS_CANCELED, "Job canceled by request") | def RunTask(self, job): # pylint: disable-msg=W0221 """Job executor. |
try: job.MarkUnfinishedOps(constants.OP_STATUS_ERROR, "Unclean master daemon shutdown") finally: self.UpdateJobUnlocked(job) | job.MarkUnfinishedOps(constants.OP_STATUS_ERROR, "Unclean master daemon shutdown") | def __init__(self, context): """Constructor for JobQueue. |
self.CancelJobUnlocked(job) | job.MarkUnfinishedOps(constants.OP_STATUS_CANCELED, "Job canceled by request") | def CancelJob(self, job_id): """Cancels a job. |
try: job.MarkUnfinishedOps(constants.OP_STATUS_CANCELING, None) finally: self.UpdateJobUnlocked(job) | job.MarkUnfinishedOps(constants.OP_STATUS_CANCELING, None) | def CancelJob(self, job_id): """Cancels a job. |
@_RequireOpenQueue def CancelJobUnlocked(self, job): """Marks a job as canceled. """ try: job.MarkUnfinishedOps(constants.OP_STATUS_CANCELED, "Job canceled by request") finally: self.UpdateJobUnlocked(job) | def CancelJob(self, job_id): """Cancels a job. | |
""" | """Runs all tests. | def runTests(self): """ |
logging.basicConfig(filename=os.devnull) | _SetupLogging("LOGTOSTDERR" in os.environ) | def runTests(self): """ |
valid = valid and osl and osl[0][1] | valid = bool(valid and osl and osl[0][1]) | def Exec(self, feedback_fn): """Compute the list of OSes. |
elif ask_key: options.extend([ "-oStrictHostKeyChecking=ask", ]) | else: if ask_key: options.append("-oStrictHostKeyChecking=ask") elif strict_host_check: options.append("-oStrictHostKeyChecking=yes") else: options.append("-oStrictHostKeyChecking=no") | def _BuildSshOptions(self, batch, ask_key, use_cluster_key, strict_host_check): """Builds a list with needed SSH options. |
self.dev_path = "/dev/%s/%s" % (self._vg_name, self._lv_name) | self._ValidateName(self._vg_name) self._ValidateName(self._lv_name) self.dev_path = utils.PathJoin("/dev", self._vg_name, self._lv_name) | def __init__(self, unique_id, children, size): """Attaches to a LV device. |
self.dev_path = "/dev/%s/%s" % (self._vg_name, self._lv_name) | self.dev_path = utils.PathJoin("/dev", self._vg_name, self._lv_name) | def Rename(self, new_id): """Rename this logical volume. |
'-p', | def TestClusterBurnin(): """Burnin""" master = qa_config.GetMasterNode() options = qa_config.get('options', {}) disk_template = options.get('burnin-disk-template', 'drbd') parallel = options.get('burnin-in-parallel', False) check_inst = options.get('burnin-check-instances', False) do_rename = options.get('burnin-renam... | |
nic_val = "nic,macaddr=%s,%s" % (nic.mac, nic_model) | nic_val = "nic,vlan=%s,macaddr=%s,%s" % (nic_seq, nic.mac, nic_model) | def _ExecuteKVMRuntime(self, instance, kvm_runtime, incoming=None): """Execute a KVM cmd, after completing it with some last minute data |
kvm_cmd.extend(['-net', 'tap,script=%s' % script]) | kvm_cmd.extend(['-net', 'tap,vlan=%s,script=%s' % (nic_seq, script)]) | def _ExecuteKVMRuntime(self, instance, kvm_runtime, incoming=None): """Execute a KVM cmd, after completing it with some last minute data |
_CheckInstanceDown(self, instance, "cannot change disk template") | def CheckPrereq(self): """Check prerequisites. | |
("default_iallocator", None, ht.TMaybeString), | ("default_iallocator", None, ht.TOr(ht.TString, ht.TNone)), | def Exec(self, feedback_fn): """Rename the cluster. |
current_timeout = poll_timeout() | current_timeout = poll_timeout() * 1000 | def _RunCmdPipe(cmd, env, via_shell, cwd, interactive, timeout, _linger_timeout=constants.CHILD_LINGER_TIMEOUT): """Run a command and return its output. @type cmd: string or list @param cmd: Command to run @type env: dict @param env: The environment to use @type via_shell: bool @param via_shell: if we should run via ... |
lt = linger_timeout() | lt = linger_timeout() * 1000 | def _RunCmdPipe(cmd, env, via_shell, cwd, interactive, timeout, _linger_timeout=constants.CHILD_LINGER_TIMEOUT): """Run a command and return its output. @type cmd: string or list @param cmd: Command to run @type env: dict @param env: The environment to use @type via_shell: bool @param via_shell: if we should run via ... |
if result.failed and force: | if result.failed: | def CleanupInstance(self, instance_name): """Cleanup after a stopped instance |
if os.path.exists(i): | if not os.path.exists(i): | def StartImportExportDaemon(mode, key_name, ca, host, port, instance, ieio, ieioargs): """Starts an import or export daemon. @param mode: Import/output mode @type key_name: string @param key_name: RSA key name (None to use cluster certificate) @type ca: string: @param ca: Remote CA in PEM format (None to use cluster c... |
self.opnode_name = _ExpandNodeName(self.cfg, self.op.node_name) | self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name) | def CheckArguments(self): self.opnode_name = _ExpandNodeName(self.cfg, self.op.node_name) |
def SubmitOpCode(op, cl=None, feedback_fn=None): | def SubmitOpCode(op, cl=None, feedback_fn=None, opts=None): | def SubmitOpCode(op, cl=None, feedback_fn=None): """Legacy function to submit an opcode. This is just a simple wrapper over the construction of the processor instance. It should be extended to better handle feedback and interaction functions. """ if cl is None: cl = GetClient() job_id = SendJob([op], cl) op_results... |
It will also add the dry-run parameter from the options passed, if true. """ if opts and opts.dry_run: op.dry_run = opts.dry_run | It will also process the opcodes if we're sending the via SendJob (otherwise SubmitOpCode does it). """ | def SubmitOrSend(op, opts, cl=None, feedback_fn=None): """Wrapper around SubmitOpCode or SendJob. This function will decide, based on the 'opts' parameter, whether to submit and wait for the result of the opcode (and return it), or whether to just send the job and print its identifier. It is used in order to simplify ... |
job_id = SendJob([op], cl=cl) | job = [op] SetGenericOpcodeOpts(job, opts) job_id = SendJob(job, cl=cl) | def SubmitOrSend(op, opts, cl=None, feedback_fn=None): """Wrapper around SubmitOpCode or SendJob. This function will decide, based on the 'opts' parameter, whether to submit and wait for the result of the opcode (and return it), or whether to just send the job and print its identifier. It is used in order to simplify ... |
return SubmitOpCode(op, cl=cl, feedback_fn=feedback_fn) | return SubmitOpCode(op, cl=cl, feedback_fn=feedback_fn, opts=opts) def SetGenericOpcodeOpts(opcode_list, options): """Processor for generic options. This function updates the given opcodes based on generic command line options (like debug, dry-run, etc.). @param opcode_list: list of opcodes @param options: command ... | def SubmitOrSend(op, opts, cl=None, feedback_fn=None): """Wrapper around SubmitOpCode or SendJob. This function will decide, based on the 'opts' parameter, whether to submit and wait for the result of the opcode (and return it), or whether to just send the job and print its identifier. It is used in order to simplify ... |
continue disks = node_disks[nname] msg = nres.fail_msg _ErrorIf(msg, self.ENODERPC, nname, "while getting disk information: %s", nres.fail_msg) if msg: | def _CollectDiskInfo(self, nodelist, node_image, instanceinfo): """Gets per-disk status information for all instances. | |
data = len(disks) * [None] | data = len(disks) * [(False, "node offline")] | def _CollectDiskInfo(self, nodelist, node_image, instanceinfo): """Gets per-disk status information for all instances. |
data = nres.payload | msg = nres.fail_msg _ErrorIf(msg, self.ENODERPC, nname, "while getting disk information: %s", msg) if msg: data = len(disks) * [(False, msg)] else: data = [] for idx, i in enumerate(nres.payload): if isinstance(i, (tuple, list)) and len(i) == 2: data.append(i) else: logging.warning("Invalid result from node %s, entry ... | def _CollectDiskInfo(self, nodelist, node_image, instanceinfo): """Gets per-disk status information for all instances. |
len(nnames) <= len(instanceinfo[inst].all_nodes) | len(nnames) <= len(instanceinfo[inst].all_nodes) and compat.all(isinstance(s, (tuple, list)) and len(s) == 2 for s in statuses) | def _CollectDiskInfo(self, nodelist, node_image, instanceinfo): """Gets per-disk status information for all instances. |
"""Formats the fingerprint of L{paramiko.PKey.get_fingerprint()} | """Format paramiko PKey fingerprint. | def FormatParamikoFingerprint(fingerprint): """Formats the fingerprint of L{paramiko.PKey.get_fingerprint()} @type fingerprint: str @param fingerprint: PKey fingerprint @return The string hex representation of the fingerprint """ assert len(fingerprint) % 2 == 0 return ":".join(re.findall(r"..", fingerprint.lower()))... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.