Under squeeze pylint reports the following errors:
************* Module ganeti.serializer
E1103:155:LoadSignedJson: Instance of 'False' has no 'get' member (but some types could not be inferred)
************* Module ganeti-masterd
E1103:166:ClientRqHandler.handle: Instance of 'False' has no 'get' member (but some types could not be inferred)
E1103:167:ClientRqHandler.handle: Instance of 'False' has no 'get' member (but some types could not be inferred)
************* Module gnt-instance
E1103:431:BatchCreate: Instance of 'False' has no 'keys' member (but some types could not be inferred)
For the first two cases it's actually wrong: we had checked before that
the variable on which "get" is called is actually a dict. In the third
case though such check doesn't exist, so we add it. Then we silence the
error all three times.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
logging.error("wrong request received: %s", msg)
break
- method = request.get(luxi.KEY_METHOD, None)
- args = request.get(luxi.KEY_ARGS, None)
+ method = request.get(luxi.KEY_METHOD, None) # pylint: disable-msg=E1103
+ args = request.get(luxi.KEY_ARGS, None) # pylint: disable-msg=E1103
if method is None or args is None:
logging.error("no method or args in request")
break
raise errors.SignatureError('Invalid external message')
if callable(key):
+ # pylint: disable-msg=E1103
key_selector = signed_dict.get("key_selector", None)
hmac_key = key(key_selector)
if not hmac_key:
ToStderr("Can't parse the instance definition file: %s" % str(err))
return 1
+ if not isinstance(instance_data, dict):
+ ToStderr("The instance definition file is not in dict format.")
+ return 1
+
jex = JobExecutor(opts=opts)
# Iterate over the instances and do:
# * Populate the specs with default value
# * Validate the instance specs
- i_names = utils.NiceSort(instance_data.keys())
+ i_names = utils.NiceSort(instance_data.keys()) # pylint: disable-msg=E1103
for name in i_names:
specs = instance_data[name]
specs = _PopulateWithDefaults(specs)