(if-let [found (first (filter #(true? ("good" %))))]
(.do_something found)if found = myarray.detect {|x| x['good'] == true }
found.do_something
end| (use http-client intarweb uri-common getopt-long json) | |
| (define authorization-method | |
| '#(basic ((username . "user") (password . "pass")))) | |
| (define (github-get-auth path) | |
| (with-input-from-request | |
| (make-request method: 'GET | |
| uri: (uri-reference (string-append | |
| "https://api.github.com/" path)) |
| This has moved to its own repository at: | |
| https://github.com/SUSE-Cloud/keystone-hybrid-backend |
| @contextmanager | |
| def mock_open(filename, contents=None, complain=True): | |
| """Mock __builtin__.open() on a specific filename | |
| Let execution pass through to __builtin__.open() on other | |
| files. Return a BytesIO with :contents: if the file was matched. If | |
| the :contents: parameter is not given or if it None, a BytesIO | |
| instance simulating an empty file is returned. | |
| If :complain: is True (default). Will raise an error if a |
(if-let [found (first (filter #(true? ("good" %))))]
(.do_something found)if found = myarray.detect {|x| x['good'] == true }
found.do_something
endSet to some text value if you want templated config files to contain a custom banner at the top of the written file
default["openstack"]["identity"]["custom_template_banner"] = "
# This file autogenerated by Chef
# Do not edit, changes will be overwritten
"######################################################################## Toggles - These can be overridden at the environment level OS provides packages ######################################################################## Set to some text value if you want templated config files to contain a custom banner at the top of the written file
default["enable_monit"] = false
default["openstack"]["compute"]["custom_template_banner"] = "Set to some text value if you want templated config files to contain a custom banner at the top of the written file
default["openstack"]["network"]["custom_template_banner"] = "
# This file autogenerated by Chef
# Do not edit, changes will be overwritten
"node["openstack"]["identity"]["custom_template_banner"] - Defaults to ``.node["credentials"]["EC2"]["admin"]["access"] - Defaults to ``.node["credentials"]["EC2"]["admin"]["secret"] - Defaults to ``.node["openstack"]["identity"]["db"]["username"] - Defaults to keystone.node["openstack"]["identity"]["db"]["migrate"] - Defaults to true.node["openstack"]["identity"]["verbose"] - Defaults to False.node["openstack"]["identity"]["debug"] - Defaults to False.node["openstack"]["identity"]["service_port"] - Defaults to 5000.node["openstack"]["network"]["custom_template_banner"] - Defaults to ``.node["openstack"]["network"]["verbose"] - Defaults to False.node["openstack"]["network"]["debug"] - Defaults to False.node["openstack"]["network"]["region"] - Defaults to RegionOne.node["openstack"]["network"]["service_user"] - Defaults to quantum.node["openstack"]["network"]["service_role"] - Defaults to admin.node["openstack"]["network"]["service_name"] - Defaults to quantum.node["openstack"]["network"]["service_type"] - Defaults to network.| keycode 192 = minus underscore |