Pylint: fix definition of global variables

Global variables should be defined in the outer space, not just marked
as global inside functions.

Removes unused global variables

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
This commit is contained in:
Martin Basti 2016-03-17 18:40:04 +01:00
parent 491447cc5a
commit e93e89e1ae
4 changed files with 8 additions and 8 deletions

View File

@ -74,6 +74,11 @@ CLIENT_NOT_CONFIGURED = 2
CLIENT_ALREADY_CONFIGURED = 3
CLIENT_UNINSTALL_ERROR = 4 # error after restoring files/state
fstore = sysrestore.FileStore(paths.IPA_CLIENT_SYSRESTORE)
statestore = sysrestore.StateFile(paths.IPA_CLIENT_SYSRESTORE)
def parse_options():
def validate_ca_cert_file_option(option, opt, value, parser):
if not os.path.exists(value):
@ -3068,12 +3073,6 @@ def main():
env={"PATH":"/bin:/sbin:/usr/kerberos/bin:/usr/kerberos/sbin:/usr/bin:/usr/sbin"}
global fstore
fstore = sysrestore.FileStore(paths.IPA_CLIENT_SYSRESTORE)
global statestore
statestore = sysrestore.StateFile(paths.IPA_CLIENT_SYSRESTORE)
if options.uninstall:
return uninstall(options, env)

View File

@ -238,7 +238,6 @@ def main():
check_server_configuration()
global fstore
fstore = sysrestore.FileStore(paths.SYSRESTORE)
print("==============================================================================")

View File

@ -16,6 +16,9 @@ from ipalib import api, certstore, x509
from ipapython.dn import DN
from ipapython.ipa_log_manager import root_logger
external_cert_file = None
external_ca_file = None
def install_check(standalone, replica_config, options):
global external_cert_file

View File

@ -33,7 +33,6 @@ disable=
fixme,
global-statement,
global-variable-not-assigned,
global-variable-undefined,
no-init,
pointless-except,
pointless-statement,