Patch attached.
From b13ef989eabc361d17fdc5d1d6137a460e650d6b Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Thu, 17 Dec 2015 15:51:32 +0100
Subject: [PATCH] Enable pylint unpacking-non-sequence check

Enables check and marks occurences of runtime error in dcerpc.py as
false positive.
---
 ipaserver/dcerpc.py | 12 ++++++------
 make-lint           |  1 -
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/ipaserver/dcerpc.py b/ipaserver/dcerpc.py
index 13cb7767cc2ba303613a2d4065964d51599d728e..eb646b8af1fd7e9bfae3896424bd4ab66fbfb956 100644
--- a/ipaserver/dcerpc.py
+++ b/ipaserver/dcerpc.py
@@ -813,7 +813,7 @@ class TrustDomainInstance(object):
            result = lsa.lsarpc(binding, self.parm, self.creds)
            return result
        except RuntimeError as e:
-           num, message = e.args
+           num, message = e.args  # pylint: disable=unpacking-non-sequence
            raise assess_dcerpc_exception(num=num, message=message)
 
     def init_lsa_pipe(self, remote_host):
@@ -930,7 +930,7 @@ class TrustDomainInstance(object):
             self._policy_handle = self._pipe.OpenPolicy2(u"", objectAttribute, security.SEC_FLAG_MAXIMUM_ALLOWED)
             result = self._pipe.QueryInfoPolicy2(self._policy_handle, lsa.LSA_POLICY_INFO_DNS)
         except RuntimeError as e:
-            num, message = e.args
+            num, message = e.args  # pylint: disable=unpacking-non-sequence
             raise assess_dcerpc_exception(num=num, message=message)
 
         self.info['name'] = unicode(result.name.string)
@@ -943,7 +943,7 @@ class TrustDomainInstance(object):
         try:
             result = self._pipe.QueryInfoPolicy2(self._policy_handle, lsa.LSA_POLICY_INFO_ROLE)
         except RuntimeError as e:
-            num, message = e.args
+            num, message = e.args  # pylint: disable=unpacking-non-sequence
             raise assess_dcerpc_exception(num=num, message=message)
 
         self.info['is_pdc'] = (result.role == lsa.LSA_ROLE_PRIMARY)
@@ -1069,7 +1069,7 @@ class TrustDomainInstance(object):
             res = self._pipe.QueryTrustedDomainInfoByName(self._policy_handle, dname, lsa.LSA_TRUSTED_DOMAIN_INFO_FULL_INFO)
             self._pipe.DeleteTrustedDomain(self._policy_handle, res.info_ex.sid)
         except RuntimeError as e:
-            num, message = e.args
+            num, message = e.args  # pylint: disable=unpacking-non-sequence
             # Ignore anything but access denied (NT_STATUS_ACCESS_DENIED)
             if num == -1073741790:
                 raise access_denied_error
@@ -1077,7 +1077,7 @@ class TrustDomainInstance(object):
         try:
             trustdom_handle = self._pipe.CreateTrustedDomainEx2(self._policy_handle, info, self.auth_info, security.SEC_STD_DELETE)
         except RuntimeError as e:
-            num, message = e.args
+            num, message = e.args  # pylint: disable=unpacking-non-sequence
             raise assess_dcerpc_exception(num=num, message=message)
 
         # We should use proper trustdom handle in order to modify the
@@ -1119,7 +1119,7 @@ class TrustDomainInstance(object):
                                            )
                 return result
             except RuntimeError as e:
-                num, message = e.args
+                num, message = e.args  # pylint: disable=unpacking-non-sequence
                 raise assess_dcerpc_exception(num=num, message=message)
 
         result = retrieve_netlogon_info_2(None, self,
diff --git a/make-lint b/make-lint
index 4d21c6e827ed610e57a089b0203abca6dc9619c4..b1780f94adcb56e1b2c5ec014ad73d203b96c351 100755
--- a/make-lint
+++ b/make-lint
@@ -280,7 +280,6 @@ def main():
         linter.set_option('disable', 'unused-variable')
         linter.set_option('disable', 'useless-else-on-loop')
         linter.set_option('disable', 'unbalanced-tuple-unpacking')
-        linter.set_option('disable', 'unpacking-non-sequence')
 
         linter.set_option('enable', 'C')
         linter.set_option('disable', 'bad-classmethod-argument')
-- 
2.5.0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to