)]}'
{"container_config_scripts/pacemaker_restart_bundle.sh":[{"author":{"_account_id":27978,"name":"pini","email":"pkomarov@redhat.com","username":"pkomarov"},"change_message_id":"45e225912d632a3ca3de5e44f7a43e8be512c59b","unresolved":false,"context_lines":[{"line_number":5,"context_line":"# ./pacemaker_restart_bundle.sh galera-bundle galera"},{"line_number":6,"context_line":"RESOURCE\u003d$1"},{"line_number":7,"context_line":"TRIPLEO_SERVICE\u003d$2"},{"line_number":8,"context_line":": ${TRIPLEO_MINOR_UPDATE\u003dfalse}"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"# try to restart only if resource has been created already"},{"line_number":11,"context_line":"if /usr/sbin/pcs resource show $RESOURCE; then"}],"source_content_type":"text/x-sh","patch_set":1,"id":"3fa7e38b_fb5d3e48","line":8,"range":{"start_line":8,"start_character":0,"end_line":8,"end_character":1},"updated":"2019-10-23 19:13:09.000000000","message":"shouldn\u0027t the colon be before the equal sign ?  \n${parameter:\u003ddefault} , i.e :\n\n: ${TRIPLEO_MINOR_UPDATE\u003dfalse} \u003d\u003e ${TRIPLEO_MINOR_UPDATE:\u003dfalse}\n\n(as in https://www.tldp.org/LDP/abs/html/parameter-substitution.html)..","commit_id":"81610bdc366527d946304014bcd1782cf0a858d8"},{"author":{"_account_id":20778,"name":"Damien Ciabrini","email":"dciabrin@redhat.com","username":"dciabrin"},"change_message_id":"3d953073408ab48127f5121e0c88b6a12a7acd7e","unresolved":false,"context_lines":[{"line_number":5,"context_line":"# ./pacemaker_restart_bundle.sh galera-bundle galera"},{"line_number":6,"context_line":"RESOURCE\u003d$1"},{"line_number":7,"context_line":"TRIPLEO_SERVICE\u003d$2"},{"line_number":8,"context_line":": ${TRIPLEO_MINOR_UPDATE\u003dfalse}"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"# try to restart only if resource has been created already"},{"line_number":11,"context_line":"if /usr/sbin/pcs resource show $RESOURCE; then"}],"source_content_type":"text/x-sh","patch_set":1,"id":"3fa7e38b_d62130fe","line":8,"range":{"start_line":8,"start_character":0,"end_line":8,"end_character":1},"in_reply_to":"3fa7e38b_93a50a4a","updated":"2019-10-24 07:56:40.000000000","message":"I just wanted to avoid a bash error, I\u0027m actually not interested in solving the exact valuation of TRIPLEO_MINOR_UPDATE, since I\u0027m only comparing it explicitly against value \"true\". So I\u0027d say it\u0027s good enough for our need.","commit_id":"81610bdc366527d946304014bcd1782cf0a858d8"},{"author":{"_account_id":8449,"name":"Marios Andreou","email":"marios.andreou@gmail.com","username":"marios"},"change_message_id":"4eb336dff6466ecd7fa0404a3c02389625e438b8","unresolved":false,"context_lines":[{"line_number":5,"context_line":"# ./pacemaker_restart_bundle.sh galera-bundle galera"},{"line_number":6,"context_line":"RESOURCE\u003d$1"},{"line_number":7,"context_line":"TRIPLEO_SERVICE\u003d$2"},{"line_number":8,"context_line":": ${TRIPLEO_MINOR_UPDATE\u003dfalse}"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"# try to restart only if resource has been created already"},{"line_number":11,"context_line":"if /usr/sbin/pcs resource show $RESOURCE; then"}],"source_content_type":"text/x-sh","patch_set":1,"id":"3fa7e38b_964978b8","line":8,"range":{"start_line":8,"start_character":0,"end_line":8,"end_character":1},"in_reply_to":"3fa7e38b_d62130fe","updated":"2019-10-24 08:00:42.000000000","message":"ack OK, but is there a reason, i.e. is \u0027\u003d\u0027 better than \u0027:\u003d\u0027\n\nack per irc just now its urgent","commit_id":"81610bdc366527d946304014bcd1782cf0a858d8"},{"author":{"_account_id":8449,"name":"Marios Andreou","email":"marios.andreou@gmail.com","username":"marios"},"change_message_id":"da330d1c56fba1efd706e4eb1c80cbee3f9d91a1","unresolved":false,"context_lines":[{"line_number":5,"context_line":"# ./pacemaker_restart_bundle.sh galera-bundle galera"},{"line_number":6,"context_line":"RESOURCE\u003d$1"},{"line_number":7,"context_line":"TRIPLEO_SERVICE\u003d$2"},{"line_number":8,"context_line":": ${TRIPLEO_MINOR_UPDATE\u003dfalse}"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"# try to restart only if resource has been created already"},{"line_number":11,"context_line":"if /usr/sbin/pcs resource show $RESOURCE; then"}],"source_content_type":"text/x-sh","patch_set":1,"id":"3fa7e38b_93a50a4a","line":8,"range":{"start_line":8,"start_character":0,"end_line":8,"end_character":1},"in_reply_to":"3fa7e38b_d94dea3b","updated":"2019-10-24 06:51:45.000000000","message":"ack on that but Pini is also right, at least I\u0027ve only ever seen that conditional assignment with \":\" i.e.:\n\n: ${TRIPLEO_MINOR_UPDATE:\u003dfalse}\n\nand it also solves the empty string case:\n\n[m@192 ~]$ FOO\u003d\"\" ; bash -uc : ${FOO:\u003dfoo}; echo $FOO\nfoo\n[m@192 ~]$ FOO\u003d\"\" ; bash -uc : ${FOO\u003dfoo}; echo $FOO","commit_id":"81610bdc366527d946304014bcd1782cf0a858d8"},{"author":{"_account_id":20778,"name":"Damien Ciabrini","email":"dciabrin@redhat.com","username":"dciabrin"},"change_message_id":"8d286d452bc8b3d2c2ad6c798d13a966242ec276","unresolved":false,"context_lines":[{"line_number":5,"context_line":"# ./pacemaker_restart_bundle.sh galera-bundle galera"},{"line_number":6,"context_line":"RESOURCE\u003d$1"},{"line_number":7,"context_line":"TRIPLEO_SERVICE\u003d$2"},{"line_number":8,"context_line":": ${TRIPLEO_MINOR_UPDATE\u003dfalse}"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"# try to restart only if resource has been created already"},{"line_number":11,"context_line":"if /usr/sbin/pcs resource show $RESOURCE; then"}],"source_content_type":"text/x-sh","patch_set":1,"id":"3fa7e38b_fee44c10","line":8,"range":{"start_line":8,"start_character":0,"end_line":8,"end_character":1},"in_reply_to":"3fa7e38b_fb5d3e48","updated":"2019-10-23 19:44:56.000000000","message":"No I do that on purpose, this is a bash idiom that uses the \u0027:\u0027 operation to ignore the output of this statement, but still execute run the variable assignment as a side effect.\n\nThen I\u0027m trying to avoid undefined variable only, because I run set -u. So I only want to assign a value if the variable has never been set before. So per your link above, I shall use ${parameter\u003ddefault}\n\nTo summarize: I want to avoid this error:\n\n    # bash -uc \u0027echo $FOO\u0027    \n    bash: FOO: unbound variable\n\nSo I\u0027m setting a value to FOO:\n\n    # bash -uc \u0027: ${FOO\u003dfoo}; echo $FOO\u0027\n    foo\n\nBut only if FOO has no value already set:\n\n    # FOO\u003dbar bash -uc \u0027: ${FOO\u003dfoo}; echo $FOO\u0027 \n    bar\n\nAnd if FOO is empty, I don\u0027t care either, because that doesn\u0027t cause an error:\n\n    # FOO\u003d bash -uc \u0027: ${FOO\u003dfoo}; echo $FOO\u0027","commit_id":"81610bdc366527d946304014bcd1782cf0a858d8"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"8deaa5f1242911073733697a4f96e8aa88c1ffdb","unresolved":false,"context_lines":[{"line_number":5,"context_line":"# ./pacemaker_restart_bundle.sh galera-bundle galera"},{"line_number":6,"context_line":"RESOURCE\u003d$1"},{"line_number":7,"context_line":"TRIPLEO_SERVICE\u003d$2"},{"line_number":8,"context_line":": ${TRIPLEO_MINOR_UPDATE\u003dfalse}"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"# try to restart only if resource has been created already"},{"line_number":11,"context_line":"if /usr/sbin/pcs resource show $RESOURCE; then"}],"source_content_type":"text/x-sh","patch_set":1,"id":"3fa7e38b_814e0936","line":8,"range":{"start_line":8,"start_character":0,"end_line":8,"end_character":1},"in_reply_to":"3fa7e38b_fee44c10","updated":"2019-10-24 15:39:36.000000000","message":"IMHO TRIPLEO_MINOR_UPDATE\u003d\"${TRIPLEO_MINOR_UPDATE:-false}\" would make this much more readable. I had no idea what this syntax does (and clearly i\u0027m not alone in this)","commit_id":"81610bdc366527d946304014bcd1782cf0a858d8"},{"author":{"_account_id":27978,"name":"pini","email":"pkomarov@redhat.com","username":"pkomarov"},"change_message_id":"f44602fcce45a91d51a016cd9beee6953a547047","unresolved":false,"context_lines":[{"line_number":5,"context_line":"# ./pacemaker_restart_bundle.sh galera-bundle galera"},{"line_number":6,"context_line":"RESOURCE\u003d$1"},{"line_number":7,"context_line":"TRIPLEO_SERVICE\u003d$2"},{"line_number":8,"context_line":": ${TRIPLEO_MINOR_UPDATE\u003dfalse}"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"# try to restart only if resource has been created already"},{"line_number":11,"context_line":"if /usr/sbin/pcs resource show $RESOURCE; then"}],"source_content_type":"text/x-sh","patch_set":1,"id":"3fa7e38b_d94dea3b","line":8,"range":{"start_line":8,"start_character":0,"end_line":8,"end_character":1},"in_reply_to":"3fa7e38b_fee44c10","updated":"2019-10-23 20:39:56.000000000","message":"cool :), thanks for the explanation","commit_id":"81610bdc366527d946304014bcd1782cf0a858d8"}]}
