Bug 1596167

Summary: Cannot delete /backstores/fileio/ object in targetcli
Product: Red Hat Enterprise Linux 7 Reporter: yisun
Component: targetcliAssignee: Maurizio Lombardi <mlombard>
Status: CLOSED NOTABUG QA Contact: Storage QE <storage-qe>
Severity: high Docs Contact:
Priority: high    
Version: 7.5CC: mchristi, mlombard, prasanna.kalever, toneata, yisun
Target Milestone: rcKeywords: Automation, AutomationBlocker, Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-28 12:21:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description yisun 2018-06-28 11:16:08 UTC
Description of problem:
Cannot delete /backstores/fileio/ object

Version-Release number of selected component (if applicable):
targetcli-2.1.fb46-6.el7_5.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create a /backstores/fileio/ object
#dd if=/dev/zero of=/tmp/backstorage count=2000 bs=1024K
2000+0 records in
2000+0 records out
2097152000 bytes (2.1 GB) copied, 0.606228 s, 3.5 GB/s

# targetcli /backstores/fileio/ create device.storage_pool /tmp/backstorage
Created fileio device.storage_pool with size 2097152000

2. try to delete it
# targetcli /backstores/fileio/ delete device.storage_pool
delete() got an unexpected keyword argument 'save'


3.delete it in interactive console
# targetcli
targetcli shell version 2.1.fb46
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.

/> ls
o- / ......................................................................................................................... [...]
  o- backstores .............................................................................................................. [...]
  | o- block .................................................................................................. [Storage Objects: 0]
  | o- fileio ................................................................................................. [Storage Objects: 1]
  | | o- device.storage_pool .................................................... [/tmp/backstorage (2.0GiB) write-back deactivated]
  | |   o- alua ................................................................................................... [ALUA Groups: 1]
  | |     o- default_tg_pt_gp ....................................................................... [ALUA state: Active/optimized]
  | o- pscsi .................................................................................................. [Storage Objects: 0]
  | o- ramdisk ................................................................................................ [Storage Objects: 0]
  o- iscsi ............................................................................................................ [Targets: 0]
  o- loopback ......................................................................................................... [Targets: 0]
  o- xen_pvscsi ....................................................................................................... [Targets: 0]
/> backstores/fileio/ delete device.storage_pool 
Traceback (most recent call last):
  File "/usr/bin/targetcli", line 122, in <module>
    main()
  File "/usr/bin/targetcli", line 112, in main
    shell.run_interactive()
  File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 905, in run_interactive
    self._cli_loop()
  File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 734, in _cli_loop
    self.run_cmdline(cmdline)
  File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 848, in run_cmdline
    self._execute_command(path, command, pparams, kparams)
  File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 823, in _execute_command
    result = target.execute_command(command, pparams, kparams)
  File "/usr/lib/python2.7/site-packages/configshell_fb/node.py", line 1406, in execute_command
    return method(*pparams, **kparams)
  File "/usr/lib/python2.7/site-packages/targetcli/ui_backstore.py", line 297, in ui_command_delete
    child.rtsnode.delete(save=save)
TypeError: delete() got an unexpected keyword argument 'save'


Actual results:
as above

Expected results:
Delete should be successful


Additional info:
this was not reproduced previously.