diff --git a/daemons/ganeti-masterd b/daemons/ganeti-masterd index 5e524d98e4960bfdde18fcb317a0379b83c8ae0d..ff7ec0c31f8328c94e146ab8ba96c240d2e2e101 100755 --- a/daemons/ganeti-masterd +++ b/daemons/ganeti-masterd @@ -402,9 +402,9 @@ def CheckAgreement(): continue break if retries == 0: - logging.critical("Cluster inconsistent, most of the nodes didn't answer" - " after multiple retries. Aborting startup") - return False + logging.critical("Cluster inconsistent, most of the nodes didn't answer" + " after multiple retries. Aborting startup") + return False # here a real node is at the top of the list all_votes = sum(item[1] for item in votes) top_node, top_votes = votes[0] diff --git a/daemons/ganeti-rapi b/daemons/ganeti-rapi index 4607b0d15b614e53bfc32f778efd701f565fd3d8..96329397361f1114b638372e77a7d488878bf297 100755 --- a/daemons/ganeti-rapi +++ b/daemons/ganeti-rapi @@ -134,6 +134,7 @@ class RemoteApiHttpServer(http.auth.HttpServerRequestAuthentication, if sn: req.response_headers[http.HTTP_ETAG] = str(sn) except: + method = req.request_method.upper() logging.exception("Error while handling the %s request", method) raise diff --git a/lib/http/auth.py b/lib/http/auth.py index 4df4ccb2d8fdeee163ab88f831e2aa4859e79de2..325ed7f63ef9037b0dfe910412233f7da4141f73 100644 --- a/lib/http/auth.py +++ b/lib/http/auth.py @@ -166,19 +166,19 @@ class HttpServerRequestAuthentication(object): # Unsupported authentication scheme return False - def _CheckBasicAuthorization(self, req, input): + def _CheckBasicAuthorization(self, req, in_data): """Checks credentials sent for basic authentication. @type req: L{http.server._HttpServerRequest} @param req: HTTP request context - @type input: str - @param input: Username and password encoded as Base64 + @type in_data: str + @param in_data: Username and password encoded as Base64 @rtype: bool @return: Whether user is allowed to execute request """ try: - creds = base64.b64decode(input.encode('ascii')).decode('ascii') + creds = base64.b64decode(in_data.encode('ascii')).decode('ascii') except (TypeError, binascii.Error, UnicodeError): logging.exception("Error when decoding Basic authentication credentials") return False diff --git a/lib/hypervisor/hv_xen.py b/lib/hypervisor/hv_xen.py index e03bc53ebbb2cc0ed38def09ed6329f43fadbb69..c4aebf38261a804b7ae11cdb9313c38c504c548e 100644 --- a/lib/hypervisor/hv_xen.py +++ b/lib/hypervisor/hv_xen.py @@ -461,10 +461,10 @@ class XenHvmHypervisor(XenHypervisor): # hvm_cdrom_image_path verification iso_path = hvparams[constants.HV_CDROM_IMAGE_PATH] if iso_path and not os.path.isfile(iso_path): - raise errors.HypervisorError("The HVM CDROM image must either be a" - " regular file or a symlink pointing to" - " an existing regular file, not %s" % - iso_path) + raise errors.HypervisorError("The HVM CDROM image must either be a" + " regular file or a symlink pointing to" + " an existing regular file, not %s" % + iso_path) @classmethod def _WriteConfigFile(cls, instance, block_devices, extra_args):