On 20/07/15 11:57, Oleg Fayans wrote:
+ pwfile = api.env.dot_ipa + os.sep + ".dmpw"
+ if ipautil.file_exists(pwfile):
+ fp = open(pwfile, "r")
+ dm_password = fp.read().rstrip()
+ fp.close()
+ else:
Hello,
1) Can you use os.path.join() instead of "+ os.sep +" please
2) Can you use with statement with file?
with open(pwfile, "r") as f:
dm_password = f.read().rstrip()
3) Please keep PEP8 in new code
./ipatests/test_ipaserver/test_topology_plugin.py:30:80: E501 line too
long (102 > 79 characters)
./ipatests/test_ipaserver/test_topology_plugin.py:33:80: E501 line too
long (92 > 79 characters)
./ipatests/test_ipaserver/test_topology_plugin.py:39:80: E501 line too
long (124 > 79 characters)
./ipatests/test_ipaserver/test_topology_plugin.py:44:80: E501 line too
long (92 > 79 characters)
./ipatests/test_ipaserver/test_topology_plugin.py:45:48: E128
continuation line under-indented for visual indent
./ipatests/test_ipaserver/test_topology_plugin.py:45:80: E501 line too
long (89 > 79 characters)
./ipatests/test_ipaserver/test_topology_plugin.py:46:48: E128
continuation line under-indented for visual indent
./ipatests/test_ipaserver/test_topology_plugin.py:46:80: E501 line too
long (89 > 79 characters)
./ipatests/test_ipaserver/test_topology_plugin.py:58:80: E501 line too
long (87 > 79 characters)
4) Missing nose import
raise nose.SkipTest("No directory manager password in %s" %
pwfile)
5) Can you use sets here instead of sorted lists?
assert(sorted(entry.keys()) == sorted(pluginattrs.keys()))
Martin^2
--
Martin Basti
--
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code