bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def CheckPrereq(self): """Check prerequisites.
def CheckPrereq(self): """Check prerequisites.
449,800
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...
def ExpandNames(self): self.needed_locks = {} if self.op.kind == constants.TAG_NODE: self.op.name = _ExpandNodeName(self.cfg, self.op.name) self.needed_locks[locking.LEVEL_NODE] = self.op.name elif self.op.kind == constants.TAG_INSTANCE: name = self.cfg.ExpandInstanceName(self.op.name) if name is None: raise errors.OpP...
449,801
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...
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...
449,802
def CheckPrereq(self): """Check prerequisites.
def CheckPrereq(self): """Check prerequisites.
449,803
def _TryReadUidFile(cls, uid_file): """Try to read a uid file
def _TryReadUidFile(cls, uid_file): """Try to read a uid file
449,804
def _TryReadUidFile(cls, uid_file): """Try to read a uid file
def _TryReadUidFile(cls, uid_file): """Try to read a uid file
449,805
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...
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...
449,806
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...
defdefault_nodegroup = objects.NodeGroup( uuid=uuid_generator.Generate([], utils.NewUUID, _INITCONF_ECID), name="default", members=[master_node_config.name], ) nodegroups = { default_nodegroup.uuid: default_nodegroup, } InitConfig(version,default_nodegroup = objects.NodeGroup( uuid=uuid_generator.Generate([], utils.New...
449,807
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...
def WritePidFile(pidfile): """Write the current process pidfile. @type pidfile: sting @param pidfile: the path to the file to be written @raise errors.LockError: if the pid file already exists and points to a live process """ # We don't rename nor truncate the file to not drop locks under # existing processes fd_pidf...
449,808
def CheckArguments(self): """Check arguments.
def CheckArguments(self): """Check arguments.
449,809
def ExpandNames(self): """ExpandNames for CreateInstance.
def ExpandNames(self): """ExpandNames for CreateInstance.
449,810
def ExpandNames(self): """ExpandNames for CreateInstance.
def ExpandNames(self): """ExpandNames for CreateInstance.
449,811
def ExpandNames(self): """ExpandNames for CreateInstance.
def ExpandNames(self): """ExpandNames for CreateInstance.
449,812
def ExpandNames(self): """ExpandNames for CreateInstance.
def ExpandNames(self): """ExpandNames for CreateInstance.
449,813
def ExpandNames(self): """ExpandNames for CreateInstance.
def ExpandNames(self): """ExpandNames for CreateInstance.
449,814
def ExpandNames(self): """ExpandNames for CreateInstance.
def ExpandNames(self): """ExpandNames for CreateInstance.
449,815
def run(self): """Main thread function.
def run(self): """Main thread function.
449,816
def SimpleFillBE(self, beparams): """Fill a given beparams dict with cluster defaults.
def SimpleFillBE(self, beparams): """Fill a given beparams dict with cluster defaults.
449,817
def SimpleFillNIC(self, nicparams): """Fill a given nicparams dict with cluster defaults.
def SimpleFillNIC(self, nicparams): """Fill a given nicparams dict with cluster defaults.
449,818
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...
def OSCoreEnv(os_name, 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...
449,819
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...
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...
449,820
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...
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...
449,821
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...
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...
449,822
def _ReadManFile(name): return utils.ReadFile("%s/man/%s.sgml" % (testutils.GetSourceDir(), name))
def _ReadManFile(name): return utils.ReadFile("%s/man/%s.rst" % (testutils.GetSourceDir(), name))
449,823
def _CheckManpage(self, script, mantext, commands): missing = []
def _CheckManpage(self, script, mantext, commands): missing = []
449,824
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...
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...
449,825
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...
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...
449,826
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 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("O...
449,827
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 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 %...
449,828
def ExpandNames(self): if not isinstance(self.op.instances, list): raise errors.OpPrereqError("Invalid argument type 'instances'", errors.ECODE_INVAL)
def CheckArguments(self): if not isinstance(self.op.instances, list): raise errors.OpPrereqError("Invalid argument type 'instances'", errors.ECODE_INVAL)
449,829
def ExpandNames(self): if self.op.names: raise errors.OpPrereqError("Selective OS query not supported", errors.ECODE_INVAL)
def CheckArguments(self): if self.op.names: raise errors.OpPrereqError("Selective OS query not supported", errors.ECODE_INVAL)
449,830
def ExpandNames(self): _CheckOutputFields(static=self._FIELDS_STATIC, dynamic=self._FIELDS_DYNAMIC, selected=self.op.output_fields)
def CheckArguments(self): _CheckOutputFields(static=self._FIELDS_STATIC, dynamic=self._FIELDS_DYNAMIC, selected=self.op.output_fields)
449,831
def ExpandNames(self): _CheckOutputFields(static=self._FIELDS_STATIC, dynamic=self._FIELDS_DYNAMIC, selected=self.op.output_fields)
def CheckArguments(self): _CheckOutputFields(static=self._FIELDS_STATIC, dynamic=self._FIELDS_DYNAMIC, selected=self.op.output_fields)
449,832
def ExpandNames(self): self.needed_locks = {}
def ExpandNames(self): self.needed_locks = {}
449,833
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...
def ExpandNames(self): self._ExpandAndLockInstance()
449,834
def ExpandNames(self): _CheckOutputFields(static=self._FIELDS_STATIC, dynamic=self._FIELDS_DYNAMIC, selected=self.op.output_fields)
def CheckArguments(self): _CheckOutputFields(static=self._FIELDS_STATIC, dynamic=self._FIELDS_DYNAMIC, selected=self.op.output_fields)
449,835
def ExpandNames(self): self.needed_locks = {} self.share_locks = dict.fromkeys(locking.LEVELS, 1)
def ExpandNames(self): self.needed_locks = {} self.share_locks = dict.fromkeys(locking.LEVELS, 1)
449,836
def WaitOrShow(self, wait): """Wait for job results or only print the job IDs.
def WaitOrShow(self, wait): """Wait for job results or only print the job IDs.
449,837
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: ...
def _GetUpdatedParams(old_params, update_dict, use_default=True, use_none=False): """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 param...
449,838
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: ...
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: ...
449,839
def DropECReservations(self, ec_id): """Drop per-execution-context reservations
def DropECReservations(self, ec_id): """Drop per-execution-context reservations
449,840
def POST(self): """Create an instance.
def POST(self): """Create an instance.
449,841
def __call__(self): """Returns current delay and calculates the next one.
def __call__(self): """Returns current delay and calculates the next one.
449,842
def MarkUnfinishedOps(self, status, result): """Mark unfinished opcodes with a given status and result.
def MarkUnfinishedOps(self, status, result): """Mark unfinished opcodes with a given status and result.
449,843
def RunTask(self, job): # pylint: disable-msg=W0221 """Job executor.
def RunTask(self, job): # pylint: disable-msg=W0221 """Job executor.
449,844
def __init__(self, context): """Constructor for JobQueue.
def __init__(self, context): """Constructor for JobQueue.
449,845
def CancelJob(self, job_id): """Cancels a job.
def CancelJob(self, job_id): """Cancels a job.
449,846
def CancelJob(self, job_id): """Cancels a job.
def CancelJob(self, job_id): """Cancels a job.
449,847
def CancelJob(self, job_id): """Cancels a job.
def CancelJob(self, job_id): """Cancels a job.
449,848
def runTests(self): """
def runTests(self): """
449,849
def runTests(self): """
def runTests(self): """
449,850
def Exec(self, feedback_fn): """Compute the list of OSes.
def Exec(self, feedback_fn): """Compute the list of OSes.
449,851
def _BuildSshOptions(self, batch, ask_key, use_cluster_key, strict_host_check): """Builds a list with needed SSH options.
def _BuildSshOptions(self, batch, ask_key, use_cluster_key, strict_host_check): """Builds a list with needed SSH options.
449,852
def __init__(self, unique_id, children, size): """Attaches to a LV device.
def __init__(self, unique_id, children, size): """Attaches to a LV device.
449,853
def Rename(self, new_id): """Rename this logical volume.
def Rename(self, new_id): """Rename this logical volume.
449,854
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...
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...
449,855
def _ExecuteKVMRuntime(self, instance, kvm_runtime, incoming=None): """Execute a KVM cmd, after completing it with some last minute data
def _ExecuteKVMRuntime(self, instance, kvm_runtime, incoming=None): """Execute a KVM cmd, after completing it with some last minute data
449,856
def _ExecuteKVMRuntime(self, instance, kvm_runtime, incoming=None): """Execute a KVM cmd, after completing it with some last minute data
def _ExecuteKVMRuntime(self, instance, kvm_runtime, incoming=None): """Execute a KVM cmd, after completing it with some last minute data
449,857
def CheckPrereq(self): """Check prerequisites.
def CheckPrereq(self): """Check prerequisites.
449,858
def Exec(self, feedback_fn): """Rename the cluster.
def Exec(self, feedback_fn): """Rename the cluster.
449,859
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 ...
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 ...
449,860
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 ...
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 ...
449,861
def CleanupInstance(self, instance_name): """Cleanup after a stopped instance
def CleanupInstance(self, instance_name): """Cleanup after a stopped instance
449,862
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...
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...
449,863
def CheckArguments(self): self.opnode_name = _ExpandNodeName(self.cfg, self.op.node_name)
def CheckArguments(self): self.opnode_name = _ExpandNodeName(self.cfg, self.op.node_name)
449,864
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...
def SubmitOpCode(op, cl=None, feedback_fn=None, opts=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) ...
449,865
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 ...
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 ...
449,866
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 ...
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 ...
449,867
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 ...
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 ...
449,868
def _CollectDiskInfo(self, nodelist, node_image, instanceinfo): """Gets per-disk status information for all instances.
def _CollectDiskInfo(self, nodelist, node_image, instanceinfo): """Gets per-disk status information for all instances.
449,869
def _CollectDiskInfo(self, nodelist, node_image, instanceinfo): """Gets per-disk status information for all instances.
def _CollectDiskInfo(self, nodelist, node_image, instanceinfo): """Gets per-disk status information for all instances.
449,870
def _CollectDiskInfo(self, nodelist, node_image, instanceinfo): """Gets per-disk status information for all instances.
def _CollectDiskInfo(self, nodelist, node_image, instanceinfo): """Gets per-disk status information for all instances.
449,871
def _CollectDiskInfo(self, nodelist, node_image, instanceinfo): """Gets per-disk status information for all instances.
def _CollectDiskInfo(self, nodelist, node_image, instanceinfo): """Gets per-disk status information for all instances.
449,872
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()))...
def FormatParamikoFingerprint(fingerprint): """Format paramiko PKey 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()))
449,873
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()))...
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())...
449,874
def Exec(self, feedback_fn): """Computes the list of groups and their attributes.
def Exec(self, feedback_fn): """Computes the list of groups and their attributes.
449,875
def Exec(self, feedback_fn): """Computes the list of groups and their attributes.
def Exec(self, feedback_fn): """Computes the list of groups and their attributes.
449,876
def Exec(self, feedback_fn): """Computes the list of groups and their attributes.
def Exec(self, feedback_fn): """Computes the list of groups and their attributes.
449,877
def CheckPrereq(self): """Check prerequisites.
def CheckPrereq(self): """Check prerequisites.
449,878
def _BuildSshOptions(self, batch, ask_key, use_cluster_key, strict_host_check, private_key=None): """Builds a list with needed SSH options.
def _BuildSshOptions(self, batch, ask_key, use_cluster_key, strict_host_check, private_key=None, quiet=True): """Builds a list with needed SSH options.
449,879
def BuildCmd(self, hostname, user, command, batch=True, ask_key=False, tty=False, use_cluster_key=True, strict_host_check=True, private_key=None): """Build an ssh command to execute a command on a remote node.
def BuildCmd(self, hostname, user, command, batch=True, ask_key=False, tty=False, use_cluster_key=True, strict_host_check=True, private_key=None, quiet=True): """Build an ssh command to execute a command on a remote node.
449,880
def BuildCmd(self, hostname, user, command, batch=True, ask_key=False, tty=False, use_cluster_key=True, strict_host_check=True, private_key=None): """Build an ssh command to execute a command on a remote node.
def BuildCmd(self, hostname, user, command, batch=True, ask_key=False, tty=False, use_cluster_key=True, strict_host_check=True, private_key=None): """Build an ssh command to execute a command on a remote node.
449,881
def BuildCmd(self, hostname, user, command, batch=True, ask_key=False, tty=False, use_cluster_key=True, strict_host_check=True, private_key=None): """Build an ssh command to execute a command on a remote node.
def BuildCmd(self, hostname, user, command, batch=True, ask_key=False, tty=False, use_cluster_key=True, strict_host_check=True, private_key=None): """Build an ssh command to execute a command on a remote node.
449,882
def CopyFileToNode(self, node, filename): """Copy a file to another node with scp.
def CopyFileToNode(self, node, filename): """Copy a file to another node with scp.
449,883
def testDeferredCancel(self): self.mainloop.RegisterSignal(self) self.mainloop.scheduler.enter(0.1, 1, self._SendSig, [signal.SIGCHLD]) handle1 = self.mainloop.scheduler.enter(0.3, 2, self._SendSig, [signal.SIGCHLD]) handle2 = self.mainloop.scheduler.enter(0.4, 2, self._SendSig, [signal.SIGCHLD]) self.mainloop.schedule...
def testDeferredCancel(self): self.mainloop.RegisterSignal(self) now = time.time() self.mainloop.scheduler.enterabs(now + 0.1, 1, self._SendSig, [signal.SIGCHLD]) handle1 = self.mainloop.scheduler.enterabs(now + 0.3, 2, self._SendSig, [signal.SIGCHLD]) handle2 = self.mainloop.scheduler.enterabs(now + 0.4, 2, self._Send...
449,884
def NormalizeAndValidateMac(mac): """Normalizes and check if a MAC address is valid. Checks whether the supplied MAC address is formally correct, only accepts colon separated format. Normalize it to all lower. @type mac: str @param mac: the MAC to be validated @rtype: str @return: returns the normalized and validated...
def NormalizeAndValidateMac(mac): """Normalizes and check if a MAC address is valid. Checks whether the supplied MAC address is formally correct, only accepts colon separated format. Normalize it to all lower. @type mac: str @param mac: the MAC to be validated @rtype: str @return: returns the normalized and validated...
449,885
def _RunAllocator(self): """Run the allocator based on input opcode.
def _RunAllocator(self): """Run the allocator based on input opcode.
449,886
def _RunAllocator(self): """Run the allocator based on input opcode.
def _RunAllocator(self): """Run the allocator based on input opcode.
449,887
def _RunAllocator(self): """Run the allocator based on input opcode.
def _RunAllocator(self): """Run the allocator based on input opcode.
449,888
def _RunAllocator(self): """Run the allocator based on input opcode.
def _RunAllocator(self): """Run the allocator based on input opcode.
449,889
def _RunAllocator(self): """Run the allocator based on input opcode.
def _RunAllocator(self): """Run the allocator based on input opcode.
449,890
def _RunAllocator(lu, iallocator_name, instance_name, relocate_from): """Compute a new secondary node using an IAllocator.
def _RunAllocator(lu, iallocator_name, instance_name, relocate_from): """Compute a new secondary node using an IAllocator.
449,891
def _RunAllocator(lu, iallocator_name, instance_name, relocate_from): """Compute a new secondary node using an IAllocator.
def _RunAllocator(lu, iallocator_name, instance_name, relocate_from): """Compute a new secondary node using an IAllocator.
449,892
def _RunAllocator(lu, iallocator_name, instance_name, relocate_from): """Compute a new secondary node using an IAllocator.
def _RunAllocator(lu, iallocator_name, instance_name, relocate_from): """Compute a new secondary node using an IAllocator.
449,893
def __init__(self, cfg, rpc, mode, **kwargs): self.cfg = cfg self.rpc = rpc # init buffer variables self.in_text = self.out_text = self.in_data = self.out_data = None # init all input fields so that pylint is happy self.mode = mode self.mem_size = self.disks = self.disk_template = None self.os = self.tags = self.nics =...
def __init__(self, cfg, rpc, mode, **kwargs): self.cfg = cfg self.rpc = rpc # init buffer variables self.in_text = self.out_text = self.in_data = self.out_data = None # init all input fields so that pylint is happy self.mode = mode self.mem_size = self.disks = self.disk_template = None self.os = self.tags = self.nics =...
449,894
def _ValidateResult(self): """Process the allocator results.
def _ValidateResult(self): """Process the allocator results.
449,895
def _ValidateResult(self): """Process the allocator results.
def _ValidateResult(self): """Process the allocator results.
449,896
def __init__(self, queue, job_id, ops): """Constructor for the _QueuedJob.
def __init__(self, queue, job_id, ops): """Constructor for the _QueuedJob.
449,897
def RunTest(fn, *args): """Runs a test after printing a header. """ if fn.__doc__: desc = fn.__doc__.splitlines()[0].strip() else: desc = '%r' % fn now = str(datetime.datetime.now()) print print '---', now, ('-' * (55 - len(now))) print desc print '-' * 60 return fn(*args)
def RunTest(fn, *args): """Runs a test after printing a header. """ if fn.__doc__: desc = fn.__doc__.splitlines()[0].strip() else: desc = "%r" % fn desc = desc.rstrip(".") tstart = datetime.datetime.now() print print '---', now, ('-' * (55 - len(now))) print desc print '-' * 60 return fn(*args)
449,898
def RunTest(fn, *args): """Runs a test after printing a header. """ if fn.__doc__: desc = fn.__doc__.splitlines()[0].strip() else: desc = '%r' % fn now = str(datetime.datetime.now()) print print '---', now, ('-' * (55 - len(now))) print desc print '-' * 60 return fn(*args)
def RunTest(fn, *args): """Runs a test after printing a header. """ if fn.__doc__: desc = fn.__doc__.splitlines()[0].strip() else: desc = '%r' % fn now = str(datetime.datetime.now()) print print _FormatHeader("%s start %s" % (tstart, desc)) try: retval = fn(*args) return retval finally: tstop = datetime.datetime.no...
449,899