summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Make setup() err_funcs return more info from exceptionsAndy Grover2014-01-082-6/+6
| | | | | | | Instead of just saying there was an error, also include the string text from the RTSLibError exception. Signed-off-by: Andy Grover <agrover@redhat.com>
* Add support for RTSRoot().mapped_lunsAndy Grover2014-01-031-0/+8
| | | | | | Added for completeness. Signed-off-by: Andy Grover <agrover@redhat.com>
* Merge pull request #47 from agrover/walkthroughAndy Grover2014-01-031-0/+175
|\ | | | | Add a walkthrough for rtslib use
| * Add a tutorial for rtslib useAndy Grover2014-01-031-0/+175
|/ | | | | | Add a walkthrough that demonstrates how to get started using rtslib. Signed-off-by: Andy Grover <agrover@redhat.com>
* Fix some typos in reprsAndy Grover2014-01-021-2/+2
| | | | | | NetworkPortal and LUN both missing '>'s at the end. Signed-off-by: Andy Grover <agrover@redhat.com>
* update version to 2.1.fb44v2.1.fb44Andy Grover2013-12-181-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* WWNs are case-insensitiveAndy Grover2013-12-181-1/+1
| | | | | | Convert all incoming WWNs to lowercase for comparison. Signed-off-by: Andy Grover <agrover@redhat.com>
* Don't call from_fabric_wwn from wwns()Andy Grover2013-12-171-14/+6
| | | | | | | | | | | | | | | from_fabric_wwn and wwns() do two slightly different things, and it's better if we keep them separate. from/to_fabric_wwn() convert our canonical wwn format from/to the format the fabric in configfs expects. wwns() reads from somewhere else to get a list of wwns. The format of WWNs may not be the same as what the fabric uses, and it should convert whatever it reads to canonical format without referencing what the fabric's WWN format is. I really hope this is the last ever commit on this stupid cesspool of my own making. Signed-off-by: Andy Grover <agrover@redhat.com>
* Fix fcoe from_fabric_wwnAndy Grover2013-12-171-3/+7
| | | | | | | | | | | Add comment for from_fabric_wwn to attempt to explain where all the issues are coming from. from_fabric_wwn is to convert tcm_fc wwn format to canonical. What's in /sys/class/fc_host/.. is a different format and should be converted to canonical separately. Signed-off-by: Andy Grover <agrover@redhat.com>
* str.replace() is not the same as str.translate()Andy Grover2013-12-171-1/+2
| | | | | | | If we want to remove both : and -, then we can futz around with translate or we can just call replace() twice. Signed-off-by: Andy Grover <agrover@redhat.com>
* Increase MAX_LUN to 16383Andy Grover2013-12-031-1/+1
| | | | | | | 255 is too low. rtslib should be ready if the kernel lun-per-tpg limit is raised. Signed-off-by: Andy Grover <agrover@redhat.com>
* Improve performance when adding many backstoresAndy Grover2013-12-031-20/+21
| | | | | | | | | | The old cache code was effective for lookups, but each cache miss caused the cache to be regenerated by reading the filesystem. This causes O(n^2) creation times. Now, only fetch the cache once, then keep bs_cache updated. Signed-off-by: Andy Grover <agrover@redhat.com>
* Update version to 2.1.fb43v2.1.fb43Andy Grover2013-12-031-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Merge pull request #44 from cvubrugier/masterAndy Grover2013-11-241-2/+4
|\ | | | | For partitions, retrieve the logical block size of the parent device
| * For partitions, retrieve the logical block size of the parent deviceChristophe Vu-Brugier2013-11-241-2/+4
|/ | | | | | | | | | | | | | Partitions have a sysfs "size" but no "logical_block_size". As a consequence, we need to look at the parent device to determine the physical block size of a partition. This patch fixes an exception raised in `targetcli` when partitions are listed under /backstores/block: FileNotFoundError: [Errno 2] No such file or directory: '/sys/block/sdb/sdb1/queue/logical_block_size' Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
* Add clear_existing parameter to restore_from_fileAndy Grover2013-11-201-2/+2
| | | | | | | For use from targetcli, we want to make restoring a config when there already is a config require extra confirmation. Signed-off-by: Andy Grover <agrover@redhat.com>
* Merge pull request #43 from thinkbrown/masterAndy Grover2013-11-072-3/+3
|\ | | | | Replaced translate() with replace() to fix python 3.2 compatibility
| * Replaced translate() with replace() to fix python 3.2 compatibilityLogan Brown2013-11-072-3/+3
| |
* | update version to 2.1.fb42v2.1.fb42Andy Grover2013-11-071-1/+1
|/ | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Merge pull request #40 from JonnyJD/rc_scriptAndy Grover2013-11-014-3/+54
|\ | | | | add rc script to debian package
| * debian: patch targetctl to use python3Johannes Dewender2013-11-021-0/+3
| | | | | | | | Signed-off-by: Johannes Dewender <github@JonnyJD.net>
| * debian: update control with breaks/replacesJohannes Dewender2013-11-021-3/+6
| | | | | | | | | | | | The target rc script is replaced with the one in rtslib. Signed-off-by: Johannes Dewender <github@JonnyJD.net>
| * debian: add rc scriptJohannes Dewender2013-11-023-0/+45
| | | | | | | | | | | | | | This was moved from targetcli to rtslib, using targetctl. Signed-off-by: Johannes Dewender <github@JonnyJD.net>
* | Merge pull request #41 from JonnyJD/fix_restoreAndy Grover2013-11-012-3/+2
|\ \ | | | | | | Fix targetctl restore
| * | root: fix restore_from_fileJohannes Dewender2013-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | That was the argument name in targetctl, which isn't visible here. Signed-off-by: Johannes Dewender <github@JonnyJD.net>
| * | targetctl: fix restoreJohannes Dewender2013-11-021-2/+1
| |/ | | | | | | | | | | | | There is no clear_existing argument. restore_from_file() always clears the config first. Signed-off-by: Johannes Dewender <github@JonnyJD.net>
* | Update setup.py for targetctl scriptAndy Grover2013-11-011-0/+1
|/ | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Merge pull request #39 from JonnyJD/modprobe_configfsAndy Grover2013-10-301-0/+1
|\ | | | | load configfs before mounting it
| * load configfs before mounting itJohannes Dewender2013-10-301-0/+1
|/ | | | Signed-off-by: Johannes Dewender <github@JonnyJD.net>
* update version to 2.1.41v2.1.fb41Andy Grover2013-10-301-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Remove unused importAndy Grover2013-10-301-1/+1
| | | | | | modprobing was moved over to fabric.py. Signed-off-by: Andy Grover <agrover@redhat.com>
* Better error message if failing to mount configfsAndy Grover2013-10-301-1/+1
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* In mount_configfs(), Popen args param should be a sequenceAndy Grover2013-10-301-1/+1
| | | | | | Fixes #37. Signed-off-by: Andy Grover <agrover@redhat.com>
* Have rtslib mount configfs if not already mountedAndy Grover2013-10-292-1/+12
| | | | | | | | | | | | | The system service that restores target state may not always be configured to run. If so, running targetcli may return strange error messages, because it also is responsible for mounting configfs. Instead, have rtslib try to mount configfs. If it's already mounted then no problem, but this will ensure that using targetcli without the target service activated will work, it just won't have the previous configuration. Signed-off-by: Andy Grover <agrover@redhat.com>
* Add documentation of saveconfig.json formatAndy Grover2013-10-291-0/+246
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Add save_to_file and restore_from_fileAndy Grover2013-10-282-27/+45
| | | | | | | | | | | | | Push down the ability to save/restore state to/from a file, from targetcli to rtslib. This will let us coordinate access from multiple API users (targetd, targetcli, targetctl) to ensure atomicity, and also make targetcli an optional installed component if the user is not using it. Modify targetctl to use the new APIs. Since various exceptions set return status to 1, targetctl should still properly be setting nonzero exit status so scripts can check it. Signed-off-by: Andy Grover <agrover@redhat.com>
* Add manpage for targetctlAndy Grover2013-10-281-0/+63
| | | | Signed-off-by: Andy Grover <agrover@redhat.com>
* Add a 'clear' command to targetctlAndy Grover2013-10-281-1/+5
| | | | | | | | | It seems like this might be useful. If restore has errors, it will result in a partially applied configuration. Maybe this what the user wants, or maybe they'd just as soon have no configuration if any part of it fails. If so, 'clear' to the rescue if exit status from 'restore' is nonzero. Signed-off-by: Andy Grover <agrover@redhat.com>
* Consolidate save/restore scripts into a single scriptAndy Grover2013-10-283-124/+97
| | | | | | | Eliminates some duplicate code and has a better name. Still not using configparser yet, hopefully we won't need it. Signed-off-by: Andy Grover <agrover@redhat.com>
* Add rtslib-saveconfig and rtslib-restoreconfig scriptsAndy Grover2013-10-252-0/+124
| | | | | | | | | | | | | Targetcli is not scriptable. One way around this is to modify or create the json describing the config directly, but even then, targetcli is needed to save or restore the json file. These new scripts enable saving or restoring a json-based configuration to not rely on calling targetcli, or even being installed. These scripts and just rtslib can properly return exit status & stderr output if something goes wrong. Signed-off-by: Andy Grover <agrover@redhat.com>
* Update README.md for in-repo packaging policyAndy Grover2013-10-251-0/+10
| | | | | | See discussion in https://github.com/agrover/configshell-fb/pull/8 Signed-off-by: Andy Grover <agrover@redhat.com>
* Merge pull request #35 from JonnyJD/make_debAndy Grover2013-10-2515-111/+92
|\ | | | | update debian packaging
| * debian: build python 3 packageJohannes Dewender2013-10-255-4/+46
| | | | | | | | | | | | This also splits a -docs package for both. Signed-off-by: Johannes Dewender <github@JonnyJD.net>
| * debian: use dh_pythonJohannes Dewender2013-10-2510-83/+17
| | | | | | | | Signed-off-by: Johannes Dewender <github@JonnyJD.net>
| * debian: update dependenciesJohannes Dewender2013-10-251-2/+2
| | | | | | | | | | | | | | We don't have any dependencies anymore. Additionally, this conflicts with the original rtslib package. Signed-off-by: Johannes Dewender <github@JonnyJD.net>
| * debian: fix setuptools usage, fix #34Johannes Dewender2013-10-252-1/+4
| | | | | | | | Signed-off-by: Johannes Dewender <github@JonnyJD.net>
| * rename debian package to rtslib-fbJohannes Dewender2013-10-2510-26/+28
|/ | | | Signed-off-by: Johannes Dewender <github@JonnyJD.net>
* Merge pull request #33 from cvubrugier/2to3Andy Grover2013-10-114-14/+14
|\ | | | | 2to3: preparatory work for python 3
| * Fix whitespace in comma separated itemsChristophe Vu-Brugier2013-10-111-7/+7
| | | | | | | | | | | | Generated with `2to3 -f ws_comma`. Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>
| * Use set literals to better comply with Python 3Christophe Vu-Brugier2013-10-111-2/+2
| | | | | | | | | | | | Generated with `2to3 -f set_literal`. Signed-off-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>