Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] Documentation: add exception capture function
@ 2023-01-15 11:05 shijm
  2023-01-19 21:20 ` Jonathan Corbet
  0 siblings, 1 reply; 3+ messages in thread
From: shijm @ 2023-01-15 11:05 UTC (permalink / raw)
  To: Corbet; +Cc: linux-scsi, shijm

Add exception capture function

Signed-off-by: shijm <junming@nfschina.com>
---
 Documentation/target/tcm_mod_builder.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/target/tcm_mod_builder.py b/Documentation/target/tcm_mod_builder.py
index 54492aa813b9..5b28d50ed80f 100755
--- a/Documentation/target/tcm_mod_builder.py
+++ b/Documentation/target/tcm_mod_builder.py
@@ -29,8 +29,9 @@ def tcm_mod_create_module_subdir(fabric_mod_dir_var):
 		return 1
 
 	print "Creating fabric_mod_dir: " + fabric_mod_dir_var
-	ret = os.mkdir(fabric_mod_dir_var)
-	if ret:
+    try:
+	    ret = os.mkdir(fabric_mod_dir_var)
+	except:
 		tcm_mod_err("Unable to mkdir " + fabric_mod_dir_var)
 
 	return
-- 
2.18.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Documentation: add exception capture function
  2023-01-15 11:05 [PATCH] Documentation: add exception capture function shijm
@ 2023-01-19 21:20 ` Jonathan Corbet
  2023-01-19 21:59   ` Bart Van Assche
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Corbet @ 2023-01-19 21:20 UTC (permalink / raw)
  To: shijm; +Cc: linux-scsi, shijm

shijm <junming@nfschina.com> writes:

> Add exception capture function
>
> Signed-off-by: shijm <junming@nfschina.com>

This says what you are doing but not why; nobody has felt the need to
mess with this script for a while; why do we need to change it now?

>  Documentation/target/tcm_mod_builder.py | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/target/tcm_mod_builder.py b/Documentation/target/tcm_mod_builder.py
> index 54492aa813b9..5b28d50ed80f 100755
> --- a/Documentation/target/tcm_mod_builder.py
> +++ b/Documentation/target/tcm_mod_builder.py
> @@ -29,8 +29,9 @@ def tcm_mod_create_module_subdir(fabric_mod_dir_var):
>  		return 1
>  
>  	print "Creating fabric_mod_dir: " + fabric_mod_dir_var
> -	ret = os.mkdir(fabric_mod_dir_var)
> -	if ret:
> +    try:
> +	    ret = os.mkdir(fabric_mod_dir_var)
> +	except:
>  		tcm_mod_err("Unable to mkdir " + fabric_mod_dir_var)

Bare "except" clauses are generally a bad idea in my exception; I assume
you want to catch IOError here?

Assuming that this script is still useful, we should consider moving it
to tools/.

Thanks,

jon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Documentation: add exception capture function
  2023-01-19 21:20 ` Jonathan Corbet
@ 2023-01-19 21:59   ` Bart Van Assche
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Van Assche @ 2023-01-19 21:59 UTC (permalink / raw)
  To: Jonathan Corbet, shijm; +Cc: linux-scsi, Mike Christie, Christoph Hellwig

On 1/19/23 13:20, Jonathan Corbet wrote:
> Assuming that this script is still useful, we should consider moving it
> to tools/.

I'm not sure this script has ever been used after it was added to the 
kernel tree.

Thanks,

Bart.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-19 22:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-15 11:05 [PATCH] Documentation: add exception capture function shijm
2023-01-19 21:20 ` Jonathan Corbet
2023-01-19 21:59   ` Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox