Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GH-7079] Added verbose param to h2o.init() and guarded h2o.conn.show_status() in h20.py #7079 [nocheck] #15653

Merged
merged 10 commits into from
Oct 10, 2023
Prev Previous commit
Next Next commit
Added verbose paramerter to init() in h2o.py also guarded h2oconn.clu…
…ster.show_status()
  • Loading branch information
Mohit1345 committed Aug 17, 2023
commit 465532b2fb1bad3a248ceedef5e243e762c2567f
13 changes: 8 additions & 5 deletions h2o-py/h2o/h2o.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, **kwargs,verbose = True):
"""
Attempt to connect to a local server, or if not successful start a new server and connect to it.

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand All @@ -286,12 +287,14 @@ 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):
Expand Down