They were missed by the initial set of patches which introduced this header as a mandatory one across different types of files. Signed-off-by: Michal Berger <michal.berger@intel.com> Change-Id: I3f9b37d41298c843e1648e72fe8593768ccd37e0 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15423 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
36 lines
892 B
Python
36 lines
892 B
Python
# SPDX-License-Identifier: BSD-3-Clause
|
|
# Copyright (C) 2021 Intel Corporation.
|
|
# All rights reserved.
|
|
|
|
args_global = ['server_addr', 'port', 'timeout', 'verbose', 'dry_run', 'conn_retries',
|
|
'is_server', 'rpc_plugin', 'called_rpc_name', 'func', 'client']
|
|
|
|
|
|
def strip_globals(kwargs):
|
|
for arg in args_global:
|
|
kwargs.pop(arg, None)
|
|
|
|
|
|
def remove_null(kwargs):
|
|
keys = []
|
|
for key, value in kwargs.items():
|
|
if value is None:
|
|
keys.append(key)
|
|
|
|
for key in keys:
|
|
kwargs.pop(key, None)
|
|
|
|
|
|
def apply_defaults(kwargs, **defaults):
|
|
for key, value in defaults.items():
|
|
if key not in kwargs:
|
|
kwargs[key] = value
|
|
|
|
|
|
def group_as(kwargs, name, values):
|
|
group = {}
|
|
for arg in values:
|
|
if arg in kwargs and kwargs[arg] is not None:
|
|
group[arg] = kwargs.pop(arg, None)
|
|
kwargs[name] = group
|