From 54067658796ee47adb6dfb49ea727e472d8d708f Mon Sep 17 00:00:00 2001 From: Mohit Chawla <98903945+Mohit1345@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:56:41 +0530 Subject: [PATCH] [GH-7079] Added verbose param to h2o.init() and guarded h2o.conn.show_status() in h20.py #7079 [nocheck] (#15653) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [GH-15687] Extract string comparators from Duke library (#15692) * [GH-15680] Adding installation disclaimer in documentation (#15681) * ht/adding disclaimer in docs * ht/added flow & download page * ht/updated download page * ht/added security documentation section * ht/user guide updates * ht/uniformity * ht/added additional note to welcome page * callouts * ht/banner color switch * ht/rename callout --------- Co-authored-by: Jeff Fohl * GH-15672: Tomas Fryda suggested instead of changing every test, the change should be made in standalone test. He provides the code and I just copied and pasted. (#15675) * Added verbose paramerter to init() in h2o.py also guarded h2oconn.cluster.show_status() * changes verbose param position before ** kwargs * final commit * removed space, and made it in rel-3.42.0 * added space --------- Co-authored-by: Marek Novotný Co-authored-by: Hannah <52463461+hannah-tillman@users.noreply.github.com> Co-authored-by: Jeff Fohl Co-authored-by: wendycwong --- h2o-py/h2o/h2o.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/h2o-py/h2o/h2o.py b/h2o-py/h2o/h2o.py index 1611e6d908b6..01b7b21a8027 100644 --- a/h2o-py/h2o/h2o.py +++ b/h2o-py/h2o/h2o.py @@ -136,7 +136,7 @@ def connection(): def init(url=None, ip=None, port=None, name=None, https=None, cacert=None, insecure=None, username=None, password=None, cookies=None, proxy=None, start_h2o=True, nthreads=-1, ice_root=None, log_dir=None, log_level=None, max_log_file_size=None, enable_assertions=True, max_mem_size=None, min_mem_size=None, strict_version_check=None, - ignore_config=False, extra_classpath=None, jvm_custom_args=None, bind_to_localhost=True, **kwargs): + ignore_config=False, extra_classpath=None, jvm_custom_args=None, bind_to_localhost=True, verbose = True, **kwargs): """ Attempt to connect to a local server, or if not successful start a new server and connect to it. @@ -179,6 +179,7 @@ def init(url=None, ip=None, port=None, name=None, https=None, cacert=None, insec :param kwargs: (all other deprecated attributes) :param jvm_custom_args: Customer, user-defined argument's for the JVM H2O is instantiated in. Ignored if there is an instance of H2O already running and the client connects to it. :param bind_to_localhost: A flag indicating whether access to the H2O instance should be restricted to the local machine (default) or if it can be reached from other computers on the network. + :param verbose: Set to False to disable printing connection status and info messages. :examples: @@ -267,7 +268,7 @@ def get_mem_size(mmint, mmgb): try: h2oconn = H2OConnection.open(url=url, ip=ip, port=port, name=name, https=https, verify_ssl_certificates=verify_ssl_certificates, cacert=cacert, - auth=auth, proxy=proxy, cookies=cookies, verbose=True, + auth=auth, proxy=proxy, cookies=cookies, verbose=verbose, msgs=("Checking whether there is an H2O instance running at {url}", "connected.", "not found."), strict_version_check=svc) @@ -286,13 +287,13 @@ def get_mem_size(mmint, mmgb): min_mem_size=mmin, ice_root=ice_root, log_dir=log_dir, log_level=log_level, max_log_file_size=max_log_file_size, port=port, name=name, extra_classpath=extra_classpath, jvm_custom_args=jvm_custom_args, - bind_to_localhost=bind_to_localhost) + bind_to_localhost=bind_to_localhost,verbose=verbose) h2oconn = H2OConnection.open(server=hs, https=https, verify_ssl_certificates=verify_ssl_certificates, - cacert=cacert, auth=auth, proxy=proxy, cookies=cookies, verbose=True, + cacert=cacert, auth=auth, proxy=proxy, cookies=cookies, verbose=verbose, strict_version_check=svc) h2oconn.cluster.timezone = "UTC" - h2oconn.cluster.show_status() - + if verbose: + h2oconn.cluster.show_status() def resume(recovery_dir=None): """