Hi Dejan
Thanks.
But previous commit c8e7cb61 or 7c9df6e81 (Jun 21) cause this error
when using comment between configuration.
config.crm
------------------------
property \
no-quorum-policy="ignore" \
stonith-enabled="false" \
startup-fencing="false" \
stonith-timeout="20s"
# comment
primitive dummy ocf:heartbeat:Dummy
--------------
# crm configure load update config.crm
Traceback (most recent call last):
File "/usr/sbin/crm", line 44, in <module>
main.run()
File "/usr/lib64/python2.6/site-packages/crmsh/main.py", line 414, in run
do_work()
File "/usr/lib64/python2.6/site-packages/crmsh/main.py", line 323, in do_work
if parse_line(levels, shlex.split(' '.join(l))):
File "/usr/lib64/python2.6/site-packages/crmsh/main.py", line 149,
in parse_line
rv = d() # execute the command
File "/usr/lib64/python2.6/site-packages/crmsh/main.py", line 148, in <lambda>
d = lambda: cmd[0](*args)
File "/usr/lib64/python2.6/site-packages/crmsh/ui.py", line 1694, in load
return set_obj.import_file(method, url)
File "/usr/lib64/python2.6/site-packages/crmsh/cibconfig.py", line
268, in import_file
return self.save(s, method == "update")
File "/usr/lib64/python2.6/site-packages/crmsh/cibconfig.py", line
455, in save
if self.process(cli_list, update) == False:
File "/usr/lib64/python2.6/site-packages/crmsh/cibconfig.py", line
409, in process
obj = cib_factory.create_from_cli(cli_list)
File "/usr/lib64/python2.6/site-packages/crmsh/cibconfig.py", line
2615, in create_from_cli
node = obj.cli2node(cli_list)
File "/usr/lib64/python2.6/site-packages/crmsh/cibconfig.py", line
918, in cli2node
stuff_comments(node, comments)
File "/usr/lib64/python2.6/site-packages/crmsh/xmlutil.py", line
506, in stuff_comments
add_comment(node, s)
File "/usr/lib64/python2.6/site-packages/crmsh/xmlutil.py", line
503, in add_comment
e.insert(firstelem, comm_elem)
File "lxml.etree.pyx", line 723, in lxml.etree._Element.insert
(src/lxml/lxml.etree.c:32132)
TypeError: 'NoneType' object cannot be interpreted as an index
Commit ff28b19b doesn't issue this error.
Regards,
Takatoshi MATSUO
Post by Dejan MuhamedagicHi Takatoshi-san,
Post by Takatoshi MATSUOHi Dejan
I received another FutureWarning of python.
FutureWarning: The behavior of this
method will change in future versions. Use specific 'len(elem)' or
'elem is not None' test instead.
if not doc
Fixed now. Thanks!
Dejan
Post by Takatoshi MATSUORegards,
Takatoshi MATSUO
Post by Takatoshi MATSUOHi Dejan
Thank you for your quick response.
I can inhibit warnings.
Regards,
Takatoshi MATSUO
Post by Dejan MuhamedagicHi Takatoshi-san,
Post by Takatoshi MATSUOHi Dejan
I use latest crmsh(ff28b19bdb1d) and it issues FutureWarning of python
when using comment(#).
config.crm file
--------------------
# Comment
property \
no-quorum-policy="ignore" \
stonith-enabled="false" \
startup-fencing="false" \
stonith-timeout="20s"
--------------------
-------
# crm configure load update config.crm
FutureWarning: The behavior of this method will change in future
versions. Use specific 'len(elem)' or 'elem is not None' test instead.
Fixed now. And some more. Hope there won't be any more in Future.
Cheers,
Dejan
Post by Takatoshi MATSUO-------
I use python 2.7.3 on Fedora 18.
Python 2.6.6 issues same warning on RHEL6.
Thanks,
Takatoshi MATSUO
_______________________________________________________
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
_______________________________________________________
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
_______________________________________________________
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
_______________________________________________________
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/