)]}'
{"bin/swift-get-nodes":[{"author":{"_account_id":18334,"name":"Nandini Tata","email":"nandini.tata@intel.com","username":"ntata"},"change_message_id":"5f1da424c3b55204ff44ff14e83981590223b627","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        swift_conf \u003d os.path.join(options.swift_dir,"},{"line_number":64,"context_line":"                                  os.path.basename(SWIFT_CONF_FILE))"},{"line_number":65,"context_line":"        reload_storage_policies(swift_conf)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    # Parse single path arg, as noted in above help text."},{"line_number":68,"context_line":"    # if len(args) \u003d\u003d 1 and options.policy_name and \u0027/\u0027 in args[0]:"},{"line_number":69,"context_line":"    if len(args) \u003d\u003d 1 and not args[0].endswith(\u0027ring.gz\u0027):"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"fa7ab95a_a87eb467","line":66,"updated":"2016-09-01 20:58:41.000000000","message":"custom path of swift.conf is lost when validate_configuration() is called in utils.py\n\nsetting the swift.common.utils.SWIFT_CONF_FILE \u003d swift_conf_file will do the fix (just the way you made it in recon.py)","commit_id":"1a2f1a5471f3e8e3e01562eb0c1120f9ae231986"},{"author":{"_account_id":18334,"name":"Nandini Tata","email":"nandini.tata@intel.com","username":"ntata"},"change_message_id":"5f1da424c3b55204ff44ff14e83981590223b627","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    if len(args) \u003e\u003d 1 and args[0].endswith(\u0027ring.gz\u0027):"},{"line_number":80,"context_line":"        if os.path.exists(args[0]):"},{"line_number":81,"context_line":"            ring_name \u003d args[0].rsplit(\u0027/\u0027, 1)[-1].split(\u0027.\u0027, 1)[0]"},{"line_number":82,"context_line":"            ring \u003d Ring(args[0])"},{"line_number":83,"context_line":"        else:"},{"line_number":84,"context_line":"            print(\u0027Ring file does not exist\u0027)"},{"line_number":85,"context_line":"        args.pop(0)"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"fa7ab95a_a8f5d4ed","line":82,"updated":"2016-09-01 20:58:41.000000000","message":"Ring class calls swift.common.utils.validate_configuration.py() which is causing the problem.","commit_id":"1a2f1a5471f3e8e3e01562eb0c1120f9ae231986"}],"bin/swift-object-info":[{"author":{"_account_id":18334,"name":"Nandini Tata","email":"nandini.tata@intel.com","username":"ntata"},"change_message_id":"5f1da424c3b55204ff44ff14e83981590223b627","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    if options.swift_dir:"},{"line_number":45,"context_line":"        swift_conf \u003d os.path.join(options.swift_dir,"},{"line_number":46,"context_line":"                                  os.path.basename(SWIFT_CONF_FILE))"},{"line_number":47,"context_line":"        reload_storage_policies(swift_conf)"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    try:"},{"line_number":50,"context_line":"        print_obj(*args, **vars(options))"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"fa7ab95a_c855b850","line":47,"updated":"2016-09-01 20:58:41.000000000","message":"swift.common.utils.SWIFT_CONF_FILE \u003d swift_conf_file must be set to avoid validating configuration file to go back to /etc/swift/swift.conf","commit_id":"1a2f1a5471f3e8e3e01562eb0c1120f9ae231986"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"4c5c83a42e3c4dc3a252f4258dfd63ca86984299","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    if len(args) !\u003d 1:"},{"line_number":40,"context_line":"        sys.exit(parser.print_help())"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    if options.swift_dir is not \u0027/etc/swift\u0027:"},{"line_number":43,"context_line":"        reload_storage_policies(options.swift_dir)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    try:"}],"source_content_type":"application/octet-stream","patch_set":15,"id":"7a77a97e_e5228751","line":42,"updated":"2016-11-17 14:31:20.000000000","message":"the condition is tested every time so could be moved to the reload_storage_policies method?\n\n(but note that in that file I suggest an alternative https://gist.github.com/alistairncoles/2f04f6aa1c7e56cd60d1d95e4712ddfb)","commit_id":"8510b78e5d2867b895df59fee48b7349e371e6d5"}],"swift/cli/recon.py":[{"author":{"_account_id":18334,"name":"Nandini Tata","email":"nandini.tata@intel.com","username":"ntata"},"change_message_id":"68e40f3c6b7b764acffbc2e19ac751ff73971a4d","unresolved":false,"context_lines":[{"line_number":1030,"context_line":""},{"line_number":1031,"context_line":"        swift_dir \u003d options.swiftdir"},{"line_number":1032,"context_line":"        if swift_dir:"},{"line_number":1033,"context_line":"            swift_conf_file \u003d os.path.join("},{"line_number":1034,"context_line":"                swift_dir, os.path.basename(SWIFT_CONF_FILE))"},{"line_number":1035,"context_line":"            reload_storage_policies(swift_conf_file)"},{"line_number":1036,"context_line":"        self.verbose \u003d options.verbose"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa7ab95a_0625735a","line":1033,"updated":"2016-08-30 18:00:33.000000000","message":"swift_conf_file that is getting set to the /custom/path/swift.conf is not used by validate_configuration() of utils.py to validate the hash_path prefix and hash_path_suffix. Instead, it picks up SWIFT_CONF_FILE (/etc/swift/swift.conf) that\u0027s set in utils.py","commit_id":"68a4dff214ed7316aa96af696af982d0fbf9fd96"},{"author":{"_account_id":18334,"name":"Nandini Tata","email":"nandini.tata@intel.com","username":"ntata"},"change_message_id":"5f1da424c3b55204ff44ff14e83981590223b627","unresolved":false,"context_lines":[{"line_number":1035,"context_line":"                swift_dir, os.path.basename(SWIFT_CONF_FILE))"},{"line_number":1036,"context_line":"            swift.common.utils.SWIFT_CONF_FILE \u003d swift_conf_file"},{"line_number":1037,"context_line":"            swift.common.utils.HASH_PATH_PREFIX \u003d None"},{"line_number":1038,"context_line":"            swift.common.utils.HASH_PATH_SUFFIX \u003d None"},{"line_number":1039,"context_line":"            swift.common.utils.validate_configuration()"},{"line_number":1040,"context_line":"            reload_storage_policies(swift_conf_file)"},{"line_number":1041,"context_line":"        self.verbose \u003d options.verbose"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_286704b8","line":1038,"updated":"2016-09-01 20:58:41.000000000","message":"Do we really need to set the PREFIX and SUFFIX to None here? \n\nHASH_PATH_PREFIX and HASH_PATH_SUFFIX are initiated to \u0027 \u0027 when utils.py gets loaded. https://github.com/openstack/swift/blob/master/swift/common/utils.py#L158","commit_id":"1a2f1a5471f3e8e3e01562eb0c1120f9ae231986"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"caf65fdad180ab31863d78e18b21092a3408f49f","unresolved":false,"context_lines":[{"line_number":1035,"context_line":"                swift_dir, os.path.basename(SWIFT_CONF_FILE))"},{"line_number":1036,"context_line":"            swift.common.utils.SWIFT_CONF_FILE \u003d swift_conf_file"},{"line_number":1037,"context_line":"            swift.common.utils.HASH_PATH_PREFIX \u003d None"},{"line_number":1038,"context_line":"            swift.common.utils.HASH_PATH_SUFFIX \u003d None"},{"line_number":1039,"context_line":"            swift.common.utils.validate_configuration()"},{"line_number":1040,"context_line":"            reload_storage_policies(swift_conf_file)"},{"line_number":1041,"context_line":"        self.verbose \u003d options.verbose"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_f6f96f81","line":1038,"in_reply_to":"fa7ab95a_286704b8","updated":"2016-09-02 07:44:38.000000000","message":"Yes; but we can set it also to \u0027\u0027\nIf it\u0027s not done it won\u0027t be re-evaluated due to https://github.com/openstack/swift/blob/master/swift/common/utils.py#L186 - so we have to do this.\n\nBut then it\u0027s also needed in swift-get-nodes and swift-object-info. And it won\u0027t help to have a simple custom method in utils.py for this, because this would lead to a circular import... oh my, this feels a little bit messy.","commit_id":"1a2f1a5471f3e8e3e01562eb0c1120f9ae231986"},{"author":{"_account_id":18334,"name":"Nandini Tata","email":"nandini.tata@intel.com","username":"ntata"},"change_message_id":"5f1da424c3b55204ff44ff14e83981590223b627","unresolved":false,"context_lines":[{"line_number":1036,"context_line":"            swift.common.utils.SWIFT_CONF_FILE \u003d swift_conf_file"},{"line_number":1037,"context_line":"            swift.common.utils.HASH_PATH_PREFIX \u003d None"},{"line_number":1038,"context_line":"            swift.common.utils.HASH_PATH_SUFFIX \u003d None"},{"line_number":1039,"context_line":"            swift.common.utils.validate_configuration()"},{"line_number":1040,"context_line":"            reload_storage_policies(swift_conf_file)"},{"line_number":1041,"context_line":"        self.verbose \u003d options.verbose"},{"line_number":1042,"context_line":"        self.suppress_errors \u003d options.suppress"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_c8cf787d","line":1039,"updated":"2016-09-01 20:58:41.000000000","message":"Not sure if we need this extra call to validate_configuration() here. We\u0027re validating configuration anyway in get_hosts()","commit_id":"1a2f1a5471f3e8e3e01562eb0c1120f9ae231986"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"caf65fdad180ab31863d78e18b21092a3408f49f","unresolved":false,"context_lines":[{"line_number":1036,"context_line":"            swift.common.utils.SWIFT_CONF_FILE \u003d swift_conf_file"},{"line_number":1037,"context_line":"            swift.common.utils.HASH_PATH_PREFIX \u003d None"},{"line_number":1038,"context_line":"            swift.common.utils.HASH_PATH_SUFFIX \u003d None"},{"line_number":1039,"context_line":"            swift.common.utils.validate_configuration()"},{"line_number":1040,"context_line":"            reload_storage_policies(swift_conf_file)"},{"line_number":1041,"context_line":"        self.verbose \u003d options.verbose"},{"line_number":1042,"context_line":"        self.suppress_errors \u003d options.suppress"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_36e3d7a5","line":1039,"in_reply_to":"fa7ab95a_c8cf787d","updated":"2016-09-02 07:44:38.000000000","message":"Good catch! Not needed.","commit_id":"1a2f1a5471f3e8e3e01562eb0c1120f9ae231986"},{"author":{"_account_id":18334,"name":"Nandini Tata","email":"nandini.tata@intel.com","username":"ntata"},"change_message_id":"5f1da424c3b55204ff44ff14e83981590223b627","unresolved":false,"context_lines":[{"line_number":1049,"context_line":"                print(\u0027Invalid Storage Policy: %s\u0027 % options.policy)"},{"line_number":1050,"context_line":"                args.print_help()"},{"line_number":1051,"context_line":"                sys.exit(0)"},{"line_number":1052,"context_line":"            hosts \u003d self.get_hosts(options.region, options.zone,"},{"line_number":1053,"context_line":"                                   swift_dir, ring_names)"},{"line_number":1054,"context_line":"            print(\"--\u003e Starting reconnaissance on %s hosts (%s)\" %"},{"line_number":1055,"context_line":"                  (len(hosts), self.server_type))"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa7ab95a_2871c444","line":1052,"updated":"2016-09-01 20:58:41.000000000","message":"get_hosts is making a call to Ring class which validates configuration anyway and since we\u0027re setting the utils.SWIFT_CONF_FILE to the /custom/path/swift.conf; it is validating the right file.","commit_id":"1a2f1a5471f3e8e3e01562eb0c1120f9ae231986"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"4c5c83a42e3c4dc3a252f4258dfd63ca86984299","unresolved":false,"context_lines":[{"line_number":1035,"context_line":"            server_types \u003d [\u0027object\u0027]"},{"line_number":1036,"context_line":""},{"line_number":1037,"context_line":"        swift_dir \u003d options.swiftdir"},{"line_number":1038,"context_line":"        if not swift_dir.startswith(os.path.dirname(SWIFT_CONF_FILE)):"},{"line_number":1039,"context_line":"            reload_storage_policies(swift_dir)"},{"line_number":1040,"context_line":""},{"line_number":1041,"context_line":"        self.verbose \u003d options.verbose"}],"source_content_type":"text/x-python","patch_set":15,"id":"7a77a97e_a51ecf5c","line":1038,"updated":"2016-11-17 14:31:20.000000000","message":"this differs from the swift-get-nodes and swift-object-info cases where the condition is a mismatch with \u0027/etc/swift\u0027\n\nFWIW I prefer this approach vs using a string literal for /etc/swift","commit_id":"8510b78e5d2867b895df59fee48b7349e371e6d5"}],"swift/common/storage_policy.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"4c5c83a42e3c4dc3a252f4258dfd63ca86984299","unresolved":false,"context_lines":[{"line_number":875,"context_line":"                           This is by default /etc/swift/swift.conf. If given,"},{"line_number":876,"context_line":"                           it will also trigger a re-validation of swift.conf"},{"line_number":877,"context_line":"    \"\"\""},{"line_number":878,"context_line":"    if swift_conf_dir is not None:"},{"line_number":879,"context_line":"        utils.SWIFT_CONF_FILE \u003d os.path.join("},{"line_number":880,"context_line":"            swift_conf_dir,"},{"line_number":881,"context_line":"            os.path.basename(utils.SWIFT_CONF_FILE))"}],"source_content_type":"text/x-python","patch_set":15,"id":"7a77a97e_e54d273f","line":878,"updated":"2016-11-17 14:31:20.000000000","message":"So I guess this is here to avoid the circular import in utils. But it\u0027s not great IMHO to have storage_policy messing with the hash prefix, feels like it\u0027s not intuitive to have that mix of concerns.\n\nSince we only use this code in the CLI\u0027s, how about making a helper function is swift/cli/__init__.py, like this [1] ? (note that I didn\u0027t update any tests in that gist, just suggesting an alternative)\n\n[1] https://gist.github.com/alistairncoles/2f04f6aa1c7e56cd60d1d95e4712ddfb","commit_id":"8510b78e5d2867b895df59fee48b7349e371e6d5"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"4c5c83a42e3c4dc3a252f4258dfd63ca86984299","unresolved":false,"context_lines":[{"line_number":884,"context_line":"        try:"},{"line_number":885,"context_line":"            utils.validate_hash_conf()"},{"line_number":886,"context_line":"        except utils.InvalidHashPathConfigError:"},{"line_number":887,"context_line":"            pass"},{"line_number":888,"context_line":""},{"line_number":889,"context_line":"    global _POLICIES"},{"line_number":890,"context_line":"    policy_conf \u003d ConfigParser()"}],"source_content_type":"text/x-python","patch_set":15,"id":"7a77a97e_6f84985d","line":887,"updated":"2016-11-17 14:31:20.000000000","message":"I\u0027m not sure why you suppress the exception here, don\u0027t we want it raised? As it is, an invalid swift.conf is ignored until Ring validates it again.","commit_id":"8510b78e5d2867b895df59fee48b7349e371e6d5"},{"author":{"_account_id":330,"name":"John Dickinson","email":"me@not.mn","username":"notmyname"},"change_message_id":"7d8ef13b6ef287cd9b0366bcba1c8624545840de","unresolved":false,"context_lines":[{"line_number":928,"context_line":""},{"line_number":929,"context_line":"    :param swift_conf_dir: non-default directory to read swift.conf from"},{"line_number":930,"context_line":"                           This is by default /etc/swift/swift.conf. If given,"},{"line_number":931,"context_line":"                           it will also trigger a re-validation of swift.conf"},{"line_number":932,"context_line":"    \"\"\""},{"line_number":933,"context_line":"    global _POLICIES"},{"line_number":934,"context_line":"    policy_conf \u003d ConfigParser()"}],"source_content_type":"text/x-python","patch_set":18,"id":"ff346bd7_3b2f67f7","line":931,"updated":"2017-07-25 21:48:59.000000000","message":"not really a param to the method, is it?","commit_id":"2410b616bba2d68914c2c00e95b2f7c30f391e1b"}],"swift/common/utils.py":[{"author":{"_account_id":330,"name":"John Dickinson","email":"me@not.mn","username":"notmyname"},"change_message_id":"7d8ef13b6ef287cd9b0366bcba1c8624545840de","unresolved":false,"context_lines":[{"line_number":204,"context_line":"        SWIFT_CONF_FILE \u003d os.path.join("},{"line_number":205,"context_line":"            swift_dir, os.path.basename(SWIFT_CONF_FILE))"},{"line_number":206,"context_line":"        HASH_PATH_PREFIX \u003d \u0027\u0027"},{"line_number":207,"context_line":"        HASH_PATH_SUFFIX \u003d \u0027\u0027"},{"line_number":208,"context_line":"        validate_configuration()"},{"line_number":209,"context_line":"        return True"},{"line_number":210,"context_line":"    return False"}],"source_content_type":"text/x-python","patch_set":18,"id":"ff346bd7_3b664753","line":207,"updated":"2017-07-25 21:48:59.000000000","message":"ah. these are reset to trigger their respective reload from the config. maybe a comment woudl be nice","commit_id":"2410b616bba2d68914c2c00e95b2f7c30f391e1b"}],"test/unit/cli/test_recon.py":[{"author":{"_account_id":12261,"name":"Mahati","email":"mahati.chamarthy@gmail.com","username":"Mahati"},"change_message_id":"622999edb71d02b3a31f7c56eeaa38fda3686989","unresolved":false,"context_lines":[{"line_number":159,"context_line":""},{"line_number":160,"context_line":"[storage-policy:1]"},{"line_number":161,"context_line":"name \u003d unu"},{"line_number":162,"context_line":"\u0027\u0027\u0027)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        utils.HASH_PATH_SUFFIX \u003d \u0027endcap\u0027"},{"line_number":165,"context_line":"        utils.HASH_PATH_PREFIX \u003d \u0027startcap\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_64f031ca","line":162,"updated":"2016-08-23 05:04:24.000000000","message":"It doesn\u0027t look like self.swift_conf is used in this test. I have commented the code in cli/recon.py and no tests fail.","commit_id":"bf2d104d3ca14005110c3431f39ab1c8469f678a"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"b2189e408ea585e4d0e0b092135fcac3ddf8fa64","unresolved":false,"context_lines":[{"line_number":164,"context_line":"default \u003d yes"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"[storage-policy:1]"},{"line_number":167,"context_line":"name \u003d unu"},{"line_number":168,"context_line":"aliases \u003d %s"},{"line_number":169,"context_line":"\u0027\u0027\u0027 % self.policy_name)"},{"line_number":170,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7a8ec9b2_b2f05acb","line":167,"range":{"start_line":167,"start_character":7,"end_line":167,"end_character":10},"updated":"2016-09-19 18:55:45.000000000","message":"nit: uno?","commit_id":"4807edce80cdc088da62300ffcbdacdaf344eb60"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"b2189e408ea585e4d0e0b092135fcac3ddf8fa64","unresolved":false,"context_lines":[{"line_number":168,"context_line":"aliases \u003d %s"},{"line_number":169,"context_line":"\u0027\u0027\u0027 % self.policy_name)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        utils.HASH_PATH_SUFFIX \u003d \u0027endcap\u0027"},{"line_number":172,"context_line":"        utils.HASH_PATH_PREFIX \u003d \u0027startcap\u0027"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"    def tearDown(self, *_args, **_kwargs):"},{"line_number":175,"context_line":"        shutil.rmtree(self.swift_dir, ignore_errors\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":12,"id":"7a8ec9b2_b2485ace","line":172,"range":{"start_line":171,"start_character":8,"end_line":172,"end_character":42},"updated":"2016-09-19 18:55:45.000000000","message":"remove these","commit_id":"4807edce80cdc088da62300ffcbdacdaf344eb60"},{"author":{"_account_id":330,"name":"John Dickinson","email":"me@not.mn","username":"notmyname"},"change_message_id":"7d8ef13b6ef287cd9b0366bcba1c8624545840de","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        with open(swift_conf, \"wb\") as sc:"},{"line_number":165,"context_line":"            sc.write(\u0027\u0027\u0027"},{"line_number":166,"context_line":"[swift-hash]"},{"line_number":167,"context_line":"swift_hash_path_suffix \u003d changeme"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"[storage-policy:0]"},{"line_number":170,"context_line":"name \u003d default"}],"source_content_type":"text/x-python","patch_set":18,"id":"ff346bd7_1ba02343","line":167,"updated":"2017-07-25 21:48:59.000000000","message":"probably doesn\u0027t matter(?) but interesting you didn\u0027t keep the same prefix and suffix as the previous version of the code","commit_id":"2410b616bba2d68914c2c00e95b2f7c30f391e1b"}]}
