Repository :
http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
---------------------------------------------------------------
commit b1d5284feb0636a05a6070c46c4fde7641eb6d4e
Author: Peter Hatina <phatina(a)redhat.com>
Date: Mon Sep 2 16:35:22 2013 +0200
rename verify_certificate
Preparation for naming exactness, when introducing client certificate authentication.
---------------------------------------------------------------
cli/lmi/shell/LMIBaseClient.py | 6 +++---
cli/lmi/shell/LMIConnection.py | 14 +++++++-------
cli/lmi/shell/LMIConsole.py | 12 ++++++------
cli/lmi/shell/LMIShellClient.py | 6 +++---
cli/lmi/shell/LMIShellOptions.py | 2 +-
cli/lmishell | 2 +-
6 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/cli/lmi/shell/LMIBaseClient.py b/cli/lmi/shell/LMIBaseClient.py
index 8ccb079..85fe161 100644
--- a/cli/lmi/shell/LMIBaseClient.py
+++ b/cli/lmi/shell/LMIBaseClient.py
@@ -32,7 +32,7 @@ class LMIBaseClient(object):
CONN_TYPE_PEGASUS_UDS = range(2)
def __init__(self, hostname, username="", password="",
conn_type=CONN_TYPE_WBEM, \
- verify_certificate=True):
+ verify_server_cert=True):
"""
Constructs a LMIBaseClient object.
@@ -45,7 +45,7 @@ class LMIBaseClient(object):
LMIBaseClient.CONN_TYPE_PEGASUS_UDS -- applicable only for Tog-Pegasus
CIMOM, it uses unix socket for the connection; default value is
CONN_TYPE_WBEM
- verify_certificate -- flag indicating, whether a server side certificate
+ verify_server_cert -- flag indicating, whether a server side certificate
needs to be verified, if SSL used
"""
def verify_callback(conn, cert, errno, errdepth, rcode):
@@ -72,7 +72,7 @@ class LMIBaseClient(object):
else:
self._cliconn = pywbem.WBEMConnection(self._hostname,
(self._username, password),
- verify_callback=verify_callback if verify_certificate else None
+ verify_callback=verify_callback if verify_server_cert else None
)
# NOTE: usage with Key=something, Value=something is deprecated
diff --git a/cli/lmi/shell/LMIConnection.py b/cli/lmi/shell/LMIConnection.py
index 5dfa5fe..27191d3 100644
--- a/cli/lmi/shell/LMIConnection.py
+++ b/cli/lmi/shell/LMIConnection.py
@@ -82,7 +82,7 @@ def __lmi_raw_input(prompt, use_echo=True):
return result
def connect(hostname, username="", password="", interactive=False,
use_cache=True,
- verify_certificate=True, prompt_prefix=''):
+ verify_server_cert=True, prompt_prefix=''):
"""
Returns a LMIConnection object with provided hostname and credentials.
@@ -96,7 +96,7 @@ def connect(hostname, username="", password="",
interactive=False, use_cache=Tru
CIMClass objects. This saves a lot's of communication, if there is
often the LMIShellClient._get_class_names() or ._get_class() call
issued.
- verify_certificate -- flag indicating, whether a server side certificate
+ verify_server_cert -- flag indicating, whether a server side certificate
needs to be verified, if SSL used
prompt_prefix -- string prefixing username and password prompts in case
the user is asked for credentials
@@ -108,7 +108,7 @@ def connect(hostname, username="", password="",
interactive=False, use_cache=Tru
os.path.exists("/var/run/tog-pegasus/cimxml.socket") and \
not username and not password:
connection = LMIConnection(hostname, None, None, interactive,
- use_cache, LMIBaseClient.CONN_TYPE_PEGASUS_UDS, verify_certificate)
+ use_cache, LMIBaseClient.CONN_TYPE_PEGASUS_UDS, verify_server_cert)
if not connection.verify_credentials():
connection = None
if connection is None:
@@ -122,7 +122,7 @@ def connect(hostname, username="", password="",
interactive=False, use_cache=Tru
sys.stdout.write("\n")
return None
connection = LMIConnection(hostname, username, password, interactive,
- use_cache, LMIBaseClient.CONN_TYPE_WBEM, verify_certificate)
+ use_cache, LMIBaseClient.CONN_TYPE_WBEM, verify_server_cert)
if not connection.verify_credentials():
return None
return connection
@@ -134,7 +134,7 @@ class LMIConnection(object):
the namespace/classes/instances/methods hierarchy present in the LMIShell.
"""
def __init__(self, hostname, username="", password="",
interactive=False, use_cache=True, \
- conn_type=LMIBaseClient.CONN_TYPE_WBEM, verify_certificate=True):
+ conn_type=LMIBaseClient.CONN_TYPE_WBEM, verify_server_cert=True):
"""
Constructs a LMIConnection object.
@@ -148,11 +148,11 @@ class LMIConnection(object):
CIMClass objects. This saves a lot's of communication, if there is
often the LMIShellClient._get_class_names() or ._get_class() call
issued.
- verify_certificate -- flag indicating, whether a server side certificate
+ verify_server_cert -- flag indicating, whether a server side certificate
needs to be verified, if SSL used
"""
self._client = LMIShellClient(hostname, username, password, interactive,
use_cache,
- conn_type, verify_certificate)
+ conn_type, verify_server_cert)
self._indications = {}
# Register LMIConnection.__unsubscribe_all_indications() to be called at
LMIShell's exit.
atexit.register(lambda: self.__unsubscribe_all_indications())
diff --git a/cli/lmi/shell/LMIConsole.py b/cli/lmi/shell/LMIConsole.py
index 1a0bd3e..c0ffe3a 100644
--- a/cli/lmi/shell/LMIConsole.py
+++ b/cli/lmi/shell/LMIConsole.py
@@ -85,7 +85,7 @@ class LMIConsole(code.InteractiveConsole):
self._history_length = config.history_length
self._use_cache = config.use_cache
self._use_exceptions = config.use_exceptions
- self._verify_certificate = True
+ self._verify_server_cert = True
# Setup LMIShell-wide option, which defines, whether the LMIShell
# should propagate caught exceptions, or dump them
@@ -116,7 +116,7 @@ class LMIConsole(code.InteractiveConsole):
password -- user's password
"""
return connect_internal(hostname, username, password, True,
- self._use_cache, self._verify_certificate)
+ self._use_cache, self._verify_server_cert)
# Initialize the interpreter
if locals is None:
@@ -194,7 +194,7 @@ class LMIConsole(code.InteractiveConsole):
password -- user's password
"""
return connect_internal(hostname, username, password, False,
- self._use_cache, self._verify_certificate)
+ self._use_cache, self._verify_server_cert)
# Initialize locals
if locals is None:
locals = {}
@@ -248,12 +248,12 @@ class LMIConsole(code.InteractiveConsole):
"""
readline.clear_history()
- def set_verify_certificate(self, verify_certificate=True):
+ def set_verify_server_certificate(self, verify_server_cert=True):
"""
Turns on or off server side certificate verification, if SSL used.
Arguments:
- verify_certificate -- flag indicating, whether a server side certificate
+ verify_server_cert -- flag indicating, whether a server side certificate
needs to be verified, if SSL used
"""
- self._verify_certificate = verify_certificate
+ self._verify_server_cert = verify_server_cert
diff --git a/cli/lmi/shell/LMIShellClient.py b/cli/lmi/shell/LMIShellClient.py
index 3b7b473..59e28ad 100644
--- a/cli/lmi/shell/LMIShellClient.py
+++ b/cli/lmi/shell/LMIShellClient.py
@@ -24,7 +24,7 @@ class LMIShellClient(LMIBaseClient):
This class overrides few methods due to caching.
"""
def __init__(self, hostname, username="", password="",
interactive=False, use_cache=True, \
- conn_type=LMIBaseClient.CONN_TYPE_WBEM, verify_certificate=True):
+ conn_type=LMIBaseClient.CONN_TYPE_WBEM, verify_server_cert=True):
"""
Constructs a LMIShellClient object.
@@ -43,11 +43,11 @@ class LMIShellClient(LMIBaseClient):
LMIBaseClient.CONN_TYPE_PEGASUS_UDS -- applicable only for Tog-Pegasus
CIMOM, it uses unix socket for the connection; default value is
CONN_TYPE_WBEM
- verify_certificate -- flag indicating, whether a server side certificate
+ verify_server_cert -- flag indicating, whether a server side certificate
needs to be verified, if SSL used
"""
super(LMIShellClient, self).__init__(hostname, username, password, conn_type,
- verify_certificate)
+ verify_server_cert)
self._interactive = interactive
self._cache = LMIShellCache(use_cache)
diff --git a/cli/lmi/shell/LMIShellOptions.py b/cli/lmi/shell/LMIShellOptions.py
index 4c26839..74d9586 100644
--- a/cli/lmi/shell/LMIShellOptions.py
+++ b/cli/lmi/shell/LMIShellOptions.py
@@ -155,7 +155,7 @@ class LMIShellOptions(object):
return self._log
@property
- def verify_certificate(self):
+ def verify_server_cert(self):
"""
Property returning bool flag, which indicates, if LMIShell should verify
server side certificate, if SSL used.
diff --git a/cli/lmishell b/cli/lmishell
index b9ee4e6..e493af5 100755
--- a/cli/lmishell
+++ b/cli/lmishell
@@ -42,7 +42,7 @@ if __name__ == "__main__":
logger.addHandler(logging.StreamHandler(sys.stderr))
console = LMIConsole()
- console.set_verify_certificate(options.verify_certificate)
+ console.set_verify_server_certificate(options.verify_server_cert)
if options.interactive:
console.interact()
else: