)]}'
{"manifests/controller.pp":[{"author":{"_account_id":18575,"name":"Saravanan KR","email":"krsacme@gmail.com","username":"saravanankr"},"change_message_id":"8424fd0f68dd95d11ea3e3f35d3df4984d7571e1","unresolved":false,"context_lines":[{"line_number":126,"context_line":"  } else {"},{"line_number":127,"context_line":"    # ovn-bridge-mappings is not defined. Clear the existing value if configured."},{"line_number":128,"context_line":"    exec { \u0027clear bridge mappings\u0027:"},{"line_number":129,"context_line":"      command \u003d\u003e \"ovs-vsctl --timeout\u003d5 remove open . external-ids ovn-bridge-mappings\","},{"line_number":130,"context_line":"      path    \u003d\u003e \u0027/usr/sbin:/usr/bin:/sbin:/bin\u0027,"},{"line_number":131,"context_line":"    }"},{"line_number":132,"context_line":"  }"}],"source_content_type":"text/x-puppet","patch_set":1,"id":"5f7c97a3_5daf66df","line":129,"updated":"2018-07-04 10:21:40.000000000","message":"can\u0027t we use vs_config to remove the config as it is used to set the config?","commit_id":"7b6ea2416d8b160a9d269f486627b64667a4f256"},{"author":{"_account_id":18575,"name":"Saravanan KR","email":"krsacme@gmail.com","username":"saravanankr"},"change_message_id":"b0c204b51bea94fcfdae286cabd7dd4f66797abc","unresolved":false,"context_lines":[{"line_number":117,"context_line":"      $br \u003d $mapping[1]"},{"line_number":118,"context_line":"      if !empty($br) {"},{"line_number":119,"context_line":"        exec { $br:"},{"line_number":120,"context_line":"          command \u003d\u003e \"ovs-vsctl --timeout\u003d5 set Bridge ${br} other-config:mac-table-size\u003d${mac_table_size}\","},{"line_number":121,"context_line":"          onlyif  \u003d\u003e \"ovs-vsctl show | grep \\\"${br}\\\"\","},{"line_number":122,"context_line":"          path    \u003d\u003e \u0027/usr/sbin:/usr/bin:/sbin:/bin\u0027,"},{"line_number":123,"context_line":"        }"}],"source_content_type":"text/x-puppet","patch_set":3,"id":"5f7c97a3_ac2e778a","line":120,"updated":"2018-07-05 10:26:51.000000000","message":"can vs_bridge used here?\n\nhttps://github.com/openstack/puppet-vswitch/blob/master/lib/puppet/type/vs_bridge.rb","commit_id":"64344abc284f4485be74c0e6244934110950fff7"},{"author":{"_account_id":3153,"name":"Emilien Macchi","email":"emilien@redhat.com","username":"emilienm"},"change_message_id":"2d4a541500556fbf685499daaef96785120010e0","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        # Switch to using vs_bridge once the support is available."},{"line_number":122,"context_line":"        exec { $br:"},{"line_number":123,"context_line":"          command \u003d\u003e \"ovs-vsctl --timeout\u003d5 set Bridge ${br} other-config:mac-table-size\u003d${mac_table_size}\","},{"line_number":124,"context_line":"          onlyif  \u003d\u003e \"ovs-vsctl show | grep \\\"${br}\\\"\","},{"line_number":125,"context_line":"          path    \u003d\u003e \u0027/usr/sbin:/usr/bin:/sbin:/bin\u0027,"},{"line_number":126,"context_line":"        }"},{"line_number":127,"context_line":"      }"}],"source_content_type":"text/x-puppet","patch_set":4,"id":"5f7c97a3_84cebd80","line":124,"updated":"2018-07-09 12:49:55.000000000","message":"I\u0027m not sure this \"onlyif\" command will make the exec idempotent. If we run puppet a second time, it\u0027s very likely that the bridge already exists so the command will run again, right? Do we have any way to query ovs to check the mac table size?","commit_id":"60155bd46ca21fb35e2db09423ee7225c0770ddf"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"164b58cac90653d3c636ecd027b1ec8f0ddb1e4a","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        # Switch to using vs_bridge once the support is available."},{"line_number":122,"context_line":"        exec { $br:"},{"line_number":123,"context_line":"          command \u003d\u003e \"ovs-vsctl --timeout\u003d5 set Bridge ${br} other-config:mac-table-size\u003d${mac_table_size}\","},{"line_number":124,"context_line":"          onlyif  \u003d\u003e \"ovs-vsctl show | grep \\\"${br}\\\"\","},{"line_number":125,"context_line":"          path    \u003d\u003e \u0027/usr/sbin:/usr/bin:/sbin:/bin\u0027,"},{"line_number":126,"context_line":"        }"},{"line_number":127,"context_line":"      }"}],"source_content_type":"text/x-puppet","patch_set":4,"id":"5f7c97a3_fdc0294d","line":124,"in_reply_to":"5f7c97a3_141f0db9","updated":"2018-07-11 15:22:34.000000000","message":"So, to run the above command only if required, I need to run the below commands in shell \n\n******\npresent_mac_table_size\u003d$(ovs-vsctl get bridge $br other-config:mac-table-size)\n\nif [ \"$present_mac_table_size\" !\u003d \"$mac_table_size\" ]; then\n    ovs-vsctl set bridge $br other-config:mac_table_size\u003d$mac_table_size\nfi\n******\n\nTo get the present mac_table_size, we need to run the \"ovs-vsctl get...\" command using exec{..}.\n\nWhen puppet runs this exec, does it mark as changed ? \n\nHow would puppet come to know if things have changed or not ?","commit_id":"60155bd46ca21fb35e2db09423ee7225c0770ddf"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"5e15a515cb1ac6dc450e8888dfb568b6bd89c758","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        # Switch to using vs_bridge once the support is available."},{"line_number":122,"context_line":"        exec { $br:"},{"line_number":123,"context_line":"          command \u003d\u003e \"ovs-vsctl --timeout\u003d5 set Bridge ${br} other-config:mac-table-size\u003d${mac_table_size}\","},{"line_number":124,"context_line":"          onlyif  \u003d\u003e \"ovs-vsctl show | grep \\\"${br}\\\"\","},{"line_number":125,"context_line":"          path    \u003d\u003e \u0027/usr/sbin:/usr/bin:/sbin:/bin\u0027,"},{"line_number":126,"context_line":"        }"},{"line_number":127,"context_line":"      }"}],"source_content_type":"text/x-puppet","patch_set":4,"id":"5f7c97a3_9bb91318","line":124,"in_reply_to":"5f7c97a3_7a93fa5c","updated":"2018-07-10 22:06:13.000000000","message":"The harm is from a puppet standpoint. 2nd runs should not mark things as changed if they do not need to be as it can trigger service restarts or other unintended changes","commit_id":"60155bd46ca21fb35e2db09423ee7225c0770ddf"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"f90e258d10d6167f926f83b276858cf71fe3c08b","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        # Switch to using vs_bridge once the support is available."},{"line_number":122,"context_line":"        exec { $br:"},{"line_number":123,"context_line":"          command \u003d\u003e \"ovs-vsctl --timeout\u003d5 set Bridge ${br} other-config:mac-table-size\u003d${mac_table_size}\","},{"line_number":124,"context_line":"          onlyif  \u003d\u003e \"ovs-vsctl show | grep \\\"${br}\\\"\","},{"line_number":125,"context_line":"          path    \u003d\u003e \u0027/usr/sbin:/usr/bin:/sbin:/bin\u0027,"},{"line_number":126,"context_line":"        }"},{"line_number":127,"context_line":"      }"}],"source_content_type":"text/x-puppet","patch_set":4,"id":"5f7c97a3_7a93fa5c","line":124,"in_reply_to":"5f7c97a3_84cebd80","updated":"2018-07-09 14:16:29.000000000","message":"The idea of adding \"onlyif\" condition was to make sure that the bridge $br exists before setting other-config:mac-table-size.\n\nWe can definitely query the mac table size - by running\novs-vsctl get bridge br other-config:mac-table-size.\n\nBut I think this will make the code complicated.\n\nThere is no harm in running the command multiple times - \"ovs-vsctl set bridge br other-config:mac-table-size\u003d50000\" for example will be fine without any issues. When we run this command for the second time, it will be a no-op.\n\nWhen ovs-vsctl is invoked, it first gets the dump of the database. And since the mac-table-size is already to 50000, it won\u0027t even do the db transaction.","commit_id":"60155bd46ca21fb35e2db09423ee7225c0770ddf"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"c4b2f0768351c501fa43ffdb676d98d38bcf9069","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        # Switch to using vs_bridge once the support is available."},{"line_number":122,"context_line":"        exec { $br:"},{"line_number":123,"context_line":"          command \u003d\u003e \"ovs-vsctl --timeout\u003d5 set Bridge ${br} other-config:mac-table-size\u003d${mac_table_size}\","},{"line_number":124,"context_line":"          onlyif  \u003d\u003e \"ovs-vsctl show | grep \\\"${br}\\\"\","},{"line_number":125,"context_line":"          path    \u003d\u003e \u0027/usr/sbin:/usr/bin:/sbin:/bin\u0027,"},{"line_number":126,"context_line":"        }"},{"line_number":127,"context_line":"      }"}],"source_content_type":"text/x-puppet","patch_set":4,"id":"5f7c97a3_141f0db9","line":124,"in_reply_to":"5f7c97a3_9bb91318","updated":"2018-07-11 07:22:05.000000000","message":"Ack. Sorry for my puppet ignorance.\n\nI will update the patch.","commit_id":"60155bd46ca21fb35e2db09423ee7225c0770ddf"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"ff986bfe1341df71a5ca21f1ff662c0ab6958e54","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        # Switch to using vs_bridge once the support is available."},{"line_number":122,"context_line":"        exec { $br:"},{"line_number":123,"context_line":"          command \u003d\u003e \"ovs-vsctl --timeout\u003d5 set Bridge ${br} other-config:mac-table-size\u003d${mac_table_size}\","},{"line_number":124,"context_line":"          onlyif  \u003d\u003e \"ovs-vsctl show | grep \\\"${br}\\\"\","},{"line_number":125,"context_line":"          path    \u003d\u003e \u0027/usr/sbin:/usr/bin:/sbin:/bin\u0027,"},{"line_number":126,"context_line":"        }"},{"line_number":127,"context_line":"      }"}],"source_content_type":"text/x-puppet","patch_set":4,"id":"5f7c97a3_ccd7bcf4","line":124,"in_reply_to":"5f7c97a3_fdc0294d","updated":"2018-07-11 16:51:53.000000000","message":"So this is why doing this in the provider is better because you can do advanced logic there.  In this case, you\u0027d put want some sort of bash logic to return true/false that can be used in an onlyif or unless logic. In this case you\u0027d probably want to use something like...\n\nexec { $br:\n  ...\n  onlyif \u003d\u003e \"test \\$(ovs-vsctl get bridge $br other-config:mac-table-size) -ne $mac_table_size\",\n  ...\n}","commit_id":"60155bd46ca21fb35e2db09423ee7225c0770ddf"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"e751a9a5329b032e2a97d13b7d80571b185936ca","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        # Switch to using vs_bridge once the support is available."},{"line_number":122,"context_line":"        exec { $br:"},{"line_number":123,"context_line":"          command \u003d\u003e \"ovs-vsctl --timeout\u003d5 set Bridge ${br} other-config:mac-table-size\u003d${mac_table_size}\","},{"line_number":124,"context_line":"          unless  \u003d\u003e \"ovs-vsctl get bridge ${br} other-config:mac-table-size | grep -w ${mac_table_size}\","},{"line_number":125,"context_line":"          path    \u003d\u003e \u0027/usr/sbin:/usr/bin:/sbin:/bin\u0027,"},{"line_number":126,"context_line":"        }"},{"line_number":127,"context_line":"      }"}],"source_content_type":"text/x-puppet","patch_set":5,"id":"5f7c97a3_59fe0707","line":124,"updated":"2018-07-23 22:05:01.000000000","message":"This requires that the service be running right? It shouldn\u0027t run first, but it would be a good idea to ensure there\u0027s a require \u003d\u003e Service[\u0027openvswitch\u0027] (or controller if that\u0027s the correct service).  Also it should be grep -q -w ${mac_table_size}","commit_id":"1c0b6188619407b877791f412fccf91849d02f38"}]}
