Public bug reported: Ubuntu Version: Ubuntu 12.04 LTS Package: python-rtslib Package Version: 2.1-2
Hi, I found set_parameter method in rtslib.node.CFSNode class writes a trailing white space character after parameter value, which causes runtime errors for some parameters. Examples are "InitialR2T" and "ImmediateData" parameters for rtslib.target.TPG objects. tpg = rtslib.target.TPG(target, 1) tpg.set_parameter('InitialR2T', 'No') Expected: success. What happened: rtslib.utils.RTSLibError: Cannot set parameter InitialR2T: Invalid argument Removing a trailing white space fixes this bug. $ diff -u /usr/lib/python2.7/dist-packages/rtslib/node.py node.py --- /usr/lib/python2.7/dist-packages/rtslib/node.py 2012-06-06 17:59:41.515308657 +0000 +++ node.py 2012-06-06 17:59:50.185146504 +0000 @@ -189,7 +189,7 @@ % str(parameter)) else: try: - fwrite(path, "%s \n" % str(value)) + fwrite(path, "%s\n" % str(value)) except IOError, msg: msg = msg[1] raise RTSLibError("Cannot set parameter %s: %s" ** Affects: rtslib (Ubuntu) Importance: Undecided Status: New ** Tags: targetcli ** Description changed: Ubuntu Version: Ubuntu 12.04 LTS Package: python-rtslib Package Version: 2.1-2 Hi, - I found set_parameter method in rtslib.node.CFSNode class writes a trailing white space character - after parameter value, which causes runtime errors for some parameters. + I found set_parameter method in rtslib.node.CFSNode class writes a + trailing white space character after parameter value, which causes + runtime errors for some parameters. Examples are "InitialR2T" and "ImmediateData" parameters for rtslib.target.TPG objects. tpg = rtslib.target.TPG(target, 1) tpg.set_parameter('InitialR2T', 'No') Expected: success. What happened: rtslib.utils.RTSLibError: Cannot set parameter InitialR2T: Invalid argument Removing a trailing white space fixes this bug. - $ diff -u /usr/lib/python2.7/dist-packages/rtslib/node.py node.py + $ diff -u /usr/lib/python2.7/dist-packages/rtslib/node.py node.py --- /usr/lib/python2.7/dist-packages/rtslib/node.py 2012-06-06 17:59:41.515308657 +0000 +++ node.py 2012-06-06 17:59:50.185146504 +0000 @@ -189,7 +189,7 @@ - % str(parameter)) - else: - try: + % str(parameter)) + else: + try: - fwrite(path, "%s \n" % str(value)) + fwrite(path, "%s\n" % str(value)) - except IOError, msg: - msg = msg[1] - raise RTSLibError("Cannot set parameter %s: %s" + except IOError, msg: + msg = msg[1] + raise RTSLibError("Cannot set parameter %s: %s" -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1009645 Title: node.py fails to set some parameters To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/rtslib/+bug/1009645/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs