)]}'
{"ironic/drivers/modules/redfish/utils.py":[{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"f6f1e2a4e2e8f034f892ab7131deebf594036129","unresolved":false,"context_lines":[{"line_number":107,"context_line":"    # Check if verify_ca is a Boolean or a file/directory in the file-system"},{"line_number":108,"context_line":"    verify_ca \u003d driver_info.get(\u0027redfish_verify_ca\u0027, True)"},{"line_number":109,"context_line":"    if isinstance(verify_ca, six.string_types):"},{"line_number":110,"context_line":"        if verify_ca \u003d\u003d \u0027False\u0027:"},{"line_number":111,"context_line":"            # False string is a valid case, change it to boolean False"},{"line_number":112,"context_line":"            verify_ca \u003d False"},{"line_number":113,"context_line":"        elif verify_ca \u003d\u003d \u0027True\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_3d41ab3a","line":110,"updated":"2017-05-05 16:06:45.000000000","message":"I think it would likely be a good idea if we used https://docs.openstack.org/developer/oslo.utils/api/strutils.html#oslo_utils.strutils.bool_from_string","commit_id":"dfc2b7ff2adad01db994261529a5709106a18212"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"69efbb438d63d222a9579f34f608fd3aabdafecd","unresolved":false,"context_lines":[{"line_number":107,"context_line":"    # Check if verify_ca is a Boolean or a file/directory in the file-system"},{"line_number":108,"context_line":"    verify_ca \u003d driver_info.get(\u0027redfish_verify_ca\u0027, True)"},{"line_number":109,"context_line":"    if isinstance(verify_ca, six.string_types):"},{"line_number":110,"context_line":"        if verify_ca \u003d\u003d \u0027False\u0027:"},{"line_number":111,"context_line":"            # False string is a valid case, change it to boolean False"},{"line_number":112,"context_line":"            verify_ca \u003d False"},{"line_number":113,"context_line":"        elif verify_ca \u003d\u003d \u0027True\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_1d6f0f93","line":110,"in_reply_to":"3f044301_3d41ab3a","updated":"2017-05-05 16:17:33.000000000","message":"Agreed but it\u0027s tricky, verify_ca can either be a boolean or a path to a file/directory (which is a string).\n\nSo maybe we should test if it\u0027s a path first (os.path.exist, L116) and if not we can use the bool_from_string().\n\nBut @Madhuri, our API supports native boolean types so why the need to convert string to boolean here ?","commit_id":"dfc2b7ff2adad01db994261529a5709106a18212"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"927355ef7aa82435011028b640c9fe8e48052864","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    system_id \u003d driver_info[\u0027redfish_system_id\u0027]"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    # Check if verify_ca is a Boolean or a file/directory in the file-system"},{"line_number":109,"context_line":"    verify_ca \u003d driver_info.get(\u0027redfish_verify_ca\u0027, True)"},{"line_number":110,"context_line":"    if isinstance(verify_ca, six.string_types):"},{"line_number":111,"context_line":"        if os.path.isdir(verify_ca):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_e9eee5b2","line":108,"range":{"start_line":108,"start_character":43,"end_line":108,"end_character":47},"updated":"2017-05-05 19:10:19.000000000","message":"so a valid path is file, directory or both? in this case L111 os.path.isdir() should be updated to pass if file is specified.\n\nIf not, please update this s/file\\/directory/whatever is right/ here and at L 129","commit_id":"3ab353296ba45838cea67acc96249e176ca7ccb3"},{"author":{"_account_id":11076,"name":"Shivanand Tendulker","email":"stendulker@gmail.com","username":"stendulker"},"change_message_id":"efb57926d003fc8705616b686b773290830550b8","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    # Check if verify_ca is a Boolean or a file/directory in the file-system"},{"line_number":109,"context_line":"    verify_ca \u003d driver_info.get(\u0027redfish_verify_ca\u0027, True)"},{"line_number":110,"context_line":"    if isinstance(verify_ca, six.string_types):"},{"line_number":111,"context_line":"        if os.path.isdir(verify_ca):"},{"line_number":112,"context_line":"            if os.path.exists(verify_ca):"},{"line_number":113,"context_line":"                pass"},{"line_number":114,"context_line":"            else:"},{"line_number":115,"context_line":"                raise exception.InvalidParameterValue("},{"line_number":116,"context_line":"                    _(\u0027Invalid value \"%(value)s\" set in \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_06232907","line":113,"range":{"start_line":111,"start_character":8,"end_line":113,"end_character":20},"updated":"2017-05-08 05:14:42.000000000","message":"Since the \u0027redfish_verify_ca\u0027 could be a file or directory path, may be this should be split into two parts:-\n\n# If directory\nif os.path.isdir(verify_ca):\n    file_exist \u003d False\n    for dirpath, dirnames, files in os.walk(verify_ca):\n        if files:\n            file_exist \u003d True\n            break\n    if not file_exist:\n        raise exception.InvalidParameterValue(...)\n# If not regular file\nelif not os.path.isfile(verify_ca):\n    raise exception.InvalidParameterValue(...)","commit_id":"3ab353296ba45838cea67acc96249e176ca7ccb3"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"4e16864101dfa6b57d020930e7b1c1f4640fed59","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    # Check if verify_ca is a Boolean or a file/directory in the file-system"},{"line_number":109,"context_line":"    verify_ca \u003d driver_info.get(\u0027redfish_verify_ca\u0027, True)"},{"line_number":110,"context_line":"    if isinstance(verify_ca, six.string_types):"},{"line_number":111,"context_line":"        if os.path.isdir(verify_ca):"},{"line_number":112,"context_line":"            if os.path.exists(verify_ca):"},{"line_number":113,"context_line":"                pass"},{"line_number":114,"context_line":"            else:"},{"line_number":115,"context_line":"                raise exception.InvalidParameterValue("},{"line_number":116,"context_line":"                    _(\u0027Invalid value \"%(value)s\" set in \u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_d03f60d4","line":113,"range":{"start_line":111,"start_character":8,"end_line":113,"end_character":20},"in_reply_to":"3f044301_06232907","updated":"2017-05-18 10:15:00.000000000","message":"Right, if it can be both file and directory, we need to do as you suggest (tho not sure, maybe we need to only look for files in top directory, not walking through all subdirectories)\n\nThe directory should have been processed by https://www.openssl.org/docs/man1.0.2/apps/c_rehash.html as requests docs state, so we could also validate that there are symlinks that are hashes of certificates etc... I think we should not go that far, just validating that the path exists should be enough, like it was previously, and just adding the boolean conversion should be fine.","commit_id":"3ab353296ba45838cea67acc96249e176ca7ccb3"}]}
