diff --git a/daemons/ganeti-rapi b/daemons/ganeti-rapi index dca707514dfcfa06b0ae790920f19c6fa7465944..a5d34069052f2e9f416a6af5f33b5f60b0c579bd 100755 --- a/daemons/ganeti-rapi +++ b/daemons/ganeti-rapi @@ -81,6 +81,8 @@ class RemoteApiHttpServer(http.auth.HttpServerRequestAuthentication, AUTH_REALM = "Ganeti Remote API" def __init__(self, *args, **kwargs): + # pylint: disable-msg=W0233 + # it seems pylint doesn't see the second parent class there http.server.HttpServer.__init__(self, *args, **kwargs) http.auth.HttpServerRequestAuthentication.__init__(self) self._resmap = connector.Mapper() @@ -228,6 +230,8 @@ def ExecRapi(options, _): server = RemoteApiHttpServer(mainloop, options.bind_address, options.port, ssl_params=ssl_params, ssl_verify_peer=False, request_executor_class=JsonErrorRequestExecutor) + # pylint: disable-msg=E1101 + # it seems pylint doesn't see the second parent class there server.Start() try: mainloop.Run() diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 263ec2bd4f26f3f9daf37b83bec15385d91161e0..9f8b1fffd2e76600685c09c0ef2a59806f81b2a6 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -1658,6 +1658,7 @@ class LUVerifyCluster(LogicalUnit): vg_name = self.cfg.GetVGName() hypervisors = self.cfg.GetClusterInfo().enabled_hypervisors + cluster = self.cfg.GetClusterInfo() nodelist = utils.NiceSort(self.cfg.GetNodeList()) nodeinfo = [self.cfg.GetNodeInfo(nname) for nname in nodelist] instancelist = utils.NiceSort(self.cfg.GetInstanceList()) @@ -1676,6 +1677,8 @@ class LUVerifyCluster(LogicalUnit): file_names = ssconf.SimpleStore().GetFileList() file_names.extend(constants.ALL_CERT_FILES) file_names.extend(master_files) + if cluster.modify_etc_hosts: + file_names.append(constants.ETC_HOSTS) local_checksums = utils.FingerprintFiles(file_names) @@ -1739,7 +1742,6 @@ class LUVerifyCluster(LogicalUnit): self.cfg.GetClusterName()) nvinfo_endtime = time.time() - cluster = self.cfg.GetClusterInfo() master_node = self.cfg.GetMasterNode() all_drbd_map = self.cfg.ComputeDRBDMap() @@ -2850,6 +2852,12 @@ class LURemoveNode(LogicalUnit): self.LogWarning("Errors encountered on the remote node while leaving" " the cluster: %s", msg) + # Remove node from our /etc/hosts + if self.cfg.GetClusterInfo().modify_etc_hosts: + # FIXME: this should be done via an rpc call to node daemon + utils.RemoveHostFromEtcHosts(node.name) + _RedistributeAncillaryFiles(self) + class LUQueryNodes(NoHooksLU): """Logical unit for querying nodes. @@ -3424,6 +3432,7 @@ class LUAddNode(LogicalUnit): # Add node to our /etc/hosts, and add key to known_hosts if self.cfg.GetClusterInfo().modify_etc_hosts: + # FIXME: this should be done via an rpc call to node daemon utils.AddHostToEtcHosts(new_node.name) if new_node.secondary_ip != new_node.primary_ip: diff --git a/lib/constants.py b/lib/constants.py index 8e566391e79eacd156ace6630b8d5cb4b570d130..8258e92a91a5e36f71ee382d082e498f75b64be7 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -353,7 +353,6 @@ EXIT_NOTCLUSTER = 5 EXIT_NOTMASTER = 11 EXIT_NODESETUP_ERROR = 12 EXIT_CONFIRMATION = 13 # need user confirmation -EXIT_NOTCANDIDATE = 14 # tags TAG_CLUSTER = "cluster" diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py index 13c09ddce547c8bfb9da5f096075a97d58641afb..76b4a1a60757d851a3fa8b1399a1d868e065fc2c 100644 --- a/lib/hypervisor/hv_kvm.py +++ b/lib/hypervisor/hv_kvm.py @@ -287,6 +287,7 @@ class KVMHypervisor(hv_base.BaseHypervisor): if nic.nicparams[constants.NIC_MODE] == constants.NIC_MODE_BRIDGED: script.write("export BRIDGE=%s\n" % nic.nicparams[constants.NIC_LINK]) script.write("export INTERFACE=$1\n") + script.write("export TAGS=\"%s\"\n" % " ".join(instance.tags)) # TODO: make this configurable at ./configure time script.write("if [ -x '%s' ]; then\n" % self._KVM_NETWORK_SCRIPT) script.write(" # Execute the user-specific vif file\n") diff --git a/lib/ssconf.py b/lib/ssconf.py index 966f670a2f8193ede234d4fdf53a5c43413f4723..9fa088e1b5f76fbe523a36c00915b6ca451ba6c5 100644 --- a/lib/ssconf.py +++ b/lib/ssconf.py @@ -497,28 +497,3 @@ def CheckMaster(debug, ss=None): if debug: sys.stderr.write("Not master, exiting.\n") sys.exit(constants.EXIT_NOTMASTER) - - -def CheckMasterCandidate(debug, ss=None): - """Checks the node setup. - - If this is a master candidate, the function will return. Otherwise it will - exit with an exit code based on the node status. - - """ - try: - if ss is None: - ss = SimpleStore() - myself = utils.HostInfo().name - candidates = ss.GetMasterCandidates() - except errors.ConfigurationError, err: - print "Cluster configuration incomplete: '%s'" % str(err) - sys.exit(constants.EXIT_NODESETUP_ERROR) - except errors.ResolverError, err: - sys.stderr.write("Cannot resolve my own name (%s)\n" % err.args[0]) - sys.exit(constants.EXIT_NODESETUP_ERROR) - - if myself not in candidates: - if debug: - sys.stderr.write("Not master candidate, exiting.\n") - sys.exit(constants.EXIT_NOTCANDIDATE) diff --git a/qa/qa_cluster.py b/qa/qa_cluster.py index a2842acd8c51af7dacfa862cf94f45869185afec..0e557dd928da9c8d5351b93a080a0c8154ba905c 100644 --- a/qa/qa_cluster.py +++ b/qa/qa_cluster.py @@ -256,13 +256,13 @@ def TestClusterBurnin(): try: # Run burnin cmd = [script, - '-p', '--os=%s' % qa_config.get('os'), '--disk-size=%s' % ",".join(qa_config.get('disk')), '--disk-growth=%s' % ",".join(qa_config.get('disk-growth')), '--disk-template=%s' % disk_template] if parallel: cmd.append('--parallel') + cmd.append('--early-release') if check_inst: cmd.append('--http-check') if do_rename: diff --git a/scripts/gnt-instance b/scripts/gnt-instance index 3dfcd344a0cc059b03f97358cc54cceae6d39b96..250b11f4c6d864bc6ba350221618ca9790635524 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -876,9 +876,8 @@ def MigrateInstance(opts, args): else: usertext = ("Instance %s will be migrated. Note that migration" % (instance_name,)) - usertext += (" is **experimental** in this version." - " This might impact the instance if anything goes wrong." - " Continue?") + usertext += (" might impact the instance if anything goes wrong" + " (e.g. due to bugs in the hypervisor). Continue?") if not AskUser(usertext): return 1 diff --git a/tools/cfgupgrade b/tools/cfgupgrade index 9fd8c689a7ff43666e20b4b4d9fe97ef0e7c8bc2..b2e0de13f15c2860e04950567a2abaede1ab291e 100755 --- a/tools/cfgupgrade +++ b/tools/cfgupgrade @@ -117,6 +117,7 @@ def main(): # We need to keep filenames locally because they might be renamed between # versions. + options.data_dir = os.path.abspath(options.data_dir) options.CONFIG_DATA_PATH = options.data_dir + "/config.data" options.SERVER_PEM_PATH = options.data_dir + "/server.pem" options.KNOWN_HOSTS_PATH = options.data_dir + "/known_hosts" diff --git a/tools/cfgupgrade12 b/tools/cfgupgrade12 index 2e1a7aa4015866d62fd42a593bacb13ac3023f8b..b1aa9651025b89931430941bb9dd7f58d068c223 100755 --- a/tools/cfgupgrade12 +++ b/tools/cfgupgrade12 @@ -302,6 +302,7 @@ def main(): # We need to keep filenames locally because they might be renamed between # versions. + options.data_dir = os.path.abspath(options.data_dir) options.CONFIG_DATA_PATH = options.data_dir + "/config.data" options.SERVER_PEM_PATH = options.data_dir + "/server.pem" options.KNOWN_HOSTS_PATH = options.data_dir + "/known_hosts"