Commit Graph

7 Commits

Author SHA1 Message Date
paul luse
17538bdc67 add (c) and SPDX header to python files as needed
per Intel policy to include file commit date using git cmd
below.  The policy does not apply to non-Intel (C) notices.

git log --follow -C90% --format=%ad --date default <file> | tail -1

and then pull just the year from the result.

Intel copyrights were not added to files where Intel either had
no contribution ot the contribution lacked substance (ie license
header updates, formatting changes, etc)

Note that several files in this patch didn't end the license/(c)
block with a blank comment line so these were added as the vast
majority of files do have this last blank line.  Simply there for
consistency.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I6cd3f18d1b469d5ef249d26ddb2923ca6b970bd4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15208
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-11-10 08:28:53 +00:00
Konrad Sztyber
7610bc38dc scripts: move python modules to python directory
Up until now, importing an SPDK RPC python module was just a matter of
`import rpc`.  It's fine until there's another module called `rpc`
installed on the system, in which case it's impossible to import both of
them.  Therefore, to avoid this problem, all of the modules were moved
to a separate directory under the "spdk" namespace.

The decision to move to a location under a separate directory was
motivated by the fact that a directory called scripts/spdk would look
pretty confusing.  Moreover, it should make it also easier to package
these scripts as a python package.

Other than moving the packages, all of the imports were updated to
reflect these changes.  Files under python now use relative imports,
while those under scripts/ use the "spdk" namespace and have their
PYTHONPATH extended with python directory.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ib43dee73921d590a551dd83885e22870e72451cf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9692
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-04-05 14:40:47 +00:00
Boris Glimcher
637f1a101c scripts/rpc_http_proxy: Handled chunked data
'Content-Length' is not always available
specifically when using 'chunked' Transfer-Encoding

https://en.wikipedia.org/wiki/Chunked_transfer_encoding

This patch allows to handle chunked data transfer
and construct the request from peices.

The example of how to send chunked data:

> curl -k --user spdkuser:spdkpass -X POST -H "Content-Type: application/json" \
                                           -H "Transfer-Encoding: chunked" \
                                   -d '{"id": 1, "method": "bdev_get_bdevs"}' \
                                   http://127.0.0.1:9009/

vs

> curl -k --user spdkuser:spdkpass -X POST -H "Content-Type: application/json" \
                                   -d '{"id": 1, "method": "bdev_get_bdevs"}' \
                                   http://127.0.0.1:9009/

Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Change-Id: I6cf565d6639aa31898585f005d75785c43204552
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12082
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-03-31 09:35:32 +00:00
Michal Berger
8770e80bda scripts/rpc_http_proxy: Print to stdout POSTed json rpc calls and responses
It's useful to determine what's being sent out to the server. This
may be relevant for e.g. openstack tests where currently it's hard
to see what tempest|cinder is actually doing, SPDK-wise, during the
tests.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ie32781621317dd65e3f6fbcfd5110e7dac337f04
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8489
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-07-09 19:19:48 +00:00
Maciej Szwed
2bd001620f scripts: Add SSL certificate option in rpc_http_proxy
This is required for SSL verification when running on https.
Added argparse to handle multiple optional arguments.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ib8731bafaaf38264ed86ed84ca7eeca5ff4935b3

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2122
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-05-05 08:04:00 +00:00
shahar salzman
21cfc857ff scripts, test: fix python overindent issues
Signed-off-by: shahar salzman <shahar.salzman@kaminario.com>
Change-Id: I52f3b39d1ae7d0454a2a3d5f2564aae2c758cab7
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449992
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-04 03:59:12 +00:00
Maciej Szwed
5a7f29dd6d scripts: Remote RPC access with authentication
This patch introduces script that may be used for
sending RPC commands from remote machine. This script
requires remote user to authenticate with user name
and password set at launch time.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I4ef7c870f3ea760c44da63ba4c16954aa54d4473

Reviewed-on: https://review.gerrithub.io/426531
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-10-31 16:49:17 +00:00