Remove unused variables in the code

This commit removes unused variables or rename variables as "expected to
be unused" by using "_" prefix.

This covers only cases where fix was easy or only one unused variable
was in a module

Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
Martin Basti
2016-09-27 13:35:58 +02:00
parent 452b08754d
commit 0f88f8fe88
47 changed files with 54 additions and 69 deletions
@@ -34,7 +34,7 @@ def retrieve_keytab(api, ccache_name, oneway_keytab_name, oneway_principal):
try:
sssd = pwd.getpwnam(constants.SSSD_USER)
os.chown(oneway_keytab_name, sssd[2], sssd[3])
except KeyError as e:
except KeyError:
# If user 'sssd' does not exist, we don't need to chown from root to sssd
# because it means SSSD does not run as sssd user
pass
+1 -1
View File
@@ -113,7 +113,7 @@ def main():
standard_logging_setup(verbose=True)
# In 3.0, restarting needs access to api.env
(options, argv) = api.bootstrap_with_global_options(context='server')
api.bootstrap_with_global_options(context='server')
add_ca_schema()
restart_pki_ds()
-4
View File
@@ -232,9 +232,6 @@ def del_link(realm, replica1, replica2, dirman_passwd, force=False):
print("Deleted replication agreement from '%s' to '%s'" % (replica1, replica2))
def del_master(realm, hostname, options):
force_del = False
delrepl = None
# 1. Connect to the local dogtag DS server
@@ -258,7 +255,6 @@ def del_master(realm, hostname, options):
sys.exit(1)
else:
print("Unable to connect to replica %s, forcing removal" % hostname)
force_del = True
# 4. Get list of agreements.
if delrepl is None:
+1 -1
View File
@@ -89,7 +89,7 @@ def parse_options():
parser.add_option("--force", dest="force", action="store_true",
help="Force install")
options, args = parser.parse_args()
options, _args = parser.parse_args()
safe_options = parser.get_safe_opts(options)
if options.dnssec_master and options.disable_dnssec_master:
+1 -1
View File
@@ -185,7 +185,7 @@ def parse_options():
parser.add_option("--no-log", dest="log_to_file", action="store_false",
default=True, help="Do not log into file")
options, args = parser.parse_args()
options, _args = parser.parse_args()
safe_options = parser.get_safe_opts(options)
if options.master and options.replica: