<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/targetcli.git/scripts, branch master</title>
<subtitle>github.com: agrover/targetcli-fb.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/targetcli.git/'/>
<entry>
<title>Merge pull request #197 from zoumingzhe/kill</title>
<updated>2023-04-14T08:30:03+00:00</updated>
<author>
<name>Maurizio Lombardi</name>
<email>mlombard@redhat.com</email>
</author>
<published>2023-04-14T08:30:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/targetcli.git/commit/?id=f26c1ae9d255e7db4c3cb51c72dc081e17ad25a4'/>
<id>f26c1ae9d255e7db4c3cb51c72dc081e17ad25a4</id>
<content type='text'>
targetcli: avoild Ctrl+C print error stack</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
targetcli: avoild Ctrl+C print error stack</pre>
</div>
</content>
</entry>
<entry>
<title>targetcli: avoild Ctrl+C print error stack</title>
<updated>2023-03-27T08:44:40+00:00</updated>
<author>
<name>Mingzhe Zou</name>
<email>zoumingzhe@qq.com</email>
</author>
<published>2023-03-27T08:42:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/targetcli.git/commit/?id=b4632c05d8c0a51460fb84ea70820f5136105fff'/>
<id>b4632c05d8c0a51460fb84ea70820f5136105fff</id>
<content type='text'>
Signed-off-by: Mingzhe Zou &lt;zoumingzhe@qq.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Mingzhe Zou &lt;zoumingzhe@qq.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fix setting preference rollback error</title>
<updated>2021-10-22T06:02:05+00:00</updated>
<author>
<name>mingzhe.zou@easystack.cn</name>
<email>mingzhe.zou@easystack.cn</email>
</author>
<published>2021-10-22T05:45:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/targetcli.git/commit/?id=963e4e9d5fbbda2f6bd4865e8f2e71d8253d8879'/>
<id>963e4e9d5fbbda2f6bd4865e8f2e71d8253d8879</id>
<content type='text'>
Setting preference maybe rollback when execute multiple targetcli requests concurrently.
ConfigShell always initialization new Console object.
However, the lockfile need to be opened before requesting flock.
At this time, an exception may occur and need to be output to the console.
Currently, ConfigShell always initializes a new Console object.
So, ConfigShell is initialized first to be able to print information.
The prefs.bin file will be loaded when ConfigShell is initialized.
In this case, the old value may be read, if a new preference is being set and not saved.
In order to solve this problem we must first initialize a Console object.

This patch needs https://github.com/open-iscsi/configshell-fb/pull/62 to be merged first.

Signed-off-by: Zou Mingzhe &lt;mingzhe.zou@easystack.cn&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Setting preference maybe rollback when execute multiple targetcli requests concurrently.
ConfigShell always initialization new Console object.
However, the lockfile need to be opened before requesting flock.
At this time, an exception may occur and need to be output to the console.
Currently, ConfigShell always initializes a new Console object.
So, ConfigShell is initialized first to be able to print information.
The prefs.bin file will be loaded when ConfigShell is initialized.
In this case, the old value may be read, if a new preference is being set and not saved.
In order to solve this problem we must first initialize a Console object.

This patch needs https://github.com/open-iscsi/configshell-fb/pull/62 to be merged first.

Signed-off-by: Zou Mingzhe &lt;mingzhe.zou@easystack.cn&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>daemon-interactive: do not allow clearing the prompt</title>
<updated>2020-04-07T07:06:59+00:00</updated>
<author>
<name>Prasanna Kumar Kalever</name>
<email>prasanna.kalever@redhat.com</email>
</author>
<published>2020-04-07T07:06:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/targetcli.git/commit/?id=534c4759fc27e7ef8e1d477b4909485d2ac4bf91'/>
<id>534c4759fc27e7ef8e1d477b4909485d2ac4bf91</id>
<content type='text'>
Typing somthing and then hitting backspace multiple-times would clear
the prompt previously.

This patch do not let backspace clear the prompt msg.

Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Typing somthing and then hitting backspace multiple-times would clear
the prompt previously.

This patch do not let backspace clear the prompt msg.

Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>daemon-interactive: show path on prompt</title>
<updated>2020-04-06T17:52:59+00:00</updated>
<author>
<name>Prasanna Kumar Kalever</name>
<email>prasanna.kalever@redhat.com</email>
</author>
<published>2020-04-06T14:03:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/targetcli.git/commit/?id=d768df6942385bb1b3447b9950531b40f35ccfed'/>
<id>d768df6942385bb1b3447b9950531b40f35ccfed</id>
<content type='text'>
$ targetcli
targetcli shell version 2.1.51
Entering targetcli interactive mode for daemonized approach.
Type 'exit' to quit.

/&gt; pwd
/
/&gt; cd /iscsi
/iscsi&gt; ls
o- iscsi .......................................... [Targets: 0]
/iscsi&gt; exit

Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
$ targetcli
targetcli shell version 2.1.51
Entering targetcli interactive mode for daemonized approach.
Type 'exit' to quit.

/&gt; pwd
/
/&gt; cd /iscsi
/iscsi&gt; ls
o- iscsi .......................................... [Targets: 0]
/iscsi&gt; exit

Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>daemonized-mode: add interactive shell support</title>
<updated>2020-04-06T17:51:30+00:00</updated>
<author>
<name>Prasanna Kumar Kalever</name>
<email>prasanna.kalever@redhat.com</email>
</author>
<published>2020-04-03T07:31:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/targetcli.git/commit/?id=b60c74594abf6cf681ff8eaa348059c5348399e9'/>
<id>b60c74594abf6cf681ff8eaa348059c5348399e9</id>
<content type='text'>
set interactive mode as default to make it appear similar to cli approach,

$ targetcli
targetcli shell version 2.1.51
Entering targetcli interactive mode for daemonized approach.
Type 'exit' to quit.

/&gt; pwd
/
/&gt; cd /iscsi
/&gt; pwd
/iscsi
/&gt; exit

Here we introduce a new global option daemon_use_batch_mode for switching between
batch and interactive modes.

$ targetcli set global daemon_use_batch_mode=true
Parameter daemon_use_batch_mode is now 'true'.

$ targetcli
targetcli shell version 2.1.51
Entering targetcli batch mode for daemonized approach.
Enter multiple commands separated by newline and type 'exit' to run them
all in one go.

/&gt; pwd
/&gt; cd /iscsi
/&gt; pwd
/
/iscsi

Fixes: #160
Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
set interactive mode as default to make it appear similar to cli approach,

$ targetcli
targetcli shell version 2.1.51
Entering targetcli interactive mode for daemonized approach.
Type 'exit' to quit.

/&gt; pwd
/
/&gt; cd /iscsi
/&gt; pwd
/iscsi
/&gt; exit

Here we introduce a new global option daemon_use_batch_mode for switching between
batch and interactive modes.

$ targetcli set global daemon_use_batch_mode=true
Parameter daemon_use_batch_mode is now 'true'.

$ targetcli
targetcli shell version 2.1.51
Entering targetcli batch mode for daemonized approach.
Enter multiple commands separated by newline and type 'exit' to run them
all in one go.

/&gt; pwd
/&gt; cd /iscsi
/&gt; pwd
/
/iscsi

Fixes: #160
Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Use temp file objects for temporary storage area</title>
<updated>2020-04-03T18:28:23+00:00</updated>
<author>
<name>Prasanna Kumar Kalever</name>
<email>prasanna.kalever@redhat.com</email>
</author>
<published>2020-04-03T14:36:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/targetcli.git/commit/?id=4f6611ed208b6029b4523ca7760a802e82b6a199'/>
<id>4f6611ed208b6029b4523ca7760a802e82b6a199</id>
<content type='text'>
happen to see yet another issue after we switch to stringIO/bytesIO:

$ targetcli ls
'unicode' does not have the buffer interface

After which I felt like dealing with StringIO/BytesIO is like a
wild goose chase and we are after all attempting to deal with python
incompatible apis.

Technically speaking, the rtslib and configshell libraries are expecting a
string IO stream, but then for python2 with ByteIO() we are passing a
bytestream, and stringIO() is behaving a bit different in python2 than
expected as explained in my previous patch.

Lets simply switch to temporary file in the most secure manner possible,
opening files in string mode will assure the compatibility across the platforms.

At the end we wish to have a consistent behaviour across all python versions.

Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
happen to see yet another issue after we switch to stringIO/bytesIO:

$ targetcli ls
'unicode' does not have the buffer interface

After which I felt like dealing with StringIO/BytesIO is like a
wild goose chase and we are after all attempting to deal with python
incompatible apis.

Technically speaking, the rtslib and configshell libraries are expecting a
string IO stream, but then for python2 with ByteIO() we are passing a
bytestream, and stringIO() is behaving a bit different in python2 than
expected as explained in my previous patch.

Lets simply switch to temporary file in the most secure manner possible,
opening files in string mode will assure the compatibility across the platforms.

At the end we wish to have a consistent behaviour across all python versions.

Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>targetcli: depreciate the redundant '--tcp' option</title>
<updated>2019-11-04T06:04:44+00:00</updated>
<author>
<name>Prasanna Kumar Kalever</name>
<email>prasanna.kalever@redhat.com</email>
</author>
<published>2019-10-31T11:32:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/targetcli.git/commit/?id=9cdf76f57ab71a3622acfa910983844b6bfabd36'/>
<id>9cdf76f57ab71a3622acfa910983844b6bfabd36</id>
<content type='text'>
It looks like '--tcp' option is no more needed after our recent
global auto_use_daemon flag addition, which helps set/unset the
daemonized approach.

Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It looks like '--tcp' option is no more needed after our recent
global auto_use_daemon flag addition, which helps set/unset the
daemonized approach.

Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: show useful hint in header area of shell in daemonized mode</title>
<updated>2019-10-30T10:30:04+00:00</updated>
<author>
<name>Prasanna Kumar Kalever</name>
<email>prasanna.kalever@redhat.com</email>
</author>
<published>2019-10-18T14:13:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/targetcli.git/commit/?id=24cc497c02b97b834d535431ec50d3f75c18ddcd'/>
<id>24cc497c02b97b834d535431ec50d3f75c18ddcd</id>
<content type='text'>
Problem:
-------
When auto_use_daemon=true, entering multi-line command-mode/shell-mode appears
like the cli is stuck for new users, as we do not display any info now :-)

$ targetcli
---- nothing here, is it stuck ? -------

$ targetcli
cd /backstores/
get global auto_use_daemon
pwd
ls
exit
auto_use_daemon=true
/backstores
o- backstores ................................................ [...]
  o- block .................................... [Storage Objects: 0]
  o- fileio ................................... [Storage Objects: 0]
  o- pscsi .................................... [Storage Objects: 0]
  o- ramdisk .................................. [Storage Objects: 0]
  o- user:glfs ................................ [Storage Objects: 0]

Solution:
-------

Add some userful info and a '/&gt; ' in each line,

$ targetcli
targetcli shell version 2.1.50
Entering targetcli batch mode for daemonized approach.
Enter multiple commands separated by newline and type 'exit' to run them all in one go.

/&gt; cd /backstores/
/&gt; get global auto_use_daemon
/&gt; pwd
/&gt; ls
/&gt; exit
auto_use_daemon=true
/backstores
o- backstores ................................................ [...]
  o- block .................................... [Storage Objects: 0]
  o- fileio ................................... [Storage Objects: 0]
  o- pscsi .................................... [Storage Objects: 0]
  o- ramdisk .................................. [Storage Objects: 0]
  o- user:glfs ................................ [Storage Objects: 0]

Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
-------
When auto_use_daemon=true, entering multi-line command-mode/shell-mode appears
like the cli is stuck for new users, as we do not display any info now :-)

$ targetcli
---- nothing here, is it stuck ? -------

$ targetcli
cd /backstores/
get global auto_use_daemon
pwd
ls
exit
auto_use_daemon=true
/backstores
o- backstores ................................................ [...]
  o- block .................................... [Storage Objects: 0]
  o- fileio ................................... [Storage Objects: 0]
  o- pscsi .................................... [Storage Objects: 0]
  o- ramdisk .................................. [Storage Objects: 0]
  o- user:glfs ................................ [Storage Objects: 0]

Solution:
-------

Add some userful info and a '/&gt; ' in each line,

$ targetcli
targetcli shell version 2.1.50
Entering targetcli batch mode for daemonized approach.
Enter multiple commands separated by newline and type 'exit' to run them all in one go.

/&gt; cd /backstores/
/&gt; get global auto_use_daemon
/&gt; pwd
/&gt; ls
/&gt; exit
auto_use_daemon=true
/backstores
o- backstores ................................................ [...]
  o- block .................................... [Storage Objects: 0]
  o- fileio ................................... [Storage Objects: 0]
  o- pscsi .................................... [Storage Objects: 0]
  o- ramdisk .................................. [Storage Objects: 0]
  o- user:glfs ................................ [Storage Objects: 0]

Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cli: provide a way to disable using daemon</title>
<updated>2019-10-30T10:27:15+00:00</updated>
<author>
<name>Prasanna Kumar Kalever</name>
<email>prasanna.kalever@redhat.com</email>
</author>
<published>2019-10-18T12:30:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/targetcli.git/commit/?id=b36f0a0e27cdea9128cdf71e696e05bdfd12e462'/>
<id>b36f0a0e27cdea9128cdf71e696e05bdfd12e462</id>
<content type='text'>
Problem:
-------
Currently when auto_use_daemon is set to true and in case for some
reasons user do not want to start the daemon or the dameon is not starting
succefully for some unknown reason, then there is no way to bypass the
calls to dameon and use cli directly

$ targetcli pwd
[Errno 111] Connection refused

Solution:
--------
Provide an option with cli to turn auto_use_daemon to false.

$ targetcli pwd
[Errno 111] Connection refused
Currently auto_use_daemon is true, hence please make sure targetclid daemon is running ...
(or)
Incase if you wish to turn auto_use_daemon to false then run '#targetcli --disable-daemon'

$ targetcli --help
Usage: ./scripts/targetcli [--version|--help|CMD|--tcp|--disable-daemon]
[...]
  --disable-daemon         Turn-off the global auto use daemon flag
See man page for more information.

$ targetcli --disable-daemon
Parameter auto_use_daemon is now 'false'.

$ targetcli pwd
/

Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
-------
Currently when auto_use_daemon is set to true and in case for some
reasons user do not want to start the daemon or the dameon is not starting
succefully for some unknown reason, then there is no way to bypass the
calls to dameon and use cli directly

$ targetcli pwd
[Errno 111] Connection refused

Solution:
--------
Provide an option with cli to turn auto_use_daemon to false.

$ targetcli pwd
[Errno 111] Connection refused
Currently auto_use_daemon is true, hence please make sure targetclid daemon is running ...
(or)
Incase if you wish to turn auto_use_daemon to false then run '#targetcli --disable-daemon'

$ targetcli --help
Usage: ./scripts/targetcli [--version|--help|CMD|--tcp|--disable-daemon]
[...]
  --disable-daemon         Turn-off the global auto use daemon flag
See man page for more information.

$ targetcli --disable-daemon
Parameter auto_use_daemon is now 'false'.

$ targetcli pwd
/

Signed-off-by: Prasanna Kumar Kalever &lt;prasanna.kalever@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
