Extend the unit tests of the inet6_prefix() function to
test input including the prefix ('inet6:[2001::01]:80').
Change-Id: I68ead773868bd418f10a480f2b7b7fc08084374e
Utility to handle prefixing IPv6 address with `inet6:`.
This is useful for services relying on python-memcached
which require the inet6:[<ip_address]:<port> format.
Change-Id: Ibd280929f62bae61f34b2984af7710fbd422264b
Currently we only allow to use strings
as the data type for ports.
Due to this we need to cast the data type
in the puppet modules because from THT
this is configured as a Number.
This submission allow to use either string
or numbers for the port parameter in the
os_transport_url function.
Change-Id: I9e56f8e2de542b20fe9e6995506cff5bb435e220
Closes-Bug: #1664561
The ssl paramter of the os_transport_url should be 0/1 but we do not
ensure that this is the value being used in the creation of the
transport_url. This change leverages the stdlib str2bool and bool2num to
ensure that when provided the ssl paramter ends up being 0/1 which is
the correct format for the transport url. Additionally this also allows
for string booleans to be passed into the ssl parameter and it should
still work correctly.
Change-Id: I278559ba98ba48974ae590dc1e0bb99b6ab961d7
If an array with a single host is passed into the hosts param, the
function was erroring because the host was getting converted to a string
when it was checking for bracketing for ipv6. This change checks the
type and fixes the case where a single host is being passed so it
continues to function.
Change-Id: I91b9959a6f71b4e6885e55a568116cc28cf16ddd
Closes-Bug: #1650042
This change adds a os_transport_url function that can be used to
generate correct URIs for the transport_url setting used by
oslo.messaging.
Change-Id: If83c0f0e61a08061334536399a42767a305966b7
Allow to give an array of IP addresses to normalize_ip_for_url function.
Each IP in the list will be normalized like it would be for a string.
Change-Id: I8d361ce9cfcfe6a3f8592b2b7991971a3c748c75
Co-Authored-By: Athlan-Guyot sofer <sathlang@redhat.com>
This add the function normalize_ip_for_uri to the parser. It encloses
into brackets any valid IPv6 address thrown at it.
Change-Id: I093dd5a4e6294e20761cb3d33373652eeadeac36
Closes-bug: 1531960
Add support for providing additional parameters to be used when
constructing the database uri. This change adds an 'extra' parameter
which is a hash that will be joined together when constructing the
database uri. It should be noted that the charset option, which can be
provided as a standalone option, will override charset when passed in
the 'extra' parameter. This is to maintain backwards compatibility.
Usage Example:
os_database_connection({
...
extra => { 'charset' => 'utf-8', 'read_timeout' => 60 }
})
Change-Id: I7ef078b76ac6cd7bea42a0ac92b383cefd47167a
Co-Authored-By: Alex Schultz <aschultz@mirantis.com>
This change creates a parser function that can be used to check if a
value is set to the '<SERVICE DEFAULT>' string. The is_service_default
function will return true if the parameter passed in is '<SERVICE
DEFAULT>' otherwise it returns false.
Checks like:
if ($our_param == '<SERVICE DEFAULT>') { ... }
Should be replaced with:
if is_service_default($our_param) { ... }
This change will also be useful if we ever refactor the default value
string or have different values as this function could be updated to
support multiple values without having to adjust the calling code.
Change-Id: I07b8b9b54ed1e88891f74da9b930e4f39876a607
This patch aim to update our specs test in order to work with the rspec-puppet
release 2.0.0, in the mean time, we update rspec syntax order to be prepared
for rspec 3.x move.
In details:
* Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0
* Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x)
* Fix spec tests for rspec-puppet 2.0.0
* Clean Gemfile (remove over-specificication of runtime deps of
puppetlabs_spec_helper)
Change-Id: Ice356e35a65204a62e47f49dd4f5816208a6dace
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
The os_database_connection function is an helper used to build
database connection URI from various parameters.
Example:
os_database_connection({
dialect => 'mysql',
host => '127.0.0.1',
port => '3306',
username => 'guest',
password => 's3cr3t',
database => 'test',
charset => 'utf-8'
})
Result:
mysql://guest:s3cr3t@127.0.0.1:3306/test?charset=utf-8
Change-Id: Id0bde33891112e36f13d3f8fdf0ff89820c09c01