summaryrefslogtreecommitdiff
path: root/targetcli
Commit message (Collapse)AuthorAgeFilesLines
* Remove support for level argumentuserbackAndy Grover2014-08-191-2/+2
| | | | | | No longer supported in rtslib and latest version of the TCMU kernel code. Signed-off-by: Andy Grover <agrover@redhat.com>
* Support for user-backed storage objectsAndy Grover2014-07-031-1/+38
| | | | | | Add support for defining user-backed storage objects. Signed-off-by: Andy Grover <agrover@redhat.com>
* Remove write_back param from block backstore create cmdAndy Grover2014-05-051-3/+2
| | | | | | | | | | This used to translate to setting emulate_write_cache, but this is no longer supported by the kernel (a good thing). targetcli commands are not an API, so we can change this whenever it is appropriate. Signed-off-by: Andy Grover <agrover@redhat.com>
* update version to 2.1.fb35v2.1.fb35Andy Grover2014-03-141-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Allow creation of MappedLUN or LUN to also create storage objectAndy Grover2014-03-041-7/+30
| | | | | | | | | | | | If argument is not a valid storageobject path (or lun, for nodeacl), also check to see if it's a file or block device, and attempt to create a new storage object backed by it, and proceed from there. Enable path autocompletion to go along with this. This allows mapping a block device to an existing NodeACL in one command. Signed-off-by: Andy Grover <agrover@redhat.com>
* Auto-create a portal for new TPGs that support themAndy Grover2014-03-041-0/+3
| | | | | | | | Makes things a little easier. Update manpage quickstart to no longer require this step. Signed-off-by: Andy Grover <agrover@redhat.com>
* Fix NodeACL spacing if tags are being usedAndy Grover2014-03-041-2/+2
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Change targetcli for configshell exception changeAndy Grover2014-03-034-41/+19
| | | | | | | | | | | | If run_cmdline raises an exception, return 1 as exit code and print exception text to stderr. Keep running shell.run_interactive until shell._exit is set, logging error messages. Overriding execute_command in UINode no longer needed, remove. Signed-off-by: Andy Grover <agrover@redhat.com>
* update version to 2.1.fb34v2.1.fb34Andy Grover2014-02-241-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Print a warning if creating a HW-based target for absent WWNAndy Grover2014-01-081-0/+3
| | | | | | | | | | It is possible to create targets for hardware-based targets using WWNs that are not in the fabric's WWN list. However, if the user is creating one of these, print a warning, because if the user doesn't expect this (e.g. made a typo from an existing hw WWN) then things won't work and it may not be clear why. Signed-off-by: Andy Grover <agrover@redhat.com>
* update version to 2.1.fb33v2.1.fb33Andy Grover2013-12-031-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Fix issue #23: use fallocate() to create fileio backstoresChristophe Vu-Brugier2013-12-021-7/+16
| | | | | | | | | | | | | | Python 3.3 provides the fallocate() system call which is better for allocating disk space than ftruncate(). ftruncate() sets the file size to the requested size but does not reserve the blocks in the file system. Unlike ftruncate(), fallocate() fails if there is not enough free space. Moreover, this patch improves error handling when the file cannot be opened or when the requested size is too large to be converted to a long int. Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
* Add path completion to block and fileio backstoresChristophe Vu-Brugier2013-11-241-0/+34
| | | | Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
* Use new rtslib restore_from_file and save_to_file APIsAndy Grover2013-11-201-15/+6
| | | | | | | | | As a result it's now better for saveconfig to save/cull backups before saving the current state, hopefully not a big deal. Resolves #34 Signed-off-by: Andy Grover <agrover@redhat.com>
* Save RTSRoot to a member variableAndy Grover2013-11-201-7/+7
| | | | | | | Get the RTSRoot object on init, and then use it when needed in other methods. Signed-off-by: Andy Grover <agrover@redhat.com>
* update version to 2.1.fb32v2.1.fb32Andy Grover2013-11-071-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* update version to 2.1.fb31v2.1.fb31Andy Grover2013-10-301-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Do not use string.maketrans() since it does not exist in Python 3Christophe Vu-Brugier2013-10-171-4/+3
|
* Make use of ethtool module optionalAndy Grover2013-10-161-1/+7
| | | | | | | | targetcli will now use the python-ethtool module if present to generate a list of possible portal listening addresses, but will still work if it is not present. Signed-off-by: Andy Grover <agrover@redhat.com>
* Replace filter() with list comprehensionsChristophe Vu-Brugier2013-10-111-1/+1
| | | | | | Generated with `2to3 -f filter`. Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
* Fix whitespace in comma separated itemsChristophe Vu-Brugier2013-10-111-1/+1
| | | | | | Generated with `2to3 -f ws_comma`. Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
* Comply with PEP 3310 "Catching Exceptions in Python 3000"Christophe Vu-Brugier2013-10-111-1/+1
| | | | | | Generated with `2to3 -f except`. Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
* update version to 2.1.fb30v2.1.fb30Andy Grover2013-09-111-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Revert "Put version directly in setup.py"Andy Grover2013-09-111-0/+18
| | | | | | Version is also used in scripts/targetcli. This reverts commit fedfcb6332ecd3b5d37db6212ffbf4d3ae1735b5.
* Put version directly in setup.pyv2.1.fb29Andy Grover2013-09-101-18/+0
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Put package information in setup.py instead of importing the targetcli moduleChristophe Vu-Brugier2013-08-292-6/+19
| | | | | | Also update the package name, version, URL and maintainer. Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
* Prevent invalid files from being usedAndy Grover2013-08-091-0/+2
| | | | | | See https://bugzilla.redhat.com/show_bug.cgi?id=882094 Signed-off-by: Andy Grover <agrover@redhat.com>
* update version to fb28v2.1.fb28Andy Grover2013-08-051-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Fix missed spot in tags conversionAndy Grover2013-08-021-1/+1
| | | | | | | UINodeACL's list of rtsnodes is called 'rtsnodes', not 'rtsnode'. Reported-by: Xiaowei Li <xiaoli@redhat.com> Signed-off-by: Andy Grover <agrover@redhat.com>
* update version to 2.1.27v2.1.fb27Andy Grover2013-07-231-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* targetcli: Change copyright to Apache License 2.0Nicholas Bellinger2013-07-235-50/+50
| | | | | | | | | | This patch converts rtslib code copyright from AGPL to the permissive Apache License 2.0. It also update copyright owner to Datera, Inc. Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com> Signed-off-by: Andy Grover <agrover@redhat.com>
* More summary workAndy Grover2013-07-191-28/+32
| | | | | | | | | | Build an array of summary items instead of appending to a string. Handle fabrics that support 'acls' but don't have "generate_node_acls". If disabled, just say disabled and nothing else. Signed-off-by: Andy Grover <agrover@redhat.com>
* Enhance summary line for TPGs and ACLs based on auth optionsAndy Grover2013-07-181-13/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LIO has many different ways to configure authentication. This might be the most confusing part of using LIO. The key bit is that LIO *always* wants an ACL for an initiator -- the question is if these are manually created, or created on-the-fly. This is controlled by "attrib/generate_node_acls". Change TPG summary line to always show the state of generate_node_acls. Furthermore, make the status green if the settings for a particular auth configuration are set: * authentication=0 No authentication is performed, so anyone can connect. Since iqns are trivially forgeable, manual ACLs are silly. The user probably also wants generate_node_acls=1. * authentication=1, generate_node_acls=1 ACLs are generated and auth settings are at the TPG level. We go green if CHAP userid and password are also set for the TPG. ACL summary tries to direct the user to look at the TPG. Also indicate if mutual auth is configured. * authentication=1, generate_node_acls=0 Auth at the ACL level. Manually created ACLs. Try to tell the user to look at the ACL-level, and go green only if userid and password are set. Also indicate if mutual auth is configured. Signed-off-by: Andy Grover <agrover@redhat.com>
* Add an auth group to TPG if presentAndy Grover2013-07-181-0/+17
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Use global list of auth params, instead of duplicating itAndy Grover2013-07-171-2/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Use authenticate_target properties if availableAndy Grover2013-07-171-2/+2
| | | | | | | | Instead of checking both mutual_password and mutual_userid, just check authenticate_target, which is essentially the same thing but using configfs a little less. This also uses the discovery version. Signed-off-by: Andy Grover <agrover@redhat.com>
* Update targetcli for acls_auth -> auth feature changeAndy Grover2013-07-171-5/+5
| | | | | | Now, both TPG and ACL auth is covered by a single feature flag. Signed-off-by: Andy Grover <agrover@redhat.com>
* update versionv2.1.fb26Andy Grover2013-06-071-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Fix re-taggingAndy Grover2013-06-071-3/+8
| | | | | | Make sure NodeACL (new or old) being changed isn't used as model. Signed-off-by: Andy Grover <agrover@redhat.com>
* Update 'tag' doctextAndy Grover2013-06-041-1/+3
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Allow tilde-expansion for file backstore filenameAndy Grover2013-06-041-0/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Fix check if so.udev_path is not setAndy Grover2013-06-041-1/+1
| | | | | | ramdisks don't have a udev_path. Signed-off-by: Andy Grover <agrover@redhat.com>
* Add ramdisk nullio supportAndy Grover2013-05-301-3/+10
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* update version to 2.1.fb25v2.1.fb25Andy Grover2013-05-091-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Fix pychecker questionable codeAndy Grover2013-05-093-6/+6
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Update version to 2.1.24v2.1.fb24Andy Grover2013-05-021-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Check file exists before calling samefile()Andy Grover2013-04-301-4/+5
| | | | | | If it doesn't exist then it can't match existing backstores. Signed-off-by: Andy Grover <agrover@redhat.com>
* Accidental space in bytes_to_humanAndy Grover2013-04-251-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Fix info print when using block device with fileio backstoreAndy Grover2013-04-251-1/+1
| | | | | | | We need to get the size from the object, since block devs won't have a passed-in value. Signed-off-by: Andy Grover <agrover@redhat.com>
* Remove usage of is_disk_partitionAndy Grover2013-04-251-6/+3
| | | | | | | Not a differentiator in whether we can use a block device as a backstore or not. Signed-off-by: Andy Grover <agrover@redhat.com>