summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Harmsen <mharmsen@redhat.com>2017-06-02 02:10:02 +0200
committerMatthew Harmsen <mharmsen@redhat.com>2017-06-02 02:10:02 +0200
commitf7b6305396581f5916498cc4ea8247596bf39aaf (patch)
treef0d33e714665a2394c693e828cca7dc933b93837
parent772e05e746570c13afeb60516c07a3fb95ca3e78 (diff)
downloadpki-f7b6305396581f5916498cc4ea8247596bf39aaf.tar.gz
pki-f7b6305396581f5916498cc4ea8247596bf39aaf.tar.xz
pki-f7b6305396581f5916498cc4ea8247596bf39aaf.zip
Fixed pylint issues
- https://pagure.io/dogtagpki/issue/2713 - Build failure due to Pylint issues
-rw-r--r--base/common/python/pki/cli/pkcs12.py4
-rw-r--r--base/common/python/pki/encoder.py12
-rw-r--r--base/server/python/pki/server/cli/audit.py8
-rw-r--r--base/server/python/pki/server/cli/ca.py16
-rw-r--r--base/server/python/pki/server/cli/db.py8
-rw-r--r--base/server/python/pki/server/cli/kra.py20
-rw-r--r--base/server/python/pki/server/cli/ocsp.py4
-rw-r--r--base/server/python/pki/server/cli/subsystem.py4
-rw-r--r--base/server/python/pki/server/cli/tks.py4
-rw-r--r--base/server/python/pki/server/cli/tps.py20
-rw-r--r--base/server/python/pki/server/upgrade.py3
11 files changed, 50 insertions, 53 deletions
diff --git a/base/common/python/pki/cli/pkcs12.py b/base/common/python/pki/cli/pkcs12.py
index 8934d33a7..6b99fcfbd 100644
--- a/base/common/python/pki/cli/pkcs12.py
+++ b/base/common/python/pki/cli/pkcs12.py
@@ -62,10 +62,10 @@ class PKCS12ImportCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
- opts, _ = getopt.gnu_getopt(args, 'v', [
+ opts, _ = getopt.gnu_getopt(argv, 'v', [
'pkcs12-file=', 'pkcs12-password=', 'pkcs12-password-file=',
'no-trust-flags', 'no-user-certs', 'no-ca-certs', 'overwrite',
'verbose', 'debug', 'help'])
diff --git a/base/common/python/pki/encoder.py b/base/common/python/pki/encoder.py
index 8485ab883..d3298bc67 100644
--- a/base/common/python/pki/encoder.py
+++ b/base/common/python/pki/encoder.py
@@ -82,14 +82,14 @@ class CustomTypeEncoder(json.JSONEncoder):
"""
# pylint: disable=E0202
- def default(self, obj):
+ def default(self, o):
for k, v in iteritems(TYPES):
- if isinstance(obj, v):
- return {k: obj.__dict__}
+ if isinstance(o, v):
+ return {k: o.__dict__}
for t in itervalues(NOTYPES):
- if isinstance(obj, t):
- return self.attr_name_conversion(obj.__dict__, type(obj))
- return json.JSONEncoder.default(self, obj)
+ if isinstance(o, t):
+ return self.attr_name_conversion(o.__dict__, type(o))
+ return json.JSONEncoder.default(self, o)
@staticmethod
def attr_name_conversion(attr_dict, object_class):
diff --git a/base/server/python/pki/server/cli/audit.py b/base/server/python/pki/server/cli/audit.py
index 0833ca816..a19ca8c65 100644
--- a/base/server/python/pki/server/cli/audit.py
+++ b/base/server/python/pki/server/cli/audit.py
@@ -56,10 +56,10 @@ class AuditFileFindCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
- opts, _ = getopt.gnu_getopt(args, 'i:v', [
+ opts, _ = getopt.gnu_getopt(argv, 'i:v', [
'instance=',
'verbose', 'help'])
@@ -129,10 +129,10 @@ class AuditFileVerifyCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
- opts, _ = getopt.gnu_getopt(args, 'i:v', [
+ opts, _ = getopt.gnu_getopt(argv, 'i:v', [
'instance=',
'verbose', 'help'])
diff --git a/base/server/python/pki/server/cli/ca.py b/base/server/python/pki/server/cli/ca.py
index 550e5110a..48c7dba6c 100644
--- a/base/server/python/pki/server/cli/ca.py
+++ b/base/server/python/pki/server/cli/ca.py
@@ -78,10 +78,10 @@ class CACertChainExportCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
- opts, _ = getopt.gnu_getopt(args, 'i:v', [
+ opts, _ = getopt.gnu_getopt(argv, 'i:v', [
'instance=', 'pkcs12-file=', 'pkcs12-password=', 'pkcs12-password-file=',
'verbose', 'help'])
@@ -190,10 +190,10 @@ class CACertRequestFindCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
- opts, _ = getopt.gnu_getopt(args, 'i:v', [
+ opts, _ = getopt.gnu_getopt(argv, 'i:v', [
'instance=', 'cert=', 'cert-file=',
'verbose', 'help'])
@@ -268,10 +268,10 @@ class CACertRequestShowCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
- opts, args = getopt.gnu_getopt(args, 'i:v', [
+ opts, args = getopt.gnu_getopt(argv, 'i:v', [
'instance=', 'output-file=',
'verbose', 'help'])
@@ -356,10 +356,10 @@ class CAClonePrepareCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
- opts, _ = getopt.gnu_getopt(args, 'i:v', [
+ opts, _ = getopt.gnu_getopt(argv, 'i:v', [
'instance=', 'pkcs12-file=', 'pkcs12-password=', 'pkcs12-password-file=',
'verbose', 'help'])
diff --git a/base/server/python/pki/server/cli/db.py b/base/server/python/pki/server/cli/db.py
index 17b1a2fa1..3df911cd9 100644
--- a/base/server/python/pki/server/cli/db.py
+++ b/base/server/python/pki/server/cli/db.py
@@ -58,10 +58,10 @@ class DBSchemaUpgrade(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
opts, _ = getopt.gnu_getopt(
- args, 'i:D:w:v', ['instance=', 'bind-dn=', 'bind-password=',
+ argv, 'i:D:w:v', ['instance=', 'bind-dn=', 'bind-password=',
'verbose', 'help'])
except getopt.GetoptError as e:
@@ -150,10 +150,10 @@ class DBUpgrade(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
opts, _ = getopt.gnu_getopt(
- args, 'i:v', ['instance=', 'verbose', 'help'])
+ argv, 'i:v', ['instance=', 'verbose', 'help'])
except getopt.GetoptError as e:
print('ERROR: ' + str(e))
diff --git a/base/server/python/pki/server/cli/kra.py b/base/server/python/pki/server/cli/kra.py
index 372401465..6c1ade97a 100644
--- a/base/server/python/pki/server/cli/kra.py
+++ b/base/server/python/pki/server/cli/kra.py
@@ -81,10 +81,10 @@ class KRAClonePrepareCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
- opts, _ = getopt.gnu_getopt(args, 'i:v', [
+ opts, _ = getopt.gnu_getopt(argv, 'i:v', [
'instance=', 'pkcs12-file=', 'pkcs12-password=', 'pkcs12-password-file=',
'verbose', 'help'])
@@ -203,10 +203,10 @@ class KRADBVLVFindCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
opts, _ = getopt.gnu_getopt(
- args,
+ argv,
'i:D:w:x:g:v',
['instance=', 'bind-dn=', 'bind-password=', 'generate-ldif=',
'verbose', 'help']
@@ -315,10 +315,10 @@ class KRADBVLVAddCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
opts, _ = getopt.gnu_getopt(
- args,
+ argv,
'i:D:w:x:g:v',
['instance=', 'bind-dn=', 'bind-password=', 'generate-ldif=',
'verbose', 'help']
@@ -421,10 +421,10 @@ class KRADBVLVDeleteCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
opts, _ = getopt.gnu_getopt(
- args,
+ argv,
'i:D:w:x:g:v',
['instance=', 'bind-dn=', 'bind-password=', 'generate-ldif=',
'verbose', 'help']
@@ -543,10 +543,10 @@ class KRADBVLVReindexCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
opts, _ = getopt.gnu_getopt(
- args,
+ argv,
'i:D:w:x:g:v',
['instance=', 'bind-dn=', 'bind-password=', 'generate-ldif=',
'verbose', 'help']
diff --git a/base/server/python/pki/server/cli/ocsp.py b/base/server/python/pki/server/cli/ocsp.py
index 3e9b6aa64..b3e4e45ee 100644
--- a/base/server/python/pki/server/cli/ocsp.py
+++ b/base/server/python/pki/server/cli/ocsp.py
@@ -67,10 +67,10 @@ class OCSPClonePrepareCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
- opts, _ = getopt.gnu_getopt(args, 'i:v', [
+ opts, _ = getopt.gnu_getopt(argv, 'i:v', [
'instance=', 'pkcs12-file=', 'pkcs12-password=', 'pkcs12-password-file=',
'verbose', 'help'])
diff --git a/base/server/python/pki/server/cli/subsystem.py b/base/server/python/pki/server/cli/subsystem.py
index 8395bd2cd..10af8ca6a 100644
--- a/base/server/python/pki/server/cli/subsystem.py
+++ b/base/server/python/pki/server/cli/subsystem.py
@@ -66,10 +66,10 @@ class SubsystemFindCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
- opts, _ = getopt.gnu_getopt(args, 'i:v', [
+ opts, _ = getopt.gnu_getopt(argv, 'i:v', [
'instance=',
'verbose', 'help'])
diff --git a/base/server/python/pki/server/cli/tks.py b/base/server/python/pki/server/cli/tks.py
index 0e6a998f7..0bfaca120 100644
--- a/base/server/python/pki/server/cli/tks.py
+++ b/base/server/python/pki/server/cli/tks.py
@@ -67,10 +67,10 @@ class TKSClonePrepareCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
- opts, _ = getopt.gnu_getopt(args, 'i:v', [
+ opts, _ = getopt.gnu_getopt(argv, 'i:v', [
'instance=', 'pkcs12-file=', 'pkcs12-password=', 'pkcs12-password-file=',
'verbose', 'help'])
diff --git a/base/server/python/pki/server/cli/tps.py b/base/server/python/pki/server/cli/tps.py
index 03df8de96..a34bbd942 100644
--- a/base/server/python/pki/server/cli/tps.py
+++ b/base/server/python/pki/server/cli/tps.py
@@ -76,10 +76,10 @@ class TPSClonePrepareCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
- opts, _ = getopt.gnu_getopt(args, 'i:v', [
+ opts, _ = getopt.gnu_getopt(argv, 'i:v', [
'instance=', 'pkcs12-file=', 'pkcs12-password=', 'pkcs12-password-file=',
'verbose', 'help'])
@@ -195,10 +195,10 @@ class TPSDBVLVFindCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
opts, _ = getopt.gnu_getopt(
- args,
+ argv,
'i:D:w:x:g:v',
['instance=', 'bind-dn=', 'bind-password=', 'generate-ldif=',
'verbose', 'help']
@@ -306,10 +306,10 @@ class TPSDBVLVAddCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
opts, _ = getopt.gnu_getopt(
- args,
+ argv,
'i:D:w:x:g:v',
['instance=', 'bind-dn=', 'bind-password=', 'generate-ldif=',
'verbose', 'help']
@@ -419,10 +419,10 @@ class TPSDBVLVDeleteCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
opts, _ = getopt.gnu_getopt(
- args,
+ argv,
'i:D:w:x:g:v',
['instance=', 'bind-dn=', 'bind-password=', 'generate-ldif=',
'verbose', 'help']
@@ -554,10 +554,10 @@ class TPSDBVLVReindexCLI(pki.cli.CLI):
print(' --help Show help message.')
print()
- def execute(self, args):
+ def execute(self, argv):
try:
opts, _ = getopt.gnu_getopt(
- args,
+ argv,
'i:D:w:x:g:v',
['instance=', 'bind-dn=', 'bind-password=', 'generate-ldif=',
'verbose', 'help']
diff --git a/base/server/python/pki/server/upgrade.py b/base/server/python/pki/server/upgrade.py
index 2c72e4864..926c683d7 100644
--- a/base/server/python/pki/server/upgrade.py
+++ b/base/server/python/pki/server/upgrade.py
@@ -38,9 +38,6 @@ SUBSYSTEM_TRACKER = '%s/CS.cfg'
class PKIServerUpgradeScriptlet(pki.upgrade.PKIUpgradeScriptlet):
- def __init__(self):
- super(PKIServerUpgradeScriptlet, self).__init__()
-
def get_backup_dir(self):
return BACKUP_DIR + '/' + str(self.version) + '/' + str(self.index)